classification
Title: Python 2.7 setup.py incorrectly double-joins SDKROOT
Type: compile error Stage: resolved
Components: Build Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Support builds on macOS without installed system header files
View: 36231
Assigned To: ned.deily Nosy List: mistydemeo, ned.deily
Priority: normal Keywords: patch

Created on 2019-06-14 18:29 by mistydemeo, last changed 2019-10-19 09:57 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14095 closed mistydemeo, 2019-06-14 18:30
Messages (2)
msg345626 - (view) Author: Misty De Méo (mistydemeo) * Date: 2019-06-14 18:29
Python 2.7's setup.py has incorrect behaviour when adding the SDKROOT to the beginning of the include path while searching.

When searching paths, find_file first checks is_macosx_sdk_path  to see if it needs to add the sdk_root: https://github.com/python/cpython/blob/2.7/setup.py#L87-L88

This is mostly correct, except one of the path prefixes it checks is /Library: https://github.com/python/cpython/blob/2.7/setup.py#L64

The Xcode CLT path is located in /Library, so this check passes. That means the /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk portion of the path gets repeated, leading to an invalid path.

I recognize Python 2.7 isn't in active development, but I have a minimal patch to fix this that I will be submitting.
msg354935 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2019-10-19 09:57
Thanks for the report and the PR (and sorry for the delay in responding).  There were several problems with building on macOS without installed header files, which is no longer supported in the most recent Xcode / Command Line Tools releases, as well as a problem specific to 2.7 which caused such builds to not find the system zlib.  All of these issues were addressed in the changes for bpo-36231 (c421c66a58a6caae30f0679d7e61411418e67cec) and bpo-19960 (da7f6dbbf52fe7074360a9eae918806da60139c5) which were merged to 2.7 a few months ago and are being released with 2.7.17. With these changes, the double-join problem your PR was correcting no longer occur.
History
Date User Action Args
2019-10-19 09:57:29ned.deilysetstatus: open -> closed
superseder: Support builds on macOS without installed system header files
messages: + msg354935

resolution: duplicate
stage: patch review -> resolved
2019-06-14 20:48:26ned.deilysetassignee: ned.deily

nosy: + ned.deily
2019-06-14 18:30:43mistydemeosetkeywords: + patch
stage: patch review
pull_requests: + pull_request13949
2019-06-14 18:29:57mistydemeocreate