-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-41129: Fix check for macOS SDK paths when building Python #25785
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. AFAIK, this is a pretty rare problem probably depending on some unusual file system configurations; I have never seen it on Catalina or Big Sur. But it should be fixed.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
setup.py
Outdated
@@ -230,7 +230,7 @@ def is_macosx_sdk_path(path): | |||
Returns True if 'path' can be located in an OSX SDK | |||
""" | |||
return ( (path.startswith('/usr/') and not path.startswith('/usr/local')) | |||
or path.startswith('/System/') | |||
or (path.startswith('/System/') and not path.startswith('/System/Volumes/Data')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I suggested in an earlier comment on the bug tracker for this, all we are interested in here are files in the SDK. For macOS 10.15 and 11 under /System, there are /System/Library and, for completeness, /System/iOSSupport. The test should be explicitly for those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Catalina puts files in /System/Volumes/Data, so the CPython sources can be there. setup.py shouldn't assume /System means SDK files. The fix is Ned Deily's suggestion from the bpo.
I have made the requested changes; please review again. |
Thanks for making the requested changes! @ned-deily: please review the changes made to this pull request. |
Thanks @nedbat for the PR, and @ned-deily for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
…GH-25785) Narrow search to match contents of SDKs, namely only files in ``/System/Library``, ``/System/IOSSupport``, and ``/usr`` other than ``/usr/local``. Previously, anything under ``/System`` was assumed to be in an SDK which causes problems with the new file system layout in 10.15+ where user file systems may appear to be mounted under ``/System``. Paths in ``/Library`` were also incorrectly treated as SDK locations. Co-authored-by: Ned Deily <nad@python.org> (cherry picked from commit d52bbde) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
GH-25830 is a backport of this pull request to the 3.9 branch. |
…) (GH-25830) Narrow search to match contents of SDKs, namely only files in ``/System/Library``, ``/System/IOSSupport``, and ``/usr`` other than ``/usr/local``. Previously, anything under ``/System`` was assumed to be in an SDK which causes problems with the new file system layout in 10.15+ where user file systems may appear to be mounted under ``/System``. Paths in ``/Library`` were also incorrectly treated as SDK locations. Co-authored-by: Ned Deily <nad@python.org> (cherry picked from commit d52bbde) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
|
Catalina puts files in /System/Volumes/Data, so the CPython sources can
be there. setup.py shouldn't assume /System means SDK files.
https://bugs.python.org/issue41129