diff options
author | Ned Deily <nad@python.org> | 2021-05-03 00:28:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-03 00:28:43 (GMT) |
commit | 870317825822c856490a32eee037fec8057690b1 (patch) | |
tree | 74c832aa140122ac31357d8150c744b5edf05a38 /Lib/distutils | |
parent | 33ec88ac81f23668293d101b83367b086c795e5e (diff) | |
download | cpython-870317825822c856490a32eee037fec8057690b1.zip cpython-870317825822c856490a32eee037fec8057690b1.tar.gz cpython-870317825822c856490a32eee037fec8057690b1.tar.bz2 |
bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3 (GH-25827)
Only complain if the config target is >= 10.3 and the current target is
< 10.3. The check was originally added to ensure that incompatible
LDSHARED flags are not used, because -undefined dynamic_lookup is
used when building for 10.3 and later, and is not supported on older OS
versions. Apart from that, there should be no problem in general
with using an older target.
Authored-by: Joshua Root <jmr@macports.org>
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/spawn.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index 0d1bd03..31df3f7 100644 --- a/Lib/distutils/spawn.py +++ b/Lib/distutils/spawn.py @@ -59,13 +59,17 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0): if _cfg_target: _cfg_target_split = [int(x) for x in _cfg_target.split('.')] if _cfg_target: - # ensure that the deployment target of build process is not less - # than that used when the interpreter was built. This ensures - # extension modules are built with correct compatibility values + # Ensure that the deployment target of the build process is not + # less than 10.3 if the interpreter was built for 10.3 or later. + # This ensures extension modules are built with correct + # compatibility values, specifically LDSHARED which can use + # '-undefined dynamic_lookup' which only works on >= 10.3. cur_target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', _cfg_target) - if _cfg_target_split > [int(x) for x in cur_target.split('.')]: + cur_target_split = [int(x) for x in cur_target.split('.')] + if _cfg_target_split[:2] >= [10, 3] and cur_target_split[:2] < [10, 3]: my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: ' - 'now "%s" but "%s" during configure' + 'now "%s" but "%s" during configure;' + 'must use 10.3 or later' % (cur_target, _cfg_target)) raise DistutilsPlatformError(my_msg) env = dict(os.environ, |