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

[BUG] win-arm64 platform is not detected #2724

Closed
1 task done
zooba opened this issue Jul 9, 2021 · 0 comments · Fixed by #2725
Closed
1 task done

[BUG] win-arm64 platform is not detected #2724

zooba opened this issue Jul 9, 2021 · 0 comments · Fixed by #2725
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@zooba
Copy link
Contributor

zooba commented Jul 9, 2021

setuptools version

latest

Python version

any

OS

Windows

Additional environment information

Only relevant when %VSCMD_ARG_TGT_ARCH% is set to arm64 (for example, in a configured build environment).

Description

For other values (x86, x64, arm), the VSCMD_ARG_TGT_ARCH variable is used to select the platform specifier (see setuptools/_distutils/util.py line 100ish). There is no value for arm64, and so it builds for the current platform rather than cross-compiling.

Expected behavior

When the value is arm64, it should select platform win-arm64. This allows later steps to select the correct build tools and cross-compile.

Note that you also need to [obtain and] ensure that setuptools will find the ARM64 compatible .lib files for Python. Putting them into a venv's libs directory works fine (provided you make sure the build happens in that venv, which is not hard).

How to Reproduce

  1. Open regular command prompt
  2. set VSCMD_ARG_TGT_ARCH=arm64
  3. pip wheel --no-binary :all: --no-deps --no-cache --no-build-isolation markupsafe (or any other simple module with native code)

The generated wheel will be for the same platform as the Python it was run with, rather than respecting the target architecture.

If you set VSCMD_ARG_TGT_ARCH=arm without getting the right libs, the compilation fails and it generates a none-any wheel because markupsafe knows how to handle this. Other packages will just hard fail.

Output

Collecting markupsafe                                                                                                   
  Downloading MarkupSafe-2.0.1.tar.gz (18 kB)                                                                           
Building wheels for collected packages: markupsafe                                                                      
  Building wheel for markupsafe (setup.py) ... done                                                                     
  Created wheel for markupsafe: filename=MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl size=17214 sha256=cd682d318cfd3a5805c032fa6b1d9e40def490f62be7b4057fcd67cf4f6cc1dc                                                                            
  Stored in directory: C:\...\Temp\pip-ephem-wheel-cache-lgs8awq4\wheels\9f\6d\c8\1f59b07cf85ae842908006ec28f4477f7e4578df72c3eb0e46                                                                                     
Successfully built markupsafe                                                                                           

Note that the wheel platform is win32 or win_amd64, and not win_arm64.

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@zooba zooba added bug Needs Triage Issues that need to be evaluated for severity and status. labels Jul 9, 2021
zooba added a commit to zooba/setuptools that referenced this issue Jul 9, 2021
jaraco pushed a commit to zooba/setuptools that referenced this issue Jul 15, 2021
jaraco added a commit that referenced this issue Jul 15, 2021
Fixes #2724 Adds detection of Windows ARM64 build environments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant