feat: remove 32-bit linux from auto arch, fix auto32 on linux aarch64 (#2458)
* feat: remove 32-bit linux from auto arch, fix auto32 on linux aarch64 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Apply suggestions from code review Co-authored-by: Joe Rickerby <joerick@mac.com> * Update cibuildwheel/architecture.py --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
co-authored by
Joe Rickerby
parent
3fa7bd1e72
commit
e188d9e260
@@ -34,8 +34,8 @@ def test_arch_auto(platform_machine):
|
||||
arch_set = Architecture.auto_archs("linux")
|
||||
expected = {
|
||||
"32": {Architecture.i686},
|
||||
"64": {Architecture.x86_64, Architecture.i686},
|
||||
"arm": {Architecture.aarch64, Architecture.armv7l},
|
||||
"64": {Architecture.x86_64},
|
||||
"arm": {Architecture.aarch64},
|
||||
}
|
||||
assert arch_set == expected[machine_name]
|
||||
|
||||
@@ -94,5 +94,24 @@ def test_arch_auto_no_aarch32(monkeypatch):
|
||||
arch_set = Architecture.parse_config("auto64", "linux")
|
||||
assert arch_set == {Architecture.aarch64}
|
||||
|
||||
monkeypatch.setattr(cibuildwheel.architecture, "_check_aarch32_el0", lambda: True)
|
||||
arch_set = Architecture.parse_config("auto32", "linux")
|
||||
assert len(arch_set) == 0
|
||||
assert arch_set == {Architecture.armv7l}
|
||||
|
||||
monkeypatch.setattr(cibuildwheel.architecture, "_check_aarch32_el0", lambda: False)
|
||||
arch_set = Architecture.parse_config("auto32", "linux")
|
||||
assert arch_set == set()
|
||||
|
||||
|
||||
def test_arch_native_on_ios(monkeypatch):
|
||||
monkeypatch.setattr(sys, "platform", "darwin")
|
||||
monkeypatch.setattr(platform_module, "machine", lambda: "arm64")
|
||||
arch_set = Architecture.parse_config("native", platform="ios")
|
||||
assert arch_set == {Architecture.arm64_iphonesimulator}
|
||||
|
||||
|
||||
def test_arch_auto_on_ios(monkeypatch):
|
||||
monkeypatch.setattr(sys, "platform", "darwin")
|
||||
monkeypatch.setattr(platform_module, "machine", lambda: "arm64")
|
||||
arch_set = Architecture.parse_config("auto", platform="ios")
|
||||
assert arch_set == {Architecture.arm64_iphonesimulator, Architecture.arm64_iphoneos}
|
||||
|
||||
@@ -79,7 +79,7 @@ def test_archs_default(platform, intercepted_build_args):
|
||||
options = intercepted_build_args.args[0]
|
||||
|
||||
if platform == "linux":
|
||||
assert options.globals.architectures == {Architecture.x86_64, Architecture.i686}
|
||||
assert options.globals.architectures == {Architecture.x86_64}
|
||||
elif platform == "windows":
|
||||
assert options.globals.architectures == {Architecture.AMD64, Architecture.x86}
|
||||
else:
|
||||
|
||||
@@ -51,6 +51,7 @@ def mock_build_container(monkeypatch):
|
||||
@pytest.mark.usefixtures("mock_build_container", "fake_package_dir")
|
||||
def test_build_default_launches(monkeypatch):
|
||||
monkeypatch.setattr(sys, "argv", [*sys.argv, "--platform=linux"])
|
||||
monkeypatch.setenv("CIBW_ARCHS", "auto64 auto32")
|
||||
monkeypatch.delenv("CIBW_ENABLE", raising=False)
|
||||
|
||||
main()
|
||||
@@ -105,6 +106,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
|
||||
manylinux-x86_64-image = "manylinux_2_28"
|
||||
musllinux-x86_64-image = "musllinux_1_2"
|
||||
enable = ["pypy", "pypy-eol", "graalpy", "cpython-freethreading"]
|
||||
archs = ["auto64", "auto32"]
|
||||
|
||||
# Before Python 3.10, use manylinux2014
|
||||
[[tool.cibuildwheel.overrides]]
|
||||
|
||||
@@ -25,6 +25,7 @@ PYPROJECT_1 = """
|
||||
[tool.cibuildwheel]
|
||||
build = ["cp38-*", "cp313-*"]
|
||||
skip = ["*musllinux*"]
|
||||
archs = ["auto64", "auto32"]
|
||||
environment = {FOO="BAR"}
|
||||
|
||||
test-command = "pyproject"
|
||||
|
||||
Reference in New Issue
Block a user