From 3c07d636294ba2247f6cc2b74b56428781e7613e Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Mon, 1 Jun 2026 05:23:14 +0200 Subject: [PATCH] fix: prevent deadlock when `linux32` fails (#2880) This was the case when running `nox -s tests -- --run-podman -v -s 'unit_test/oci_container_test.py::test_multiarch_image[podman-OCIPlatform.i386]'` on macOS arm64. --- cibuildwheel/oci_container.py | 5 ++++- unit_test/oci_container_test.py | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/cibuildwheel/oci_container.py b/cibuildwheel/oci_container.py index 79a9f65f..7fd0a3d1 100644 --- a/cibuildwheel/oci_container.py +++ b/cibuildwheel/oci_container.py @@ -298,7 +298,10 @@ class OCIContainer: ).strip() else: raise - simulate_32_bit = container_machine not in {"i686", "armv7l", "armv8l"} + if container_machine not in {"i686", "armv7l", "armv8l"}: + simulate_32_bit = True + # sanity check to ensure no deadlock waiting for container to start + call(*run_cmd, self.image, "linux32", "/bin/true", capture_stdout=True) shell_args = ["linux32", "/bin/bash"] if simulate_32_bit else ["/bin/bash"] diff --git a/unit_test/oci_container_test.py b/unit_test/oci_container_test.py index 3f430d83..7b324ac7 100644 --- a/unit_test/oci_container_test.py +++ b/unit_test/oci_container_test.py @@ -555,9 +555,12 @@ def test_local_image( platform, }: pytest.skip("Skipping test because docker on this platform does not support QEMU") - if container_engine.name == "podman" and platform == OCIPlatform.ARMV7: - # both GHA & local macOS arm64 podman desktop are failing - pytest.xfail("podman fails with armv7l images") + if container_engine.name == "podman": + if platform == OCIPlatform.ARMV7: + # both GHA & local macOS arm64 podman desktop are failing + pytest.xfail("podman fails with armv7l images") + elif platform == OCIPlatform.i386 and sys.platform.startswith("darwin"): + pytest.xfail("podman fails with i386 images on macOS") remote_image = "debian:trixie-slim" platform_name = platform.value.replace("/", "_") @@ -636,9 +639,13 @@ def test_multiarch_image(container_engine: OCIContainerEngineConfig, platform: O platform, }: pytest.skip("Skipping test because docker on this platform does not support QEMU") - if container_engine.name == "podman" and platform == OCIPlatform.ARMV7: - # both GHA & local macOS arm64 podman desktop are failing - pytest.xfail("podman fails with armv7l images") + if container_engine.name == "podman": + if platform == OCIPlatform.ARMV7: + # both GHA & local macOS arm64 podman desktop are failing + pytest.xfail("podman fails with armv7l images") + elif platform == OCIPlatform.i386 and sys.platform.startswith("darwin"): + pytest.xfail("podman fails with i386 images on macOS") + with OCIContainer( engine=container_engine, image="debian:trixie-slim", oci_platform=platform ) as container: