Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def build_in_container(
project=container_project_path,
package=container_package_dir,
)
container.call(["sh", "-c", before_all_prepared], env=env)
container.call(["bash", "-c", before_all_prepared], env=env)

built_wheels: list[PurePosixPath] = []

Expand Down Expand Up @@ -258,7 +258,7 @@ def build_in_container(
project=container_project_path,
package=container_package_dir,
)
container.call(["sh", "-c", before_build_prepared], env=env)
container.call(["bash", "-c", before_build_prepared], env=env)

log.step("Building wheel...")

Expand Down Expand Up @@ -320,7 +320,7 @@ def build_in_container(
repair_command_prepared = prepare_command(
build_options.repair_command, wheel=built_wheel, dest_dir=repaired_wheel_dir
)
container.call(["sh", "-c", repair_command_prepared], env=env)
container.call(["bash", "-c", repair_command_prepared], env=env)
else:
container.call(["mv", built_wheel, repaired_wheel_dir])

Expand Down Expand Up @@ -365,7 +365,7 @@ def build_in_container(
project=container_project_path,
package=container_package_dir,
)
container.call(["sh", "-c", before_test_prepared], env=virtualenv_env)
container.call(["bash", "-c", before_test_prepared], env=virtualenv_env)

# Install the wheel we just built
# Note: If auditwheel produced two wheels, it's because the earlier produced wheel
Expand Down Expand Up @@ -394,7 +394,7 @@ def build_in_container(
container.call(["mkdir", "-p", test_cwd])
container.copy_into(test_fail_cwd_file, test_cwd / "test_fail.py")

container.call(["sh", "-c", test_command_prepared], cwd=test_cwd, env=virtualenv_env)
container.call(["bash", "-c", test_command_prepared], cwd=test_cwd, env=virtualenv_env)

# clean up test environment
container.call(["rm", "-rf", testing_temp_dir])
Expand Down Expand Up @@ -478,7 +478,7 @@ def build(options: Options, tmp_path: Path) -> None: # noqa: ARG001


def _matches_prepared_command(error_cmd: Sequence[str], command_template: str) -> bool:
if len(error_cmd) < 3 or error_cmd[0:2] != ["sh", "-c"]:
if len(error_cmd) < 3 or error_cmd[0:2] != ["bash", "-c"]:
return False
command_prefix = command_template.split("{", maxsplit=1)[0].strip()
return error_cmd[2].startswith(command_prefix)
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/oci_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def copy_into(self, from_path: Path, to_path: PurePath) -> None:
"exec",
"-i",
str(self.name),
"sh",
"bash",
"-c",
f"cat > {shell_quote(to_path)}",
],
Expand Down
8 changes: 4 additions & 4 deletions unit_test/oci_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_environment(container_engine):
) as container:
assert (
container.call(
["sh", "-c", "echo $TEST_VAR"], env={"TEST_VAR": "1"}, capture_output=True
["bash", "-c", "echo $TEST_VAR"], env={"TEST_VAR": "1"}, capture_output=True
)
== "1\n"
)
Expand All @@ -120,9 +120,9 @@ def test_environment_pass(container_engine, monkeypatch):
with OCIContainer(
engine=container_engine, image=DEFAULT_IMAGE, oci_platform=DEFAULT_OCI_PLATFORM
) as container:
assert container.call(["sh", "-c", "echo $CIBUILDWHEEL"], capture_output=True) == "1\n"
assert container.call(["bash", "-c", "echo $CIBUILDWHEEL"], capture_output=True) == "1\n"
assert (
container.call(["sh", "-c", "echo $SOURCE_DATE_EPOCH"], capture_output=True)
container.call(["bash", "-c", "echo $SOURCE_DATE_EPOCH"], capture_output=True)
== "1489957071\n"
)

Expand Down Expand Up @@ -182,7 +182,7 @@ def test_large_environment(container_engine):
) as container:
# check the length of d
assert (
container.call(["sh", "-c", "echo ${#d}"], env=large_environment, capture_output=True)
container.call(["bash", "-c", "echo ${#d}"], env=large_environment, capture_output=True)
== f"{long_env_var_length}\n"
)

Expand Down