diff --git a/.github/scripts/run_bazel_ci.py b/.github/scripts/run_bazel_ci.py index e9a48ee3bf..f57f782e3f 100755 --- a/.github/scripts/run_bazel_ci.py +++ b/.github/scripts/run_bazel_ci.py @@ -65,7 +65,7 @@ class Options: @dataclass(frozen=True) class Invocation: command: list[str] - child_env: dict[str, str] + child_env: dict[str, str] | None ci_config: str post_config_args: list[str] remote_enabled: bool @@ -205,9 +205,7 @@ def build_invocation( "--", *targets, ) - child_env = dict(env) - if env.get("RUNNER_OS") == "Windows": - child_env["MSYS2_ARG_CONV_EXCL"] = "*" + child_env = None if env is os.environ else dict(env) return Invocation(command, child_env, config, post_args, remote_enabled) diff --git a/.github/scripts/run_bazel_query_ci.py b/.github/scripts/run_bazel_query_ci.py index 034080d5ea..aeda5d6ea3 100755 --- a/.github/scripts/run_bazel_query_ci.py +++ b/.github/scripts/run_bazel_query_ci.py @@ -40,9 +40,7 @@ def main(argv: Sequence[str] | None = None, env: Mapping[str, str] | None = None print(exc, file=sys.stderr) return 1 - child_env = dict(env) - if env.get("RUNNER_OS") == "Windows": - child_env["MSYS2_ARG_CONV_EXCL"] = "*" + child_env = None if env is os.environ else dict(env) return subprocess.run(command, env=child_env, check=False).returncode diff --git a/.github/scripts/test_run_bazel_ci.py b/.github/scripts/test_run_bazel_ci.py index 3e4fea4f03..f23acc2d4a 100644 --- a/.github/scripts/test_run_bazel_ci.py +++ b/.github/scripts/test_run_bazel_ci.py @@ -87,7 +87,25 @@ class RunBazelCiTest(unittest.TestCase): self.assertIn("--host_platform=//:local_windows_msvc", invocation.command) self.assertIn("--jobs=8", invocation.command) self.assertIn(r"--test_env=PATH=C:\Windows", invocation.command) - self.assertEqual(invocation.child_env["MSYS2_ARG_CONV_EXCL"], "*") + self.assertEqual( + invocation.child_env, + { + "CODEX_BAZEL_BIN": "fake-bazel", + "CODEX_BAZEL_WINDOWS_PATH": r"C:\Windows", + "RUNNER_OS": "Windows", + }, + ) + + def test_runtime_invocation_inherits_the_process_environment(self) -> None: + invocation = run_bazel_ci.build_invocation( + run_bazel_ci.Options(), + ["build"], + ["//codex-rs/cli:codex"], + os.environ, + pid=123, + ) + + self.assertIsNone(invocation.child_env) def test_remote_windows_cross_compile_uses_linux_build_environment(self) -> None: invocation = run_bazel_ci.build_invocation(