[Pythonmac-SIG] building universal binaries

Bob Ippolito bob at redivi.com
Sun Feb 5 07:46:59 CET 2006


On Feb 3, 2006, at 12:10 PM, Bob Ippolito wrote:

> I think the only things missing from my branch currently are:
>
> 1) 10.3.9 support

I believe this is taken care of now that Ronald contributed the weak  
linking patch.

> 2) Universal PythonLauncher

This is done.

> 3) Revamped Mac/OSX/Dist scripts (probably should rewrite all that in
> Python and not hardcode everything)

This isn't done yet, but what we have now is probably a fully usable  
universal Python.

> This backwards incompatible change is mostly just a backport from
> setuptools' pkg_resources module.
>
> $ python -c "from distutils.util import get_platform as p; print p()"
> macosx-10.4.3-fat

This output will now be:
macosx-10.3-fat

The version number is determined from MACOSX_DEPLOYMENT_TARGET (or  
CONFIGURE_MACOSX_DEPLOYMENT_TARGET).  It's relatively safe to assume  
that modules compiled with this build will be compatible with Mac OS  
X 10.3.9 (as long as they don't use 10.4 specific features anyway).

For modules that absolutely require 10.4 you can set the  
MACOSX_DEPLOYMENT_TARGET environment variable at build time (e.g. in  
setup.py) and then the package produced will have a different  
platform string.  setuptools will need work if people actually do  
this, because it will need to know that a Mac OS X 10.4 user can use  
"macosx-10.3-fat" and "macosx-10.4-fat" packages.  It's probably a  
better idea to just write all your code so that it uses weak symbols  
for anything that isn't in 10.3 and raises ImportError on  
initialization if it's not usable.

On another note, I also moved the HAVE_BROKEN_POLL check to runtime  
instead of compile time.  Mac OS X 10.4.4's poll isn't broken, so we  
should be able to use it.  I'm not sure which versions of Mac OS X  
have a broken poll, but the ones that have a working poll will have a  
select.poll object.  This may also benefit other operating systems  
where poll was broken during compile time but was fixed in some update.

-bob



More information about the Pythonmac-SIG mailing list