-
Notifications
You must be signed in to change notification settings - Fork 264
Enable building for Windows ARM64 on a non-ARM64 device #1144
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
ea559af
Enable building for Windows ARM64 on a non-ARM64 device
zooba 310cfda
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6bcca2d
Satisfy MyPy
zooba e18c21a
Merge branch 'arm64' of https://github.com/zooba/cibuildwheel into arm64
zooba dc14bd1
Add cross-compiler test
zooba 0704190
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 222d56b
Allow more arch values in get_nuget_args
zooba 36442d5
Merge branch 'arm64' of https://github.com/zooba/cibuildwheel into arm64
zooba b5b8e12
Add a pyproject.toml to the windows arm64 cross compile test
joerick 71df33d
Merge remote-tracking branch 'upstream/main' into arm64
zooba 59febc1
Add setup_rust_cross_compile
zooba a2386a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 94a053e
Apply some PR feedback
zooba 9405d82
Merge branch 'arm64' of https://github.com/zooba/cibuildwheel into arm64
zooba 4c73245
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c3dcb07
Revert type names
zooba 46cc262
Merge branch 'main' into arm64
zooba 15288be
Merge branch 'main' into arm64
zooba 5f391d6
Merge branch 'main' into arm64
zooba 634a3f7
Expect correct wheel tag
zooba f5c82fc
Merge branch 'main' into arm64
zooba 09e08f6
Write to ~/pydistutils.cfg instead, preserving any existing file
zooba b8ac98e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] dcc5c00
Ensure cfg is removed, and add a message
zooba 9e07dae
Skip ARM64 test run when not running on ARM64
zooba 9a4e8f6
Actually call unlink, and add more typing
zooba f277099
Skip ARM64 tests automatically with warning, and improved cleanup
zooba 7b0ac9e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b94aceb
Merge remote-tracking branch 'upstream/main' into arm64
zooba 4242fe9
Merge branch 'arm64' of https://github.com/zooba/cibuildwheel into arm64
zooba 9dc5512
Fix typing
zooba 44ebbc4
Remove unused import
zooba 1d7054c
Switch to potential new distutils environment variable
zooba ff2d9de
Flow through tmp directory
zooba 5030c2c
Remove unused names
zooba 9815b9c
Merge remote-tracking branch 'upstream/main' into arm64
zooba 10a4e30
Merge remote-tracking branch 'upstream/main' into arm64
zooba 4531370
Rename variable to match one added to setuptools
zooba 063b8e4
Merge branch 'main' into arm64
zooba b8e4789
Add skip for missing ARM64 tools
zooba 7fd4a22
Merge branch 'arm64' of https://github.com/zooba/cibuildwheel into arm64
zooba 7a9bd57
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ea1d15b
For mypy
zooba 18ced3c
Update docs and fix default architectures
zooba ae58080
Merge remote-tracking branch 'upstream/main' into arm64
zooba aa79b6e
Revert default archs on ARM64 change
zooba 9128465
Merge remote-tracking branch 'upstream/main' into arm64
zooba afdae3f
AppVeyor supports ARM64 builds
zooba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
from __future__ import annotations | ||
|
||
import os | ||
import subprocess | ||
import textwrap | ||
|
||
import pytest | ||
|
||
from . import test_projects, utils | ||
|
||
basic_project = test_projects.new_c_project() | ||
zooba marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
def skip_if_no_msvc(arm64=False): | ||
programfiles = os.getenv("ProgramFiles(x86)", "") or os.getenv("ProgramFiles", "") | ||
if not programfiles: | ||
pytest.skip("Requires %ProgramFiles(x86)% variable to be set") | ||
|
||
vswhere = os.path.join(programfiles, "Microsoft Visual Studio", "Installer", "vswhere.exe") | ||
if not os.path.isfile(vswhere): | ||
pytest.skip("Requires Visual Studio installation") | ||
|
||
require = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" | ||
if arm64: | ||
require = "Microsoft.VisualStudio.Component.VC.Tools.ARM64" | ||
|
||
if not subprocess.check_output( | ||
[ | ||
vswhere, | ||
"-latest", | ||
"-prerelease", | ||
"-property", | ||
"installationPath", | ||
"-requires", | ||
require, | ||
] | ||
): | ||
pytest.skip("Requires ARM64 compiler to be installed") | ||
|
||
|
||
@pytest.mark.parametrize("use_pyproject_toml", [True, False]) | ||
def test_wheel_tag_is_correct_when_using_windows_cross_compile(tmp_path, use_pyproject_toml): | ||
if utils.platform != "windows": | ||
pytest.skip("This test is only relevant to Windows") | ||
|
||
skip_if_no_msvc(arm64=True) | ||
|
||
if use_pyproject_toml: | ||
basic_project.files["pyproject.toml"] = textwrap.dedent( | ||
""" | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
""" | ||
) | ||
|
||
project_dir = tmp_path / "project" | ||
basic_project.generate(project_dir) | ||
|
||
# build the wheels | ||
actual_wheels = utils.cibuildwheel_run( | ||
project_dir, | ||
add_env={ | ||
"CIBW_BUILD": "cp310-*", | ||
}, | ||
add_args=["--archs", "ARM64"], | ||
) | ||
|
||
# check that the expected wheels are produced | ||
expected_wheels = [ | ||
"spam-0.1.0-cp310-cp310-win_arm64.whl", | ||
] | ||
|
||
print("actual_wheels", actual_wheels) | ||
print("expected_wheels", expected_wheels) | ||
|
||
assert set(actual_wheels) == set(expected_wheels) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.