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

building Android with android-ndk-r14 #73226

Closed
xdegaye mannequin opened this issue Dec 21, 2016 · 4 comments
Closed

building Android with android-ndk-r14 #73226

xdegaye mannequin opened this issue Dec 21, 2016 · 4 comments
Labels
3.7 build The build process and cross-build

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Dec 21, 2016

BPO 29040
Nosy @xdegaye, @moreati, @yan12125
PRs
  • bpo-29040: Support building Android with Unified Headers #4492
  • Files
  • api-level.h
  • 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-23.10:46:12.563>
    created_at = <Date 2016-12-21.20:24:25.858>
    labels = ['build', '3.7']
    title = 'building Android with android-ndk-r14'
    updated_at = <Date 2017-11-23.10:46:12.562>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2017-11-23.10:46:12.562>
    actor = 'xdegaye'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-23.10:46:12.563>
    closer = 'xdegaye'
    components = ['Cross-Build']
    creation = <Date 2016-12-21.20:24:25.858>
    creator = 'xdegaye'
    dependencies = []
    files = ['45987']
    hgrepos = []
    issue_num = 29040
    keywords = ['patch']
    message_count = 4.0
    messages = ['283778', '283815', '283822', '306799']
    nosy_count = 3.0
    nosy_names = ['xdegaye', 'Alex.Willmer', 'yan12125']
    pr_nums = ['4492']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue29040'
    versions = ['Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 21, 2016

    android-ndk-r14 introduces "Unified Headers" [1] and is planned to be released late january/early february 2017 [2].

    __ANDROID_API__ is not anymore defined in 'android/api-level.h' that is currently included by Include/pyport.h, and is passed instead with -D__ANDROID_API__=$API when compiling. And 'android/api-level.h' is now used to set the API level to 10000 as a Magic version number for a current development build when __ANDROID_API__ is not defined (see attached file).

    Adoption of android-ndk-r14 should be made with the following changes:

    • Remove the include of <android/api-level.h> in Include/pyport.h.
    • Update configure.ac to abort when __ANDROID__ is defined and __ANDROID_API__ is not defined.
    • Revert the changes made in issues bpo-28538 and bpo-28762, android-ndk-r14 fixes the problems raised in these two issues.

    [1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md
    [2] https://github.com/android-ndk/ndk/wiki

    @xdegaye xdegaye mannequin added 3.7 build The build process and cross-build labels Dec 21, 2016
    @yan12125
    Copy link
    Mannequin

    yan12125 mannequin commented Dec 22, 2016

    Thanks for compiling up necessary changes for NDK r14! Seems that indicates future Python versions will require at least NDK r14 to build?

    Another headache from unified headers is that it requires different --sysroot in compilation and linking. Currently setup.py/distutils does not cope with it well. See my dirty hack at [1] for an ad-hoc workaround.

    [1] https://github.com/yan12125/python3-android/blob/master/mk/python/distutils-android-sysroot.patch

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 22, 2016

    Seems that indicates future Python versions will require at least NDK r14 to build?

    Yes.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 23, 2017

    New changeset c06c22e by xdegaye in branch 'master':
    bpo-29040: Support building Android with Unified Headers (GH-4492)
    c06c22e

    @xdegaye xdegaye mannequin closed this as completed Nov 23, 2017
    @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
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants