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.

classification
Title: find_file might return a different directory than the tested file
Type: behavior Stage: resolved
Components: Build Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Mathieu.Virbel, ned.deily
Priority: normal Keywords: patch

Created on 2013-10-25 15:49 by Mathieu.Virbel, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix-setup-find-file-path.patch Mathieu.Virbel, 2013-10-25 15:49 review
Messages (2)
msg201245 - (view) Author: Mathieu Virbel (Mathieu.Virbel) Date: 2013-10-25 15:49
With Maverick OSX (latest version), there is no /usr/include/zlib.h anymore. If you try to compile Python with -sysroot, it trigger a error message:

error: /usr/include/zlib.h: No such file or directory

The issue is in setup.py, where find_file is checking the existence of a filename, but if the filename has been found in a sysroot, it will return the path _without_ the sysroot.

In this case (zlib), find_file correctly find the zlib.h in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/zlib.h, but return "/usr/include",  and then the setup.py open '/usr/include/zlib.h', which fail.
msg201263 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-25 17:42
Thanks for the report.  The issue of setup.py not looking in an OS X SDK for zlib.h was recently fixed in currently active branches: f3a2dab1623b (default), 2d8d5fea6194 (3.3), c207ac413457 (2.7).

By the way, there has been a lot of confusion about the installation of header files in OS X 10.9 Mavericks, brought on by Apple itself.  In recent previous releases, most header files were only installed in the normal locations (/usr/include, /System/Library/Frameworks) as part of the Command Line Tools component (either through Xcode or the downloadable standalone package).  Early on in the life cycle of Mavericks development, there apparently was an attempt to no longer install the header files by the CLT packages, forcing everyone to reference them via an SDK.  For whatever reason, that attempt was dropped before Mavericks was released.  With the 10.9 CLT properly installed, you should see /usr/include correctly populated, including zlib.h.  In 10.9, the new way to force CLT to be installed is:

   xcode-select --install
History
Date User Action Args
2022-04-11 14:57:52adminsetgithub: 63588
2013-10-25 17:42:30ned.deilysetstatus: open -> closed

versions: - Python 3.1, Python 3.2, Python 3.5
nosy: + ned.deily

messages: + msg201263
resolution: out of date
stage: resolved
2013-10-25 15:49:46Mathieu.Virbelcreate