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: detect_modules() in setup.py must also search the sysroot paths
Type: behavior Stage: resolved
Components: Cross-Build Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, brett.cannon, martin.panter, twouters, xdegaye
Priority: normal Keywords: patch

Created on 2017-11-17 11:19 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4452 merged xdegaye, 2017-11-18 16:39
PR 4562 merged python-dev, 2017-11-25 16:26
Messages (4)
msg306432 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-17 11:19
When cross-compiling, the gcc and clang `--sysroot=` compiler option may be used to change the logical path of the system headers and libraries to a path located within the install path of the cross-compiler tool chain.

Android is a special case:
--------------------------
With Unified Headers [1], the most recent versions of the Android NDK add an additional constraint: the root paths of usr/include and usr/lib are distinct. For example when cross-compiling for API 24 and the x86_64 architecture the full paths are:
* headers:   ANDROID_NDK_ROOT/sysroot/usr/include
* libraries: ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64/usr/lib64

To use sysroot in this example one needs to set sysroot to ANDROID_NDK_ROOT/sysroot in CFLAGS or CPPFLAGS and to set sysroot to ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64 in LDFLAGS, while on a standard platform where the root path of usr/include and usr/lib is common, one would only need to set sysroot to this root path in CFLAGS.

[1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md
msg306448 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-17 16:07
> while on a standard platform where the root path of usr/include and usr/lib is common, one would only need to set sysroot to this root path in CFLAGS

s/CFLAGS/CC/
msg306965 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-25 16:25
New changeset 77f5139954a878b856b0ac4c76486b27b6f4ec26 by xdegaye in branch 'master':
bpo-32059: setup.py now also searches the sysroot paths (GH-4452)
https://github.com/python/cpython/commit/77f5139954a878b856b0ac4c76486b27b6f4ec26
msg306967 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-25 16:52
New changeset 04af8ace86d4396bc64fc401f36049ab745fd8c1 by xdegaye (Miss Islington (bot)) in branch '3.6':
bpo-32059: setup.py now also searches the sysroot paths (GH-4452) (#4562)
https://github.com/python/cpython/commit/04af8ace86d4396bc64fc401f36049ab745fd8c1
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76240
2017-12-09 15:42:06xdegayelinkissue26865 dependencies
2017-11-25 16:52:23xdegayesetmessages: + msg306967
2017-11-25 16:26:49python-devsetpull_requests: + pull_request4491
2017-11-25 16:26:38xdegayesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-11-25 16:25:33xdegayesetmessages: + msg306965
2017-11-18 17:01:56xdegayesetnosy: + twouters, brett.cannon, martin.panter
2017-11-18 16:39:53xdegayesetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request4389
2017-11-17 16:07:33xdegayesetmessages: + msg306448
2017-11-17 11:19:21xdegayecreate