New submission from Tim Smith:

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

----------
components: Build, Distutils, Macintosh
files: xcode-stubs.diff
keywords: patch
messages: 250813
nosy: dstufft, eric.araujo, ned.deily, ronaldoussoren, tdsmith
priority: normal
severity: normal
status: open
title: Python doesn't find Xcode 7 stub libraries
type: compile error
Added file: http://bugs.python.org/file40478/xcode-stubs.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25136>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to