]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41129: Fix check for macOS SDK paths when building Python (GH-25785)
authorNed Batchelder <ned@nedbatchelder.com>
Mon, 3 May 2021 02:58:57 +0000 (19:58 -0700)
committerGitHub <noreply@github.com>
Mon, 3 May 2021 02:58:57 +0000 (22:58 -0400)
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>
Misc/NEWS.d/next/macOS/2021-05-02-21-03-27.bpo-42119.Y7BSX_.rst [new file with mode: 0644]
setup.py

diff --git a/Misc/NEWS.d/next/macOS/2021-05-02-21-03-27.bpo-42119.Y7BSX_.rst b/Misc/NEWS.d/next/macOS/2021-05-02-21-03-27.bpo-42119.Y7BSX_.rst
new file mode 100644 (file)
index 0000000..7dd67a5
--- /dev/null
@@ -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.
index ca0ed8363ef358ccbb40d7be3925aa6a68f47e90..3857e6887a929f5c3bfe31b4f02c101773a32065 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -227,11 +227,11 @@ def macosx_sdk_specified():
 
 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'))
-                or path.startswith('/System/')
-                or path.startswith('/Library/') )
+                or path.startswith('/System/Library')
+                or path.startswith('/System/iOSSupport') )
 
 
 def grep_headers_for(function, headers):