Skip to content

Commit 98035ec

Browse files
bpo-41129: Fix check for macOS SDK paths when building Python (GH-25785) (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>
1 parent ad73d16 commit 98035ec

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Fix check for macOS SDK paths when building Python. Narrow search to match
2+
contents of SDKs, namely only files in ``/System/Library``,
3+
``/System/IOSSupport``, and ``/usr`` other than ``/usr/local``. Previously,
4+
anything under ``/System`` was assumed to be in an SDK which causes problems
5+
with the new file system layout in 10.15+ where user file systems may appear
6+
to be mounted under ``/System``. Paths in ``/Library`` were also
7+
incorrectly treated as SDK locations.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ def macosx_sdk_specified():
210210

211211
def is_macosx_sdk_path(path):
212212
"""
213-
Returns True if 'path' can be located in an OSX SDK
213+
Returns True if 'path' can be located in a macOS SDK
214214
"""
215215
return ( (path.startswith('/usr/') and not path.startswith('/usr/local'))
216-
or path.startswith('/System/')
217-
or path.startswith('/Library/') )
216+
or path.startswith('/System/Library')
217+
or path.startswith('/System/iOSSupport') )
218218

219219

220220
def grep_headers_for(function, headers):

0 commit comments

Comments
 (0)