Skip to content

Commit

Permalink
fix: do not use linux32 when unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Sep 6, 2023
1 parent e5d0cc0 commit 75c3845
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cibuildwheel/oci_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from typing import IO, Dict, Literal

from .typing import PathOrStr, PopenBytes
from .util import CIProvider, detect_ci_provider, parse_key_value_string
from .util import CIProvider, call, detect_ci_provider, parse_key_value_string

ContainerEngineName = Literal["docker", "podman"]

Expand Down Expand Up @@ -108,7 +108,16 @@ def __enter__(self) -> OCIContainer:
if detect_ci_provider() == CIProvider.travis_ci and platform.machine() == "ppc64le":
network_args = ["--network=host"]

shell_args = ["linux32", "/bin/bash"] if self.simulate_32_bit else ["/bin/bash"]
simulate_32_bit = self.simulate_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

shell_args = ["linux32", "/bin/bash"] if simulate_32_bit else ["/bin/bash"]

subprocess.run(
[
Expand Down

0 comments on commit 75c3845

Please sign in to comment.