Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect_modules() in setup.py must also search the sysroot paths #76240

Closed
xdegaye mannequin opened this issue Nov 17, 2017 · 4 comments
Closed

detect_modules() in setup.py must also search the sysroot paths #76240

xdegaye mannequin opened this issue Nov 17, 2017 · 4 comments
Labels
3.7 build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Nov 17, 2017

BPO 32059
Nosy @Yhg1s, @brettcannon, @xdegaye, @vadmium, @moreati
PRs
  • bpo-32059: detect_modules() in setup.py now also searches the sysroot… #4452
  • [3.6] bpo-32059: setup.py now also searches the sysroot paths (GH-4452) #4562
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-11-25.16:26:38.332>
    created_at = <Date 2017-11-17.11:19:21.793>
    labels = ['type-bug', '3.7', 'build']
    title = 'detect_modules() in setup.py must also search the sysroot paths'
    updated_at = <Date 2017-11-25.16:52:23.032>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2017-11-25.16:52:23.032>
    actor = 'xdegaye'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-25.16:26:38.332>
    closer = 'xdegaye'
    components = ['Cross-Build']
    creation = <Date 2017-11-17.11:19:21.793>
    creator = 'xdegaye'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32059
    keywords = ['patch']
    message_count = 4.0
    messages = ['306432', '306448', '306965', '306967']
    nosy_count = 5.0
    nosy_names = ['twouters', 'brett.cannon', 'xdegaye', 'martin.panter', 'Alex.Willmer']
    pr_nums = ['4452', '4562']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32059'
    versions = ['Python 3.6', 'Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 17, 2017

    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

    @xdegaye xdegaye mannequin added 3.7 build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Nov 17, 2017
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 17, 2017

    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/

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 25, 2017

    New changeset 77f5139 by xdegaye in branch 'master':
    bpo-32059: setup.py now also searches the sysroot paths (GH-4452)
    77f5139

    @xdegaye xdegaye mannequin closed this as completed Nov 25, 2017
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 25, 2017

    New changeset 04af8ac by xdegaye (Miss Islington (bot)) in branch '3.6':
    bpo-32059: setup.py now also searches the sysroot paths (GH-4452) (bpo-4562)
    04af8ac

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 build The build process and cross-build type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants