Opened 14 years ago
Last modified 13 years ago
#27916 closed defect
python27 runtime IOError due to MACOSX_DEPLOYMENT_TARGET — at Version 7
Reported by: | joshmoz@… | Owned by: | jwa@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.9.2 |
Keywords: | Cc: | singingwolfboy@…, deric@… | |
Port: | python27 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
I am a Mozilla developer, we recommend that our Mac OS X developers use MacPorts to get build dependencies (like Mercurial, libidl, autoconf213). Mozilla's build system will use python2.7 from MacPorts over the system python if it exists, which it does in my case because it was a dep for something else I installed via MacPorts. I get the following error when trying to build Firefox with a deployment target of MACOSX_DEPLOYMENT_TARGET=10.5:
checking for Python version >= 2.5 but not 3.x... Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 553, in <module> main() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 535, in main known_paths = addusersitepackages(known_paths) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 268, in addusersitepackages user_site = getusersitepackages() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 233, in getuserbase USER_BASE = get_config_var('userbase') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 535, in get_config_var return get_config_vars().get(name) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 434, in get_config_vars _init_posix(_CONFIG_VARS) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 313, in _init_posix raise IOError(msg) IOError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.5" but "10.6" during configure configure: error: Python 2.5 or higher (but not Python 3.x) is required. *** Fix above errors and then restart with "make -f client.mk build" make[1]: *** [configure] Error 1 make[1]: Leaving directory `/Volumes/MozillaBuilds/10_6/ff_200_debug_32' make: *** [/Volumes/MozillaBuilds/10_6/ff_200_debug_32/objdir-debug/Makefile] Error 2 make: Leaving directory `/Volumes/MozillaBuilds/10_6/ff_200_debug_32'
I assume this is because MACOSX_DEPLOYMENT_TARGET is set to 10.5 for the Firefox build but it was set to 10.6 for the python2.7 build. For some reason the current state of MACOSX_DEPLOYMENT_TARGET matters for python2.7 when it shouldn't.
If I force the Firefox build to use python26 from MacPorts (PYTHON=/opt/local/bin/python2.6) this problem doesn't happen so I think this problem is specific to python27 from MacPorts.
Change History (7)
comment:1 Changed 14 years ago by singingwolfboy@…
Cc: | singingwolfboy@… added |
---|
comment:2 Changed 14 years ago by jmroot (Joshua Root)
Owner: | changed from macports-tickets@… to jwa@… |
---|
Please remember to cc the maintainer.
comment:3 Changed 14 years ago by jmroot (Joshua Root)
I doubt this is specific to MacPorts; the code in sysconfig.py raises an error any time the current MDT is lower than the one python was configured with. One workaround would be to use the (unsupported) macosx_deployment_target setting in macports.conf to build python27 targeting 10.5.
comment:5 Changed 14 years ago by deric@…
The python_select
port in macports will allow you to easily switch between different versions of python installed by macports and the apple supplied one. This checking of MACOSX_DEPLOYMENT_TARGET is a bit dubious imo. since the site module always is imported automatically during initializtion and the getuserbase call then will import the build configuration and bail.
Basically any environment with MACOSX_DEPLOYMENT_TARGET set to something below what python2.7 was built with will not run. Another quick workaround is setting MACOSX_DEPLOYMENT_TARGET in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile since that's where sysconfig is getting the value from.
comment:7 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
Cc Me!