[New-bugs-announce] [issue20212] distutils: fix build_ext check to find whether we're building Python or not

Thomas Petazzoni report at bugs.python.org
Fri Jan 10 00:03:07 CET 2014


New submission from Thomas Petazzoni:

The build_ext logic uses sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")) to determine whether we're building a third-party Python extension, or a built-in Python extension. However, this check is wrong in cross-compilation mode, because the host Python interpreter might very well be installed in its prefix, when it is used to cross-compile the target modules and extensions. The current check would mis-detect this as we're building third-party Python modules, while we are in fact building the internal Python modules of the target Python.

Therefore, use the existing sysconfig.python_build variable, which provides the information of whether we're building Python itself or not in a correct way.

----------
components: Cross-Build
files: 0002-distutils-fix-build_ext-check-to-find-whether-we-re-.patch
keywords: patch
messages: 207806
nosy: thomas-petazzoni
priority: normal
severity: normal
status: open
title: distutils: fix build_ext check to find whether we're building Python or not
type: compile error
versions: Python 3.4
Added file: http://bugs.python.org/file33394/0002-distutils-fix-build_ext-check-to-find-whether-we-re-.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20212>
_______________________________________


More information about the New-bugs-announce mailing list