feat: add armv7l in auto_archs when running on aarch64 (#2259)

* feat: add armv7l in auto_archs when running on aarch64

This depends on aarch32 EL0 support and thus is done conditionally.

* ci(travis): move to Ubuntu 22.04 / cp312
This commit is contained in:
Matthieu Darbois
2025-02-12 10:54:44 -05:00
committed by GitHub
parent c738289583
commit c93d51ec54
14 changed files with 96 additions and 50 deletions
+7
View File
@@ -108,6 +108,9 @@ def test(manylinux_image, tmp_path):
if manylinux_image in {"manylinux_2_28", "manylinux_2_34"} and platform.machine() == "x86_64":
# We don't have a manylinux_2_28+ image for i686
add_env["CIBW_ARCHS"] = "x86_64"
if platform.machine() == "aarch64":
# We just have a manylinux_2_31 image for armv7l
add_env["CIBW_ARCHS"] = "aarch64"
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)
@@ -150,4 +153,8 @@ def test(manylinux_image, tmp_path):
# We don't have a manylinux_2_28+ image for i686
expected_wheels = [w for w in expected_wheels if "i686" not in w]
if platform.machine() == "aarch64":
# We just have a manylinux_2_31 image for armv7l
expected_wheels = [w for w in expected_wheels if "armv7l" not in w]
assert set(actual_wheels) == set(expected_wheels)
+2 -1
View File
@@ -38,7 +38,7 @@ def test(musllinux_image, tmp_path):
# build the wheels
add_env = {
"CIBW_SKIP": "*-manylinux*",
"CIBW_SKIP": "*-manylinux* *_armv7l",
"CIBW_MUSLLINUX_X86_64_IMAGE": musllinux_image,
"CIBW_MUSLLINUX_I686_IMAGE": musllinux_image,
"CIBW_MUSLLINUX_AARCH64_IMAGE": musllinux_image,
@@ -54,4 +54,5 @@ def test(musllinux_image, tmp_path):
musllinux_versions=[musllinux_image],
single_python=True,
)
expected_wheels = [w for w in expected_wheels if "armv7l" not in w]
assert set(actual_wheels) == set(expected_wheels)
+1 -1
View File
@@ -68,7 +68,7 @@ class TestSpam(TestCase):
# See #336 for more info.
bits = struct.calcsize("P") * 8
if bits == 32:
self.assertIn(platform.machine(), ["i686", "wasm32"])
self.assertIn(platform.machine(), ["i686", "armv7l","armv8l", "wasm32"])
'''
+18 -3
View File
@@ -18,6 +18,7 @@ from typing import Any, Final
import pytest
from cibuildwheel.architecture import Architecture
from cibuildwheel.ci import CIProvider, detect_ci_provider
from cibuildwheel.util.file import CIBW_CACHE_PATH
EMULATED_ARCHS: Final[list[str]] = sorted(
@@ -25,6 +26,11 @@ EMULATED_ARCHS: Final[list[str]] = sorted(
)
SINGLE_PYTHON_VERSION: Final[tuple[int, int]] = (3, 12)
_AARCH64_CAN_RUN_ARMV7: Final[bool] = Architecture.aarch64.value not in EMULATED_ARCHS and {
None: Architecture.armv7l.value not in EMULATED_ARCHS,
CIProvider.travis_ci: False,
}.get(detect_ci_provider(), True)
platform = os.environ.get("CIBW_PLATFORM", "")
if platform:
pass
@@ -173,7 +179,7 @@ def expected_wheels(
machine_arch = "aarch64"
if manylinux_versions is None:
if machine_arch == "armv7l":
if machine_arch in ("armv7l", "aarch64"):
manylinux_versions = ["manylinux_2_17", "manylinux2014", "manylinux_2_31"]
elif machine_arch == "x86_64":
manylinux_versions = [
@@ -252,14 +258,23 @@ def expected_wheels(
if platform == "linux":
architectures = [arch_name_for_linux(machine_arch)]
if machine_arch == "x86_64" and not single_arch:
architectures.append("i686")
if not single_arch:
if machine_arch == "x86_64":
architectures.append("i686")
elif (
machine_arch == "aarch64"
and sys.platform.startswith("linux")
and not python_abi_tag.startswith("pp")
and _AARCH64_CAN_RUN_ARMV7
):
architectures.append("armv7l")
if len(manylinux_versions) > 0:
platform_tags = [
".".join(
f"{manylinux_version}_{architecture}"
for manylinux_version in manylinux_versions
if (manylinux_version, architecture) != ("manylinux_2_31", "aarch64")
)
for architecture in architectures
]