Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Fix a MacOS build failure #18016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

charris
Copy link
Member

@charris charris commented Dec 18, 2020

Backport of #17906.

numpy fails to build on macOS Big Sur, on a Python 3.9.0 that was configured with MACOSX_DEPLOYMENT_TARGET=11:

    File "/private/var/folders/kf/25msxpx52j98k6qm2pgq11rh0000gn/T/pip-req-build-zkhrmwam/numpy/distutils/fcompiler/gnu.py", line 346, in get_flags_linker_so
      flags = GnuFCompiler.get_flags_linker_so(self)
    File "/private/var/folders/kf/25msxpx52j98k6qm2pgq11rh0000gn/T/pip-req-build-zkhrmwam/numpy/distutils/fcompiler/gnu.py", line 136, in get_flags_linker_so
      os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
    File "/usr/local/Cellar/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 684, in __setitem__
      value = self.encodevalue(value)
    File "/usr/local/Cellar/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 756, in encode
      raise TypeError("str expected, not %s" % type(value).__name__)
  TypeError: str expected, not int

On such a system, sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') will return 11 as an int, not as a str. And setting an environment variable to an int is not allowed, and fails as seen above.

@charris charris added this to the 1.20.0 release milestone Dec 18, 2020
@charris charris merged commit 91ab008 into numpy:maintenance/1.20.x Dec 18, 2020
@charris charris deleted the backport-17906 branch December 18, 2020 02:39
lpsinger added a commit to lpsinger/healpy that referenced this pull request Feb 8, 2021
Fixes #18016. Inspired by numpy/numpy#18016.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants