From cf7586ce7e05f3279be7d39b203e4faa4564d035 Mon Sep 17 00:00:00 2001 From: mayeut Date: Thu, 7 Sep 2023 19:12:48 +0200 Subject: [PATCH] check i686 directly --- cibuildwheel/oci_container.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cibuildwheel/oci_container.py b/cibuildwheel/oci_container.py index f1ab3452..bfb3ff19 100644 --- a/cibuildwheel/oci_container.py +++ b/cibuildwheel/oci_container.py @@ -111,13 +111,14 @@ class OCIContainer: network_args = ["--network=host"] simulate_32_bit = self.enforce_32_bit - container_machine = call( - self.engine.name, "run", "--rm", self.image, "uname", "-m", capture_stdout=True - ).strip() - if container_machine not in {"x86_64", "aarch64"}: - # either the architecture running the image is already the right one - # or the image entrypoint took care of this - simulate_32_bit = False + if self.enforce_32_bit: + # If the architecture running the image is already the right one + # or the image entrypoint takes care of enforcing this, then we don't need to + # simulate this + container_machine = call( + self.engine.name, "run", "--rm", self.image, "uname", "-m", capture_stdout=True + ).strip() + simulate_32_bit = container_machine != "i686" shell_args = ["linux32", "/bin/bash"] if simulate_32_bit else ["/bin/bash"]