From d52bbde9421987d216c600557ef5bc931d03efcc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 2 May 2021 19:58:57 -0700 Subject: [PATCH] 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 --- .../next/macOS/2021-05-02-21-03-27.bpo-42119.Y7BSX_.rst | 7 +++++++ setup.py | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/macOS/2021-05-02-21-03-27.bpo-42119.Y7BSX_.rst 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 00000000000..7dd67a527eb --- /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 ca0ed8363ef..3857e6887a9 100644 --- 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):