Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 428530 - bootstrap: OSX 10.8 Mountain Lion Support (from scratch)
Summary: bootstrap: OSX 10.8 Mountain Lion Support (from scratch)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal enhancement (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on: 430848 430860
Blocks:
  Show dependency tree
 
Reported: 2012-07-29 16:57 UTC by Harald Glatt (hachre)
Modified: 2012-08-15 07:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
10.8 Installation Notes (GentooPrefixOnOSX108MountainLionInstallNotes.txt,2.98 KB, text/plain)
2012-07-29 16:58 UTC, Harald Glatt (hachre)
Details
Patch to include 10.8 in bootstrap-prefix.sh (bootstrap-prefix.sh.patch,568 bytes, patch)
2012-07-30 15:18 UTC, Harald Glatt (hachre)
Details | Diff
10.8 Installation Notes Revision 1 (10.8 Installation Notes Revision 1.txt,4.19 KB, text/plain)
2012-07-30 20:31 UTC, Harald Glatt (hachre)
Details
10.8 Installation Notes Revision 2 (10.8 Installation Notes Revision 2.txt,4.03 KB, text/plain)
2012-08-04 14:47 UTC, Harald Glatt (hachre)
Details
10.8 Installation Notes Revision 3 (10.8 Installation Notes Revision 3.txt,2.49 KB, text/plain)
2012-08-10 16:31 UTC, Harald Glatt (hachre)
Details
10.8 Installation Notes Revision 4 (10.8 Installation Notes Revision 4.txt,1.01 KB, text/plain)
2012-08-12 17:48 UTC, Harald Glatt (hachre)
Details
10.8 Installation Notes Revison 4.1 (10.8 Installation Notes Revision 4.1.txt,1.55 KB, text/plain)
2012-08-12 22:44 UTC, Harald Glatt (hachre)
Details
10.8 Installation Notes Revision 5 (10.8 Installation Notes Revision 5.txt,1.04 KB, text/plain)
2012-08-15 03:41 UTC, Harald Glatt (hachre)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Glatt (hachre) 2012-07-29 16:57:10 UTC
This bug includes notes on how to get Prefix fully running on OS X 10.8 Mountain Lion.

Reproducible: Always
Comment 1 Harald Glatt (hachre) 2012-07-29 16:58:35 UTC
Created attachment 319612 [details]
10.8 Installation Notes
Comment 2 Harald Glatt (hachre) 2012-07-29 16:59:22 UTC
If you need additional info, and testing for fixed things, I'm glad to help (hachre on irc.freenode.net #gentoo-prefix)
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-30 13:56:58 UTC
Hmm, so I gather that two major things will help:
1) package md.c and install it
2) figure out that CHOST switching thing

Also, why do you need to set PYTHONPATH. We already do that in bootstrap-prefix.sh:

        # Set correct PYTHONPATH for Portage, since our Python lives in
        # $EPREFIX/tmp, bug #407573
        echo "PYTHONPATH=${ROOT}/usr/lib/portage/pym" >> "${profile}"/make.defaults
Comment 4 Harald Glatt (hachre) 2012-07-30 13:59:36 UTC
I guess it is because I had to manually create the make.profile symlink and create my own 10.8 profile the way I did? Not entirely sure... I'll try to figure it out and get back to you.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-30 14:04:35 UTC
Ok, yea. I hinted at that in IRC. The first step for 10.8 support should be:

1) Create 10.8 profile by renaming 10.7
2) Test that bootstrap-prefix.sh uses the 10.8 profile
3) Edit/modify 10.8 profile as needed.

