This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tdsmith
Recipients dstufft, eric.araujo, ned.deily, ronaldoussoren, tdsmith
Date 2015-09-16.01:02:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442365383.18.0.302201830729.issue25136@psf.upfronthosting.co.za>
In-reply-to
Content
In Xcode 7, Apple is replacing many of the .dylibs in SDKROOT with textual stubs. [1] These files exist on disk with filenames like:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libz.tbd

They are short YAML documents that look like this: [2]

The same linker invocation that has always worked will continue to work with Xcode 7 (i.e. you still pass `-lz` to the linker), but this disrupts the checks that cpython's setup.py uses to determine if it can build extension modules. The dylibs physically exist on disk in /usr/lib, but since we've set -isysroot to the appropriate SDKROOT in CPPFLAGS, distutils searches for the dylibs in the sysroot path, and does not find them (since they have been replaced with .tbd stubs). Since distutils cannot find the libraries, setup.py declines to attempt to build any of the extension modules that depend on libraries in the OS X SDK, even though it would have succeeded if it had tried. Several Homebrew users have reported this while trialling Xcode 7 [3].

distutils should treat the .tbd files as a "real" library so that compiler.find_library_file succeeds and setup.py will proceed to attempt to build the extension modules.

The attached diff applies against the 3.5.0 release and allows extension modules to be built against Xcode 7 without installing the Command-Line Tools package.

If anyone is experiencing this issue, a workaround is to install the Xcode Command Line Tools package with `xcode-select --install` (which, among other things, installs headers to /usr/include), ensure the CLT is active with `xcode-select -s /Library/Developer/CommandLineTools`, and do not include `-isysroot` in CPPFLAGS when building python.

[1]: https://forums.developer.apple.com/thread/4572
[2]: https://gist.github.com/474233e561e28e1a8866
[3]: https://github.com/Homebrew/homebrew/issues/41085
History
Date User Action Args
2015-09-16 01:03:03tdsmithsetrecipients: + tdsmith, ronaldoussoren, ned.deily, eric.araujo, dstufft
2015-09-16 01:03:03tdsmithsetmessageid: <1442365383.18.0.302201830729.issue25136@psf.upfronthosting.co.za>
2015-09-16 01:03:02tdsmithlinkissue25136 messages
2015-09-16 01:03:01tdsmithcreate