[New-bugs-announce] [issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

FX Coudert report at bugs.python.org
Sun Nov 29 10:16:04 EST 2020


New submission from FX Coudert <fxcoudert at gmail.com>:

With macOS Big Sur (11.y.z), the major version is 11 (instead of the earlier 10.15, 10.14, etc). Therefore, MACOSX_DEPLOYMENT_TARGET=11 has become a valid setting. It is accepted by system tools:

$ MACOSX_DEPLOYMENT_TARGET=11 clang a.c && echo $?
0

But it leads to failure in Python compilation in setup.py:

DYLD_FRAMEWORK_PATH=/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0 CC='clang' LDSHARED='clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk   ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall'   _TCLTK_INCLUDES='' _TCLTK_LIBS=''       ./python.exe -E ./setup.py  build
running build
running build_ext
Traceback (most recent call last):
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/./setup.py", line 2614, in <module>
    main()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/./setup.py", line 2584, in main
    setup(# PyPI Metadata (PEP 301)
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/Lib/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/./setup.py", line 470, in build_extensions
    self.detect_modules()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/./setup.py", line 1807, in detect_modules
    self.detect_readline_curses()
  File "/private/tmp/python at 3.9-20201127-81873-q9b09s/Python-3.9.0/./setup.py", line 1038, in detect_readline_curses
    (tuple(int(n) for n in dep_target.split('.')[0:2])
AttributeError: 'int' object has no attribute 'split'
make: *** [sharedmods] Error 1

See the full report here: https://github.com/Homebrew/brew/issues/9329

The problem is here: https://github.com/python/cpython/blob/master/setup.py#L1015
When MACOSX_DEPLOYMENT_TARGET=11, this call:
sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
returns an int (with value 11) instead of a string (as is the case if 11.0, 10.15, etc).

And therefore the subsequent call to: dep_target.split('.')[0:2] fails, because split() cannot be called on an int.

----------
components: Build
messages: 382071
nosy: fxcoudert
priority: normal
severity: normal
status: open
title: Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur
type: compile error
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42504>
_______________________________________


More information about the New-bugs-announce mailing list