If you can confirm 1) & 2) - that is a good first step and we can commit that (I've been waiting for someone to report this from everyone that I talk to).
Comment 6 Harald Glatt (hachre) 2012-07-30 14:05:41 UTC
Will do!
Comment 7 Harald Glatt (hachre) 2012-07-30 15:18:15 UTC
Created attachment 319726 [details, diff]
Patch to include 10.8 in bootstrap-prefix.sh
Comment 8 Harald Glatt (hachre) 2012-07-30 15:20:10 UTC
This patch together with copying the 10.7 profile to 10.8 and editing the following files to update the version or CHOST correctly installed the profile:

profiles/prefix/darwin/macos/10.8:
make.defaults
profile.bashrc
x64/make.defaults
x86/make.defaults

More testing results coming soon!
Comment 9 Harald Glatt (hachre) 2012-07-30 20:31:55 UTC
Created attachment 319780 [details]
10.8 Installation Notes Revision 1
Comment 10 Harald Glatt (hachre) 2012-07-30 20:32:37 UTC
Some things have been fixed through the new profile thing, others have not. The new attachment represents that current state of how things are working.
Comment 11 Fabian Groffen gentoo-dev 2012-07-31 12:42:15 UTC
that CHOST hack hints are some libtool fix waiting to be made, and need for elibtoolize/ELT-patch
Comment 12 Fabian Groffen gentoo-dev 2012-07-31 12:43:02 UTC
oh, and someone should add the 10.8 profile for you + bootstrap script support, before I get to it
Comment 13 Fabian Groffen gentoo-dev 2012-07-31 16:07:09 UTC
bootstrap-prefix.sh done
(warning, profiles not added yet)
Comment 14 Fabian Groffen gentoo-dev 2012-07-31 16:25:23 UTC
Profiles added to CVS.
Comment 15 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-31 16:52:55 UTC
Fabian, do you know why the bootstrap-macos.xml guide has the user install readline? Was it an oversight from when bash grew the readline USE flag? Note: I added USE=-readline to bootstrap-prefix.sh some time ago, so I feel like macos has this readline stuff by error now.
Comment 16 Fabian Groffen gentoo-dev 2012-07-31 16:56:33 UTC
revision 1.70
date: 2012-06-30 20:09:55 +0200;  author: grobian;  state: Exp;  lines: +4 -3;  commitid: 70284fef40f34567;
Fix bootstrapping of bash

if it has -readline these days, I think it can go
Comment 17 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-31 17:09:40 UTC
(In reply to comment #16)
> revision 1.70
> date: 2012-06-30 20:09:55 +0200;  author: grobian;  state: Exp;  lines: +4
> -3;  commitid: 70284fef40f34567;
> Fix bootstrapping of bash
> 
> if it has -readline these days, I think it can go

Yea, I did that some time ago.

------------------------------------------------------------------------
r61050 | darkside | 2012-07-09 10:13:33 -0500 (Mon, 09 Jul 2012) | 1 line

disable USE=readline since that is fragile when initially installing bash (bash needs readline, readline needs ncurses)
------------------------------------------------------------------------

So, we see a divergance of the guides by both of us. You preferred to fix macos guide (and not solaris) and I fixed the solaris guide (via bootstrap-prefix.sh) but didn't look at macos guide. :)
Comment 18 Fabian Groffen gentoo-dev 2012-07-31 19:46:07 UTC
(In reply to comment #17)
> So, we see a divergance of the guides by both of us. You preferred to fix
> macos guide (and not solaris) and I fixed the solaris guide (via
> bootstrap-prefix.sh) but didn't look at macos guide. :)

:)

Heads up, I did some major work on bootstrap-prefix.sh.

I dropped all versions, each target tries all versions we know until one succeeds.

Next step is to make a function to perform all the initial packages to bootstrap based on CHOST.

This way, we put all the knowledge in the script.

(yes, I've started to change my mind on education/understanding/etc.)
Comment 19 Harald Glatt (hachre) 2012-07-31 19:47:31 UTC
Great, I'm excited :) Can't wait to try it out!
Comment 20 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-31 20:35:32 UTC
Modified:             bootstrap-macos.xml bootstrap-solaris.xml
  Log:
  try to create some synergy wrt bash in the bootstrap instructions
Comment 21 Harald Glatt (hachre) 2012-08-02 15:07:12 UTC
I'm running a bootstrap with the new bootstrap-prefix script and the edited guide with a latest-tree to see what issues remain now atm. I will post once I have results!
Comment 22 Richard Yao (RETIRED) gentoo-dev 2012-08-04 08:23:16 UTC
(In reply to comment #3)
> Hmm, so I gather that two major things will help:
> 1) package md.c and install it

This is now available in the main tree as sys-devel/md. I am the maintainer.
Comment 23 Fabian Groffen gentoo-dev 2012-08-04 08:35:24 UTC
which md is that?  wasn't it a bit more sensical to just include this in darwin-miscutils?
Comment 24 Richard Yao (RETIRED) gentoo-dev 2012-08-04 09:07:20 UTC
(In reply to comment #23)
> which md is that?  wasn't it a bit more sensical to just include this in
> darwin-miscutils?

It is the following md:

http://www.opensource.apple.com/source/adv_cmds/adv_cmds-147/md/

It would be less hassle to have a separate ebuild. The GNU project will eventually patch binutils' build system so that it no longer needs this tool.

If we want to eliminate the separate ebuild, patching binutils for upstream would probably be better than moving this into sys-apps/darwin-miscutils.
Comment 25 Fabian Groffen gentoo-dev 2012-08-04 09:11:48 UTC
I don't understand.

md seems to be necessary on a Mac, on Linux I don't have md

(besides md being used by the compiler, isn't it?)

so isn't it just another "darwin" tool then?  It's obviously an Apple tool...



and my gx86 cvs tree has no sys-devel/md
Comment 26 Richard Yao (RETIRED) gentoo-dev 2012-08-04 09:25:58 UTC
(In reply to comment #25)
> I don't understand.
> 
> md seems to be necessary on a Mac, on Linux I don't have md
> 
> (besides md being used by the compiler, isn't it?)
> 
> so isn't it just another "darwin" tool then?  It's obviously an Apple tool...

This appears to be a tool that Darwin inherited from Carnegie Mellon's Mach. The man page says that it processes "raw dependency files produced by cpp -MD". The build system should require this functionality on all platforms. Using a platform-specific tool to do it only makes sense if no one cared enough to make the behavior consistent. Upstream needs to change this now that md is no longer provided on Mac OS X 10.8. If they do not, they will no longer be able to claim Mac OS X as a supported platform.

> and my gx86 cvs tree has no sys-devel/md

Update your CVS checkout. I committed the ebuild today in response to popular demand on IRC.
Comment 27 Fabian Groffen gentoo-dev 2012-08-04 09:31:38 UTC
(In reply to comment #26)
> (In reply to comment #25)
> > I don't understand.
> > 
> > md seems to be necessary on a Mac, on Linux I don't have md
> > 
> > (besides md being used by the compiler, isn't it?)
> > 
> > so isn't it just another "darwin" tool then?  It's obviously an Apple tool...
> 
> This appears to be a tool that Darwin inherited from Carnegie Mellon's Mach.
> The man page says that it processes "raw dependency files produced by cpp
> -MD". The build system should require this functionality on all platforms.
> Using a platform-specific tool to do it only makes sense if no one cared
> enough to make the behavior consistent. Upstream needs to change this now
> that md is no longer provided on Mac OS X 10.8. If they do not, they will no
> longer be able to claim Mac OS X as a supported platform.

You DO realise that you're on thin ice, right?  OSX doesn't come with a GCC compiler any more.

> > and my gx86 cvs tree has no sys-devel/md
> 
> Update your CVS checkout. I committed the ebuild today in response to
> popular demand on IRC.

Seems I'm not the only one who hasn't got it:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/md
Comment 28 Fabian Groffen gentoo-dev 2012-08-04 09:41:31 UTC
anyway, it's in darwin-miscutils-10 now
Comment 29 Richard Yao (RETIRED) gentoo-dev 2012-08-04 10:43:28 UTC
(In reply to comment #27)
> Seems I'm not the only one who hasn't got it:
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/md

You can tell that I do not commit new packages very often. I failed to `cvs add` the new directory. Anyway, lets forget about sys-devel/md.
Comment 30 Harald Glatt (hachre) 2012-08-04 14:47:33 UTC
Created attachment 320296 [details]
10.8 Installation Notes Revision 2

Noteable changes:

This was run on latest-tree from August 2nd using the new bootstrap-prefix script.

* bash is no longer masked in my solution, instead =p10 is emerged in the first step and then later updated to p36 because at that point it compiles fine.

* binutils still requires md because the recent changes in this area were introduced after my testing had already started.

* a new problem occurs if tar tries to extract a bzip2 archive, missing a library that is simply misnamed, solution was to symlink to the expected name.

* we still have the glibc compile error not finding libiffi unless PKG_CONFIG_PATH is specified

* we still have the CHOST switching requirements
Comment 31 Harald Glatt (hachre) 2012-08-09 23:10:20 UTC
Grobian, fyi, I tested your stages and got to stage3 where it died on the same bash issue that has been mentioned in my Installation Notes. I'm not sure what the preferred method is to manually intervene here so I stopped there.
Comment 32 Fabian Groffen gentoo-dev 2012-08-10 09:29:56 UTC
I fixed some bugs in stage3 now, and an older bash is used there.  Currently running on Darwin9 (Leopard), will see where I end up today.
Comment 33 Fabian Groffen gentoo-dev 2012-08-10 12:28:36 UTC
bootstrap attempt failed.

The commit regarding readline broke bash, but we work around that now.  But it also broke more intense, due to pax-utils being emerged too late.  I'm currently running stage{1,2,3} + emerge -e system with a moved up pax-utils to see if that works.
Comment 34 Harald Glatt (hachre) 2012-08-10 15:27:14 UTC
I've been doing the same thing, will be done in about two hours or so on Mountain Lion.
Comment 35 Fabian Groffen gentoo-dev 2012-08-10 16:05:44 UTC
I appear to have success now
Comment 36 Harald Glatt (hachre) 2012-08-10 16:20:23 UTC
One thing I can mention right off the bat: md isn't handled by the guide and binutils still fails because it's missing, you have to manually emerge darwin-miscutils to make it work on Mountain Lion.
Comment 37 Fabian Groffen gentoo-dev 2012-08-10 16:25:14 UTC
I just added that to stage3
Comment 38 Harald Glatt (hachre) 2012-08-10 16:30:02 UTC
Well then the only thing missing for Mountain Lion at this point seems to be the CHOST problem for readline and gettext. All the other issues have been addressed, my current test is far in the emerge -e system state already and I'd say it will run through.
Comment 39 Harald Glatt (hachre) 2012-08-10 16:31:02 UTC
Created attachment 320908 [details]
10.8 Installation Notes Revision 3

Describes the last outstanding issues as of now.
Comment 40 Harald Glatt (hachre) 2012-08-10 23:47:26 UTC
Opened bug #430848 for the gettext chost problem which blocks this bug.
Comment 41 Harald Glatt (hachre) 2012-08-11 01:41:30 UTC
Opened bug #430860 for the readline chost problem which blocks this bug.
Comment 42 Harald Glatt (hachre) 2012-08-11 23:45:42 UTC
Gonna do a new bootstrap tonight!
Comment 43 Fabian Groffen gentoo-dev 2012-08-12 07:07:38 UTC
you need latest tree, so perform stage2 manually

Going to bump the snapshot now (Darwin/Solaris fixes)!
Comment 44 Harald Glatt (hachre) 2012-08-12 17:48:20 UTC
The bootstrap was a full success, not a single issue - yes I manually did latest_tree!

But great result: 0 issues!
Comment 45 Harald Glatt (hachre) 2012-08-12 17:48:47 UTC
Created attachment 321144 [details]
10.8 Installation Notes Revision 4
Comment 46 Fabian Groffen gentoo-dev 2012-08-12 17:51:35 UTC
Ok, very cool.  I hope you would like to try my interactive installer that I'm about to commit this afternoon.  It should do exactly as you did, so be a success too!
Comment 47 Harald Glatt (hachre) 2012-08-12 17:54:17 UTC
Sure thing, let me know when it's ready :)
Comment 48 Myk Taylor 2012-08-12 22:31:41 UTC
A couple quick questions: in the installation notes (rev. 4), it says to "follow the instructions at: http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-solaris.xml"

First, since the "Code Listing 1.7: emerge bash" command on that page still fails, should I assume we should only run the

$ ./bootstrap-prefix.sh $EPREFIX/tmp make
...
$ ./bootstrap-prefix.sh $EPREFIX/tmp python
        
and 

$ ./bootstrap-prefix.sh $EPREFIX tree
$ ./bootstrap-prefix.sh $EPREFIX portage

portions before bootstrapping stage 1/2/3?  (building stage3 now, btw)


Second, is http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml obsolete?  Is it only a subset of bootstrap-solaris.xml (which also addresses OSX)?
Comment 49 Harald Glatt (hachre) 2012-08-12 22:38:41 UTC
a) My guide doesn't fully cover the current way to get it working because it was a test run mainly to see if the last remaining bugs had been fixed. 

The instructions are only a fallback by now and not a requirement anymore. In a perfect world all you would need to run is:

./bootstrap-script.sh $EPREFIX/tmp stage1
./bootstrap-script.sh $EPREFIX/tmp stage2
./bootstrap-script.sh $EPREFIX/tmp stage3
emerge -e system

Right now - because the newest fixes aren't yet in a release tree - you need to run the stage2 part manually, as described in the script, and use latest_tree instead of tree.

Stage2 is what the solaris guide does in code listings 1.4 and 1.5.

b) I believe the OSX guide is merged into to solaris guide and obsolete, yes
Comment 50 Harald Glatt (hachre) 2012-08-12 22:39:36 UTC
Make sure you have the latest bootstrap-prefix script, bash should not fail at this point!
Comment 51 Harald Glatt (hachre) 2012-08-12 22:44:59 UTC
Created attachment 321156 [details]
10.8 Installation Notes Revison 4.1

Revision to the 4.0 version, making some things more clear.
Comment 52 Harald Glatt (hachre) 2012-08-12 22:46:21 UTC
Made a mistake in my previous listing which is corrected below, also please see the new Revision 4.1 for more clear instructions on how to do this right now.

(In reply to comment #49)
> ./bootstrap-script.sh $EPREFIX/tmp stage1
> ./bootstrap-script.sh $EPREFIX stage2
> ./bootstrap-script.sh $EPREFIX stage3
> emerge -e system
Comment 53 Fabian Groffen gentoo-dev 2012-08-13 06:37:27 UTC
(In reply to comment #52)
> Made a mistake in my previous listing which is corrected below, also please
> see the new Revision 4.1 for more clear instructions on how to do this right
> now.
> 
> (In reply to comment #49)
> > ./bootstrap-script.sh $EPREFIX/tmp stage1
> > ./bootstrap-script.sh $EPREFIX stage2
> > ./bootstrap-script.sh $EPREFIX stage3
> > emerge -e system

Or, IMO much better/easier/fool-proof:

  ./bootstrap-prefix.sh

and the script will try to get you where you want to go today.
Comment 54 Harald Glatt (hachre) 2012-08-13 09:45:25 UTC
I gotta say the new bootstrap script is great comedy ;D
Comment 55 Harald Glatt (hachre) 2012-08-14 11:41:40 UTC
Running with the new fully automated script. Works like a charm. I'm in 'emerge -e system' and not a single issue so far. Looking good :)
Comment 56 Harald Glatt (hachre) 2012-08-15 03:39:34 UTC
The automated bootstrap worked like a charm :) I consider this bug fixed!
Comment 57 Harald Glatt (hachre) 2012-08-15 03:41:35 UTC
Created attachment 321384 [details]
10.8 Installation Notes Revision 5
Comment 58 Fabian Groffen gentoo-dev 2012-08-15 07:23:40 UTC
very cool!  that reduces your instructions to install xcode, download the script and run it.