mirror of https://github.com/python/cpython
bpo-41129: Fix check for macOS SDK paths when building Python (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>
This commit is contained in:
parent
b43cc31a27
commit
d52bbde942
|
@ -0,0 +1,7 @@
|
||||||
|
Fix check for macOS SDK paths when building Python. 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.
|
6
setup.py
6
setup.py
|
@ -227,11 +227,11 @@ def macosx_sdk_specified():
|
||||||
|
|
||||||
def is_macosx_sdk_path(path):
|
def is_macosx_sdk_path(path):
|
||||||
"""
|
"""
|
||||||
Returns True if 'path' can be located in an OSX SDK
|
Returns True if 'path' can be located in a macOS SDK
|
||||||
"""
|
"""
|
||||||
return ( (path.startswith('/usr/') and not path.startswith('/usr/local'))
|
return ( (path.startswith('/usr/') and not path.startswith('/usr/local'))
|
||||||
or path.startswith('/System/')
|
or path.startswith('/System/Library')
|
||||||
or path.startswith('/Library/') )
|
or path.startswith('/System/iOSSupport') )
|
||||||
|
|
||||||
|
|
||||||
def grep_headers_for(function, headers):
|
def grep_headers_for(function, headers):
|
||||||
|
|
Loading…
Reference in New Issue