classification
Title: 2.7 builds can fail due to unconditional inclusion of include paths
Type: Stage: resolved
Components: Build, Cross-Build Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, doko, ned.deily, python-dev
Priority: release blocker Keywords: patch

Created on 2013-05-15 23:37 by ned.deily, last changed 2013-05-16 06:28 by ned.deily. This issue is now closed.

Files
File name Uploaded Description Edit
issue17990.patch ned.deily, 2013-05-15 23:39
Messages (5)
msg189327 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-05-15 23:37
For Issue17086, 8ee6d96a1019 backported some cross-build patches to the 2.7 branch.  The changes to setup.py detect_modules differ in the backport from those in default. In particular, in default, changes to the library and include directory lists used to build extensions modules are only made conditionally when cross-compiling.  But the 2.7 backport makes these changes unconditionally.

default:
    def detect_modules(self):
        # Ensure that /usr/local is always used, but the local build
        # directories (i.e. '.' and 'Include') must be first.  See issue
        # 10520.
        if not cross_compiling:
            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
        # only change this for cross builds for 3.3, issues on Mageia
        if cross_compiling:
            self.add_gcc_paths()
        self.add_multiarch_paths()

2.7:
    def detect_modules(self):
        # Ensure that /usr/local is always used
        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
        self.add_gcc_paths()
        self.add_multiarch_paths()

This breaks certain universal build combinations on OS X when using SDKs and it is possible it could break builds on other platforms as well.  Substituting the default branch code on 2.7 appears to solve the OS X build problem.  Whether it has any negative impact on other builds, in particular cross-compilations is untested.
msg189328 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-05-15 23:41
I don't see how this would break the cross builds, so please go ahead with this change.
msg189335 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-16 01:02
New changeset cd577c328886 by Ned Deily in branch '2.7':
Issue #17990: Only modify include and library search paths when cross-compiling.
http://hg.python.org/cpython/rev/cd577c328886
msg189336 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-05-16 01:05
Applied to 2.7 branch.  Leaving the issue open for release manager action for 2.7.5.
msg189341 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-05-16 05:04
The 32-bit OSX binary was patched manually.
History
Date User Action Args
2013-05-16 06:28:16ned.deilysetstage: patch review -> resolved
2013-05-16 05:05:27benjamin.petersonsetcomponents: + Cross-Build
2013-05-16 05:04:52benjamin.petersonsetstatus: open -> closed

messages: + msg189341
components: - Cross-Build
stage: resolved -> patch review
2013-05-16 01:05:35ned.deilysetresolution: fixed
messages: + msg189336
components: + Cross-Build
stage: patch review -> resolved
2013-05-16 01:02:48python-devsetnosy: + python-dev
messages: + msg189335
2013-05-15 23:41:44dokosetmessages: + msg189328
2013-05-15 23:39:59ned.deilysetfiles: + issue17990.patch
keywords: + patch
2013-05-15 23:37:43ned.deilycreate