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

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

Open
jeremyd2019 opened this issue Jul 10, 2024 · 4 comments
Open

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

jeremyd2019 opened this issue Jul 10, 2024 · 4 comments

Comments

@jeremyd2019
Copy link

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

@MehdiChinoune
Copy link

@jeremyd2019
Copy link
Author

ok, then this issue can just be to decide if we want to take the opportunity to switch the platform to contain arm or rely on continuing to patch cmake.

@lazka
Copy link
Member

lazka commented Jul 11, 2024

If aarch64 would be removed we'd have to update the detection in meson: https://github.com/mesonbuild/meson/blob/1a458aacb407e3893b7e832a7a3f75e581c5e3f4/mesonbuild/dependencies/python.py#L196-L204

@jeremyd2019
Copy link
Author

if one or the other would have to be patched, it may be best not to change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants