Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 390861 - Bootstrapping on Mac OS X fails when compiling python
Summary: Bootstrapping on Mac OS X fails when compiling python
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: x86 OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL: http://forums.gentoo.org/viewtopic-t-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-17 19:20 UTC by Volker Wegert
Modified: 2011-12-02 07:36 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Wegert 2011-11-17 19:20:38 UTC
I'm trying to re-bootstrap Gentoo-prefix on two macs (10.6.8 with all updates installed, including Xcode) following the instructions from http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, and I get the same error on both machines when attempting to re-emerge portage using 
env FEATURES="-collision-protect" emerge --oneshot portage 

The error message is 
... 
make[1]: Leaving directory `/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/work/Python-2.7.2/Mac' 
make DESTDIR=/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/ maninstall 
/Users/mwegert/Library/Gentoo/usr/bin/install -c -m 644 ./Misc/python.man \ 
   /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image//Users/mwegert/Library/Gentoo/usr/lib/Python.framework/Versions/2.7/share/man/man1/python2.7.1
ld: can't open output file for writing: /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/mwegert/Library/Gentoo//usr/bin/python2.7, errno=2 for architecture i386 
collect2: ld returned 1 exit status 
 * ERROR: dev-lang/python-2.7.2 failed (install phase): 
 *   (no error message) 
 * 
 * Call stack: 
 *     ebuild.sh, line  98:  Called src_install 
 *   environment, line 5869:  Called die 
 * The specific snippet of code: 
 *           $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib -o "${ED}"/usr/bin/python${SLOT} Modules/python.o || die; 
 * 
 * If you need support, post the output of 'emerge --info =dev-lang/python-2.7.2', 
 * the complete build log and the output of 'emerge -pqv =dev-lang/python-2.7.2'. 
 * The complete build log is located at '/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/temp/build.log'. 
 * The ebuild environment file is located at '/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/temp/environment'. 
 * S: '/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/work/Python-2.7.2' 

>>> Failed to emerge dev-lang/python-2.7.2 

I already tried to --sync the portage tree on one of the machines, but that didn't help. 

Reproducible: Always




emerge --info =dev-lang/python-2.7.2: 

Code:
Portage 2.2.01.19572-prefix (prefix/darwin/macos/10.6/x86, gcc-4.2.1, unavailable, 10.8.0 i386) 
================================================================= 
                        System Settings 
================================================================= 
System uname: Darwin-10.8.0-i386-64bit 
Timestamp of tree: Wed, 16 Nov 2011 21:40:03 +0000 
distcc 3.1-toolwhip.1 i386-apple-darwin10.0 [disabled] 
app-shells/bash:      4.2_p10 
dev-util/pkgconfig:   0.26 
sys-devel/autoconf:   2.68 
sys-devel/automake:   1.11.1 
sys-devel/gcc-config: 1.4.1-r00.2 
sys-devel/libtool:    2.4-r4 
sys-devel/make:       3.82 
Repositories: gentoo_prefix 
Installed sets: 
ACCEPT_KEYWORDS="~x86-macos" 
ACCEPT_LICENSE="* -@EULA" 
CBUILD="i686-apple-darwin10" 
CFLAGS="-march=prescott" 
CHOST="i686-apple-darwin10" 
CONFIG_PROTECT="/etc" 
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/terminfo" 
CXXFLAGS="" 
DISTDIR="/Users/mwegert/Library/Gentoo/usr/portage/distfiles" 
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" 
FFLAGS="" 
GENTOO_MIRRORS="http://distfiles.gentoo.org" 
LDFLAGS="-Wl,-dead_strip_dylibs" 
PKGDIR="/Users/mwegert/Library/Gentoo/usr/portage/packages" 
PORTAGE_CONFIGROOT="/Users/mwegert/Library/Gentoo/" 
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" 
PORTAGE_TMPDIR="/Users/mwegert/Library/Gentoo/var/tmp" 
PORTDIR="/Users/mwegert/Library/Gentoo/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix" 
USE="aqua coreaudio cracklib cxx mmx mmxext modules ncurses objc objc++ prefix readline sse sse2 ssl x86-macos zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Fabian Groffen gentoo-dev 2011-11-18 06:45:23 UTC
ld: can't open output file for writing:
/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/mwegert/Library/Gentoo//usr/bin/python2.7,
errno=2 for architecture i386 

errno 2 = "No such file or directory"

Just to check, do you have MAKEOPTS set?  (your emerge --info says no)

Can you check up till what directory /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/mwegert/Library/Gentoo//usr/bin exists?
Comment 2 Volker Wegert 2011-11-18 18:35:53 UTC
(In reply to comment #1)
> ld: can't open output file for writing:
> /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/mwegert/Library/Gentoo//usr/bin/python2.7,
> errno=2 for architecture i386 
> 
> errno 2 = "No such file or directory"
> 
> Just to check, do you have MAKEOPTS set?  (your emerge --info says no)

No, I don't. 

> Can you check up till what directory
> /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/mwegert/Library/Gentoo//usr/bin
> exists?

/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/mwegert/Library/Gentoo/usr/bin/ exists - but there is a double slash in the log output that's probably a bad sign...=
Comment 3 Fabian Groffen gentoo-dev 2011-11-18 18:44:23 UTC
This feels like a parallel make issue, but the info here suggests it cannot be that.

On OSX, the double slash shouldn't be a problem.  Just one question that may or may not be relevant here, but is your prefix on a case sensitive filesystem?
Comment 4 Micha van Kesteren 2011-11-22 16:59:49 UTC
I'm having the exact same problem. Only on different architecture. (x86_64)

build log (bottom part):
---------
(...)
make[1]: Leaving directory `/Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/work/Python-2.7.2/Mac'
make DESTDIR=/Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/ maninstall 
/Users/micha/Gentoo/usr/bin/install -c -m 644 ./Misc/python.man \
	/Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image//Users/micha/Gentoo/usr/lib/Python.framework/Versions/2.7/share/man/man1/python2.7.1
