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

do not define sys.implementation._multiarch on Android #73035

Closed
xdegaye mannequin opened this issue Dec 1, 2016 · 7 comments
Closed

do not define sys.implementation._multiarch on Android #73035

xdegaye mannequin opened this issue Dec 1, 2016 · 7 comments
Assignees
Labels
3.7 (EOL) end of life build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Dec 1, 2016

BPO 28849
Nosy @doko42, @vstinner, @ned-deily, @xdegaye, @zware, @moreati, @yan12125
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • android_multiarch.patch
  • android_multiarch_2.patch
  • 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 = 'https://github.com/xdegaye'
    closed_at = <Date 2016-12-11.19:30:08.896>
    created_at = <Date 2016-12-01.08:06:07.719>
    labels = ['type-bug', '3.7', 'build']
    title = 'do not define sys.implementation._multiarch on Android'
    updated_at = <Date 2017-03-31.16:36:36.675>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:36.675>
    actor = 'dstufft'
    assignee = 'xdegaye'
    closed = True
    closed_date = <Date 2016-12-11.19:30:08.896>
    closer = 'xdegaye'
    components = ['Cross-Build']
    creation = <Date 2016-12-01.08:06:07.719>
    creator = 'xdegaye'
    dependencies = []
    files = ['45717', '45739']
    hgrepos = []
    issue_num = 28849
    keywords = ['patch']
    message_count = 7.0
    messages = ['282140', '282149', '282156', '282286', '282287', '282859', '283214']
    nosy_count = 8.0
    nosy_names = ['doko', 'vstinner', 'ned.deily', 'xdegaye', 'python-dev', 'zach.ware', 'Alex.Willmer', 'yan12125']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28849'
    versions = ['Python 3.6', 'Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 1, 2016

    Android is not a multiarch system and the unix build system can cross compile non-multiarch systems as well as multiarch systems. This is a follow up of the decisions implemented in bpo-28046 and the patch fixes also an oversight made in this issue in Makefile.pre.in.

    Also tested with the patch in bpo-28833 that implements cross compilation of third-party extension modules.
    Please run autoconf after installing the patch.

    @xdegaye xdegaye mannequin added the 3.7 (EOL) end of life label Dec 1, 2016
    @xdegaye xdegaye mannequin self-assigned this Dec 1, 2016
    @xdegaye xdegaye mannequin added build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Dec 1, 2016
    @yan12125
    Copy link
    Mannequin

    yan12125 mannequin commented Dec 1, 2016

    Actually all UNIX-like platforms now have non-empty sys.implementation._multiarch now (msg273875). An idea is renaming it to something like target_architecture to make things clearer. It will be a triplet on all system, whether cross-built or not.

    @doko42
    Copy link
    Member

    doko42 commented Dec 1, 2016

    An idea is renaming it to something like target_architecture
    to make things clearer

    Yes, that was my intent, and I think it is the right solution. using $(MACHDEP)_$(MULTIARCH) in the sysconfigdata name and probably in other places was not a good idea (introduced by the platdir removal).

    There's no reason why this target_architecture could be used by any unix like platform.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 3, 2016

    The change made by the patch in Makefile.pre.in handles the removing of the dangling underscore in the patch of bpo-28833, it is not needed.
    android_multiarch_2.patch is simpler: the change in Makefile.pre.in has been removed and test_triplet_in_ext_suffix is now skipped when sys.implementation does not have the _multiarch attribute instead of only for android as previously.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 3, 2016

    The MULTIARCH triplet:

    • is used by the build system in the suffix of the name of the _sysconfigdata private module, it may have any value (including being empty) when the platform is non-multiarch - for example cross-compiling for an Android emulator with the 'foo-bar-foobar' MULTIARCH triplet works just fine (without the patch)
    • is not used by the interpreter
    • the Python user may not use it (sys.implementation_multiarch is private)
    • is not used in the standard library, except by the sysconfig modules to get the name of the _sysconfigdata module (and it may be empty)
    • is not needed any more to cross-compile non-multiarch platforms (even without the patch) since bpo-28046, where platform-specific directories have been removed

    On Android the MULTIARCH triplet adds the burden of having to maintain the list of Android processors and abis in configure.ac through a set of complex conditionals (see below [1]) whose correctness is uncertain and not verified. This is useless and removed since it is not needed anymore.

    [1] The Android set of conditionals in configure.ac:

    #if defined(__ANDROID__)
    # if defined(__x86_64__) && defined(__LP64__)
            x86_64-linux-android
    # elif defined(__i386__)
            i686-linux-android
    # elif defined(__aarch64__) && defined(__AARCH64EL__)
    #  if defined(__ILP32__)
            aarch64_ilp32-linux-android
    #  else
            aarch64-linux-android
    #  endif
    # elif defined(__ARM_EABI__) && defined(__ARMEL__)
            arm-linux-androideabi
    # elif defined(__mips_hard_float) && defined(_MIPSEL)
    #  if _MIPS_SIM == _ABIO32
            mipsel-linux-android
    #  elif _MIPS_SIM == _ABI64
            mips64el-linux-android
    #  else
    #   error unknown platform triplet
    #  endif
    # else
    #   error unknown platform triplet
    # endif

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 10, 2016

    New changeset b3ba41bf92c7 by Xavier de Gaye in branch '3.6':
    Issue bpo-28849: Do not define sys.implementation._multiarch on Android.
    https://hg.python.org/cpython/rev/b3ba41bf92c7

    New changeset 40e8b39199da by Xavier de Gaye in branch 'default':
    Issue bpo-28849: Merge 3.6.
    https://hg.python.org/cpython/rev/40e8b39199da

    @xdegaye xdegaye mannequin closed this as completed Dec 11, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 14, 2016

    New changeset ab3d870aa3bc by Xavier de Gaye in branch '3.6':
    Issue bpo-28849: Skip test_sysconfig.test_triplet_in_ext_suffix on non linux platforms.
    https://hg.python.org/cpython/rev/ab3d870aa3bc

    New changeset 0ff181ca7558 by Xavier de Gaye in branch 'default':
    Issue bpo-28849: Merge 3.6.
    https://hg.python.org/cpython/rev/0ff181ca7558

    @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 (EOL) end of life build The build process and cross-build type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant