mirror of
https://github.com/openai/codex.git
synced 2026-09-07 15:40:00 +00:00
ci: inherit Windows Bazel environment
This commit is contained in:
6
.github/scripts/run_bazel_ci.py
vendored
6
.github/scripts/run_bazel_ci.py
vendored
@@ -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)
|
||||
|
||||
|
||||
|
||||
4
.github/scripts/run_bazel_query_ci.py
vendored
4
.github/scripts/run_bazel_query_ci.py
vendored
@@ -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
|
||||
|
||||
|
||||
|
||||
20
.github/scripts/test_run_bazel_ci.py
vendored
20
.github/scripts/test_run_bazel_ci.py
vendored
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user