Author dimpase
Recipients dimpase, ned.deily, ronaldoussoren
Date 2019-03-08.10:03:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Neither Xcode nor its command-line tools on macOS 10.14 Mojave come with header files installed in /usr/ and other "normal" directories.

This is not documented in

While an extra step to handle this, i.e. to install the headers, is available (see a discussion on, Apple stated that this workaround will disappear.

It is thus highly desirable to provide a way to deal with headers located not at /usr/include, but at `xcrun --show-sdk-path`/usr/include.
A small change in along the lines of the following:

--- a/
+++ b/
@@ -134,7 +134,8 @@ def macosx_sdk_root():
     cflags = sysconfig.get_config_var('CFLAGS')
     m ='-isysroot\s+(\S+)', cflags)
     if m is None:
-        sysroot = '/'
+        import subprocess
+        sysroot = subprocess.check_output(["xcrun", "--show-sdk-path"]).decode("utf-8").strip('\n')
         sysroot =
     return sysroot
@@ -146,6 +147,7 @@ def is_macosx_sdk_path(path):
     return ( (path.startswith('/usr/') and not path.startswith('/usr/local'))
                 or path.startswith('/System/')
+                or path.startswith('/Applications/')
                 or path.startswith('/Library/') )

with the necessary changes to enable various modules (see attachment for a complete POC diff against the current master), the result builds and passes all the (enabled) tests on an OSX 10.13 system with empty /usr/include and /usr/local/include containing only LZMA headers.

Needless to say, a proper patch would not modify Modules/Setup, it'd adjust etc.
Date User Action Args
2019-03-08 10:03:47dimpasesetrecipients: + dimpase, ronaldoussoren, ned.deily
2019-03-08 10:03:47dimpasesetmessageid: <>
2019-03-08 10:03:47dimpaselinkissue36231 messages
2019-03-08 10:03:47dimpasecreate