Author mirell
Recipients blb, brett.cannon, dmw, easel, eric.smith, grdnwsl, jmr, jnoller, mark.dickinson, mirell, mitchellh, ned.deily, ronaldoussoren, xaoslaad
Date 2009-09-02.03:17:05
SpamBayes Score 4.70458e-09
Marked as misclassified No
Message-id <>
This patch allows compiling, and forces everything to be x86_64. 
However, Python 2.6.2 still dies when attempting to install: 

cd Mac && make installmacsubtree DESTDIR=""
DYLD_FRAMEWORK_PATH=/tmp/Python-2.6.2:  ../python.exe 
./scripts/ -v 
Traceback (most recent call last):
  File "./scripts/", line 44, in <module>
  File "./scripts/", line 41, in main
    os.path.walk(dir, handler, (verbose, force))
  File "../Lib/", line 224, in walk
    func(arg, top, names)
  File "./scripts/", line 23, in handler
    macresource.open_pathname(os.path.join(dirname, fn), 
  File "/private/tmp/Python-2.6.2/Lib/plat-mac/", line 81, 
in open_pathname
    refno = Res.FSpOpenResFile(pathname, 1)
AttributeError: 'module' object has no attribute 'FSpOpenResFile'
make[1]: *** [installmacsubtree] Error 1
make: *** [frameworkinstallmaclib] Error 2

This is both with MacPorts, and without MacPorts, in the path, just for 
those who were wary that this was solely a MacPorts issue. 

The reason it is dying is because a large number of the calls in Carbon 
are completely non-existant in 64-bit userspace. An example would be FSpOpenResFile as seen above. 

Apple issued a notice stating that many of these calls would not exist 
in Carbon 64-bit 

What Apple apparently did for their shipped version of Python in Snow 
Leopard was a hack to combine 32-bit parts of Python for Carbon 32-bit 
support, and 64-bits. 

The only way I see currently to compile Python 2.6.2 natively on Mac OS 
10.6 (On a *64-Bit Capable* machine, this is critical) is to add the 
EXTRA_CFLAG "-m32" and patch, for two sections which 
completely ignore/don't include EXTRA_CFLAGS or PY_CFLAGS, or any 
CFLAGS. This pretty much limits you to a 32-bit version of Python. 
Because even doing "--host=i686-apple-darwin10 --target=i686-apple-
darwin10 --with-universal-archs=32-bit", since the default gcc target on 
a 64-bit capable machine is x86_64, it still produces x86_64 code in 
some areas.

By doing this, I was able to get Python 2.6.2 to compile *and* install. 
I'll submit a patch shortly, but the main issue is of course that 
plat_mac contains many 32-bit only references to the Carbon API. The 
true fix is to fix that area. But in the interim, you'll have to compile 
Python as 32-bit.

Also, the patch won't suffice for now, since you *can't* 
build a 64-bit version of Python on MacOSX from what I've seen, and also 
as reported by several other users on MacPorts.
Date User Action Args
2009-09-02 03:17:08mirellsetrecipients: + mirell, brett.cannon, ronaldoussoren, mark.dickinson, blb, eric.smith, dmw, ned.deily, jnoller, jmr, easel, mitchellh, grdnwsl, xaoslaad
2009-09-02 03:17:08mirellsetmessageid: <>
2009-09-02 03:17:07mirelllinkissue6802 messages
2009-09-02 03:17:05mirellcreate