From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 3 May 2021 03:38:49 +0000 (-0700) Subject: bpo-41129: Fix check for macOS SDK paths when building Python (GH-25785) (GH-25830) X-Git-Tag: v3.9.5~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98035ec93ff0d9875f19027015689734d70c14e5;p=thirdparty%2FPython%2Fcpython.git 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 (cherry picked from commit d52bbde9421987d216c600557ef5bc931d03efcc) Co-authored-by: Ned Batchelder --- 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 index 000000000000..7dd67a527eb0 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2021-05-02-21-03-27.bpo-42119.Y7BSX_.rst @@ -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. diff --git a/setup.py b/setup.py index d8941790b35d..04eb6b291c77 100644 --- a/setup.py +++ b/setup.py @@ -210,11 +210,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):