[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure

Ronald Oussoren report at bugs.python.org
Tue Aug 17 22:06:42 CEST 2010


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

This (untested) patch should fix the issue:


Index: Lib/sysconfig.py
===================================================================
--- Lib/sysconfig.py	(revision 84147)
+++ Lib/sysconfig.py	(working copy)
@@ -295,9 +295,8 @@
             cur_target = cfg_target
             os.putenv('MACOSX_DEPLOYMENT_TARGET', cfg_target)
         elif map(int, cfg_target.split('.')) > map(int, cur_target.split('.')):
-            msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" '
-                   'during configure' % (cur_target, cfg_target))
-            raise IOError(msg)
+            os.putenv('MACOSX_DEPLOYMENT_TARGET', cfg_target)
+            cfg_target = cur_target
 
     # On AIX, there are wrong paths to the linker scripts in the Makefile
     # -- these paths are relative to the Python source, but when installed


This removes the exception, and instead replaces the incompatible environment setting by the configured setting.

It might be better to just have:

Index: Lib/sysconfig.py
===================================================================
--- Lib/sysconfig.py	(revision 84147)
+++ Lib/sysconfig.py	(working copy)
@@ -291,13 +291,8 @@
     if sys.platform == 'darwin' and 'MACOSX_DEPLOYMENT_TARGET' in vars:
         cfg_target = vars['MACOSX_DEPLOYMENT_TARGET']
         cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
-        if cur_target == '':
-            cur_target = cfg_target
+        if cur_target != cfg_target:
             os.putenv('MACOSX_DEPLOYMENT_TARGET', cfg_target)
-        elif map(int, cfg_target.split('.')) > map(int, cur_target.split('.')):
-            msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" '
-                   'during configure' % (cur_target, cfg_target))
-            raise IOError(msg)
 
     # On AIX, there are wrong paths to the linker scripts in the Makefile
     # -- these paths are relative to the Python source, but when installed


This entirely ignores the environment variable and always uses the value that was present during the configure run.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9516>
_______________________________________


More information about the Python-bugs-list mailing list