ld: can't open output file for writing: /Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/micha/Gentoo//usr/bin/python2.7, errno=2 for architecture x86_64
collect2: ld returned 1 exit status
 [31;01m*[0m ERROR: dev-lang/python-2.7.2 failed (install phase):
 [31;01m*[0m   (no error message)
 [31;01m*[0m 
 [31;01m*[0m Call stack:
 [31;01m*[0m     ebuild.sh, line  98:  Called src_install
 [31;01m*[0m   environment, line 5869:  Called die
 [31;01m*[0m The specific snippet of code:
 [31;01m*[0m           $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib -o "${ED}"/usr/bin/python${SLOT} Modules/python.o || die;
 [31;01m*[0m 
 [31;01m*[0m If you need support, post the output of 'emerge --info =dev-lang/python-2.7.2',
 [31;01m*[0m the complete build log and the output of 'emerge -pqv =dev-lang/python-2.7.2'.
 [31;01m*[0m The complete build log is located at '/Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/temp/build.log'.
 [31;01m*[0m The ebuild environment file is located at '/Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/temp/environment'.
 [31;01m*[0m S: '/Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/work/Python-2.7.2'
------------


Error (from build.log):
ld: can't open output file for writing: /Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/micha/Gentoo//usr/bin/python2.7, errno=2 for architecture x86_64

The encapsulating directory exists:
------------
Galileo:~ micha$ ls -lad /Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/micha/Gentoo//usr/bin
drwxr-xr-x 15 micha staff 510 Nov 22 17:00 /Users/micha/Gentoo/var/tmp/portage/dev-lang/python-2.7.2/image/Users/micha/Gentoo//usr/bin
------------


MAKEOPTS
------------
Galileo:~ micha$ echo $MAKEOPTS

------------
(makeopts is empty/non-existant)


emerge -info
------------

Galileo:~ micha$ emerge --info =dev-lang/python-2.7.2
Portage 2.2.01.19572-prefix (prefix/darwin/macos/10.5/x64, gcc-4.2.1, unavailable, 10.8.0 i386)
=================================================================
                        System Settings
=================================================================
System uname: Darwin-10.8.0-i386-64bit
Timestamp of tree: Thu, 10 Nov 2011 22:40:02 +0000
distcc 3.1-toolwhip.1 i386-apple-darwin10.0 [disabled]
app-shells/bash:      4.2_p10
dev-util/pkgconfig:   0.26
sys-devel/autoconf:   2.68
sys-devel/automake:   1.11.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:    2.4-r4
sys-devel/make:       3.82
Repositories: gentoo_prefix
Installed sets: 
ACCEPT_KEYWORDS="~x64-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin9"
CFLAGS="-march=nocona"
CHOST="x86_64-apple-darwin9"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"
CPPFLAGS="-I/Users/micha/Gentoo/usr/include"
CXXFLAGS=""
DISTDIR="/Users/micha/Gentoo/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-search_paths_first -L/Users/micha/Gentoo/usr/lib -L/Users/micha/Gentoo/lib"
PKGDIR="/Users/micha/Gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/Users/micha/Gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/Users/micha/Gentoo/var/tmp"
PORTDIR="/Users/micha/Gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aqua bootstrap coreaudio cracklib cxx modules ncurses objc objc++ prefix readline x64-macos zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
--------------


On my Mac the filesystem is a strange beast. It looks like it's case sensitive, but I'm not sure. For example, look at this:
-----------
Galileo:temp micha$ touch file
Galileo:temp micha$ touch File
Galileo:temp micha$ touch FILE
Galileo:temp micha$ ls -la
total 0
drwxr-xr-x  3 micha staff  102 Nov 22 17:55 .
drwxr-xr-x 62 micha staff 2108 Nov 22 17:53 ..
-rw-r--r--  1 micha staff    0 Nov 22 17:55 file
Galileo:temp micha$ ls -l File
-rw-r--r-- 1 micha staff 0 Nov 22 17:55 File
Galileo:temp micha$ ls -l FILE
-rw-r--r-- 1 micha staff 0 Nov 22 17:55 FILE
Galileo:temp micha$ ls -l file
-rw-r--r-- 1 micha staff 0 Nov 22 17:55 file
-----------

So i'm guessing my prefix is NOT on a case-sensitive filesystem.
Comment 5 Fabian Groffen gentoo-dev 2011-11-22 17:03:45 UTC
hmmm, this is very odd.  I'll have to rebootstrap myself to investigate this problem
Comment 6 Fabian Groffen gentoo-dev 2011-11-22 17:04:05 UTC
confirming per comment #4
Comment 7 Volker Wegert 2011-11-27 09:34:41 UTC
From http://forums.gentoo.org/viewtopic-p-6883872.html: 

"...it looks like a workaround which i tried and successfully emerged python and then portage: 
env USE="-aqua" FEATURES="-collision-protect" emerge --oneshot portage
I can't confirm this isn't causing side-effects elsewhere but at least i could bootstrap and emerge my Prefix system in Mac OS X Lion."

I can confirm that this lets me emerge portage, but in a later step, when emerge'ing -e system, I get a similar error when merging dev-libs/mpfr-3.1.0:

make[2]: Leaving directory `/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/work/mpfr-3.1.0'
make[1]: Leaving directory `/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/work/mpfr-3.1.0'
/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/temp/environment: line 2615: pushd: /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/image/Users/mwegert/Library/Gentoo//usr/share/doc/mpfr-3.1.0: No such file or directory
!!! dohtml: *.html does not exist
dohtml failed
 * ERROR: dev-libs/mpfr-3.1.0 failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  98:  Called call-ebuildshell 'src_install'
 *   environment, line 395:  Called src_install
 *   environment, line 2616:  Called die
 * The specific snippet of code:
 *       dohtml *.html && rm COPYING* *.html || die;

Note again the double slash in the error message: "/Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/image/Users/mwegert/Library/Gentoo//usr/share/doc/mpfr-3.1.0"

 /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/image/Users/mwegert/Library/Gentoo/usr/share/doc/mpfr-3.1.0 (single slash) does not exist, but /Users/mwegert/Library/Gentoo/var/tmp/portage/dev-libs/mpfr-3.1.0/image/Users/mwegert/Library/Gentoo/usr/share/doc/mpfr/ does.
Comment 8 Fabian Groffen gentoo-dev 2011-11-27 17:50:30 UTC
(In reply to comment #7)
> From http://forums.gentoo.org/viewtopic-p-6883872.html: 
> 
> "...it looks like a workaround which i tried and successfully emerged python
> and then portage: 
> env USE="-aqua" FEATURES="-collision-protect" emerge --oneshot portage
> I can't confirm this isn't causing side-effects elsewhere but at least i could
> bootstrap and emerge my Prefix system in Mac OS X Lion."
> 
> I can confirm that this lets me emerge portage, but in a later step, when
> emerge'ing -e system, I get a similar error when merging dev-libs/mpfr-3.1.0:

Thanks, that's bug #391799.
Comment 9 Fabian Groffen gentoo-dev 2011-12-01 18:13:00 UTC
this one puzzles me, it's reproducable on any mac, it seems (Lion here)
Comment 10 Fabian Groffen gentoo-dev 2011-12-01 18:53:15 UTC
Ok, problem found.  No easy workaround possible.

You can apply this change to usr/portage/dev-lang/python/python-2.7.2.ebuild:

Index: python-2.7.2.ebuild
===================================================================
--- python-2.7.2.ebuild (revision 60212)
+++ python-2.7.2.ebuild (revision 60213)
@@ -385,6 +385,7 @@
 
                # rebuild python executable to be the non-pythonw (python wrapper)
                # version so we don't get framework crap
+               rm "${ED}"/usr/bin/python${SLOT}  # drop existing symlink, bug #390861
                $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
                        -o "${ED}"/usr/bin/python${SLOT} \
                        Modules/python.o || die

Then run `ebuild python-2.7.2.ebuild digest`.

Next, re-execute the env FEATURES=... thing.

I will bump the bootstrap snapshot (if its state allows) tomorrow.
Comment 11 Fabian Groffen gentoo-dev 2011-12-01 20:09:28 UTC
alternatively, you might try an emerge --sync to get the change, now the fix is on the mirrors.
Comment 12 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-01 20:33:34 UTC
(In reply to comment #11)
> alternatively, you might try an emerge --sync to get the change, now the fix is
> on the mirrors.

Please don't. A --sync before the guide tells you too is a sure way to get in trouble. (I help people that do this 2-3 times per month)
Comment 13 Fabian Groffen gentoo-dev 2011-12-02 07:36:26 UTC
Snapshot bumped, verified yesterday.  Thanks for the input, all.