Skip to content

sysconfig.get_platform on arm64 does not contain 'ARM' #174

@jeremyd2019

Description

@jeremyd2019

From msys2/MINGW-packages#20569
cmake attempts to verify that python is targeting arm with the following:

      execute_process (COMMAND ${launcher} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
        "import sys, sysconfig; sys.stdout.write(sysconfig.get_platform())"
        RESULT_VARIABLE result
        OUTPUT_VARIABLE platform
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE)
      string(TOUPPER "${platform}" platform)
      if (result OR ((target_arm AND NOT platform MATCHES "ARM") OR
                     (NOT target_arm AND platform MATCHES "ARM")))
        # interpreter not usable or has wrong architecture

In the case of this fork, sysconfig.get_platform() returns mingw_aarch64, not mingw_arm64 or something similar. I'm not sure whether this should be patched here (probably as part of the 3.12 update), or in cmake (to check for MATCHES "ARM|AARCH" instead) but I wanted to open an issue for it here so it wouldn't be forgotten for 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions