Skip to content
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

bpo-41116: Ensure system supplied libraries are found on macOS 11 #23301

Merged
merged 4 commits into from
Nov 22, 2020

Conversation

ronaldoussoren
Copy link
Contributor

@ronaldoussoren ronaldoussoren commented Nov 15, 2020

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.

The logic is ported from setup.py.

https://bugs.python.org/issue41116

Automerge-Triggered-By: GH:ned-deily

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue that strikes me is the possibility that a user might use more than one compiler and/or SDK during one Python execution. Probably an infrequent occurrence but could be easily handled by caching a dict of looked up SDKs indeed by the cc parameter passed in. Otherwise LGTM in principle.

@ned-deily
Copy link
Member

"indexed"

@ronaldoussoren ronaldoussoren marked this pull request as ready for review November 15, 2020 20:06
@ronaldoussoren ronaldoussoren requested a review from a team as a code owner November 15, 2020 20:06
@ned-deily ned-deily merged commit 404a719 into python:master Nov 22, 2020
@miss-islington
Copy link
Contributor

Thanks @ronaldoussoren for the PR, and @ned-deily for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 22, 2020
…thonGH-23301)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
(cherry picked from commit 404a719)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Nov 22, 2020
@bedevere-bot
Copy link

GH-23455 is a backport of this pull request to the 3.9 branch.

@miss-islington
Copy link
Contributor

Sorry, @ronaldoussoren and @ned-deily, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 404a719b5127602c1a948f8e189ab61cd3f147d8 3.8

ned-deily pushed a commit that referenced this pull request Nov 22, 2020
…-23301) (GH-23455)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
(cherry picked from commit 404a719)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…thonGH-23301)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Apr 29, 2021
…thonGH-23301) (pythonGH-23455)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
(cherry picked from commit 404a719)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
ambv pushed a commit that referenced this pull request May 2, 2021
)

* bpo-41100: Support macOS 11 and Apple Silicon on Python 3.8

This is a partial backport of bpo-41100 changes `e8b1c038b14b5fc8120aab62c9bf5fb840274cb6` and `96d906b144e6e6aa96c5ffebecbcc5d38034bbda` for Python 3.8. We introduce the ability to build Python from source for `arm64` on macOS, but we do not make a promise of support. This allows us to omit support for Universal2 binaries as well as weak-linking of symbols from the macOS SDK based on the deployment target, which are larger changes much more difficult to merge.

This also includes a backport of subsequent bpo-42688 change `7e729978fa08a360cbf936dc215ba7dd25a06a08` to fix build errors with external `libffi`.

* bpo-41116: Ensure system supplied libraries are found on macOS 11 (GH-23301) (GH-23455)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
(cherry picked from commit 404a719)

* bpo-42504: fix for MACOSX_DEPLOYMENT_TARGET=11 (GH-23556)

macOS releases numbering has changed as of macOS 11 Big Sur.  Previously, major releases were of the form 10.x, 10.x+1, 10.x+2, etc; as of Big Sur, they are now x, x+1, etc, so, for example, 10.15, 10.15.1, ..., 10.15.7, 11, 11.0.1, 11.1, ..., 12, 12.1, etc. Allow Python to build with single-digit deployment target values. Patch provided by FX Coudert.
(cherry picked from commit 5291639)

* bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string (GH-24341) (GH-24410)

* bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string
(cherry picked from commit 49926cf)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: FX Coudert <fxcoudert@gmail.com>
Co-authored-by: Max Bélanger <aeromax@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants