-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
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
- Open regular command prompt
set VSCMD_ARG_TGT_ARCH=arm64
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