mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
ci: freeze the Windows Bazel shell path
This commit is contained in:
@@ -822,7 +822,7 @@ def audit_source_tree(repo_root: Path = REPO_ROOT) -> None:
|
||||
sanitizer_call = "sanitize_bazel_windows_environment"
|
||||
sanitizer_path = Path(".github/scripts/sanitize-bazel-windows-environment.sh")
|
||||
sanitizer_text = (repo_root / sanitizer_path).read_text(encoding="utf-8")
|
||||
frozen_bazel_shell = r'export BAZEL_SH="${ProgramFiles//\\//}/Git/usr/bin/bash.exe"'
|
||||
frozen_bazel_shell = 'export BAZEL_SH="C:/Program Files/Git/usr/bin/bash.exe"'
|
||||
if sanitizer_text.count(frozen_bazel_shell) != 1:
|
||||
errors.append(
|
||||
f"{sanitizer_path} must freeze BAZEL_SH to the Git workflow shell"
|
||||
|
||||
@@ -11,11 +11,6 @@ sanitize_bazel_windows_environment() {
|
||||
if [[ "${RUNNER_OS:-}" != "Windows" ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ -z "${ProgramFiles:-}" ]]; then
|
||||
echo "ProgramFiles must be set for the Windows Bazel shell substrate." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
unset \
|
||||
AR ARFLAGS AS BAZEL_LLVM BAZEL_LLVM_COV BAZEL_LLVM_PROFDATA BAZEL_VC \
|
||||
BAZEL_VC_FULL_VERSION BAZEL_VS BAZEL_WINSDK_FULL_VERSION CC CFLAGS CL \
|
||||
@@ -87,5 +82,5 @@ sanitize_bazel_windows_environment() {
|
||||
return 1
|
||||
fi
|
||||
export PATH="${sanitized_client_path}"
|
||||
export BAZEL_SH="${ProgramFiles//\\//}/Git/usr/bin/bash.exe"
|
||||
export BAZEL_SH="C:/Program Files/Git/usr/bin/bash.exe"
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ class WindowsBazelHermeticityAuditTest(unittest.TestCase):
|
||||
encoding="utf-8",
|
||||
)
|
||||
(root / ".github/scripts/sanitize-bazel-windows-environment.sh").write_text(
|
||||
r'export BAZEL_SH="${ProgramFiles//\\//}/Git/usr/bin/bash.exe"' + "\n",
|
||||
'export BAZEL_SH="C:/Program Files/Git/usr/bin/bash.exe"\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
(root / "BUILD.bazel").write_text(build_contents, encoding="utf-8")
|
||||
|
||||
@@ -58,8 +58,7 @@ class RunBazelWithBuildBuddyTest(unittest.TestCase):
|
||||
"'/msys64/', '/mingw32/', '/mingw64/')\n"
|
||||
" if any(path in normalized_path for path in forbidden_paths):\n"
|
||||
" raise SystemExit(f'compiler path was not cleared: {normalized_path}')\n"
|
||||
" expected_bazel_sh = os.environ['ProgramFiles'].replace('\\\\', '/') "
|
||||
"+ '/Git/usr/bin/bash.exe'\n"
|
||||
" expected_bazel_sh = 'C:/Program Files/Git/usr/bin/bash.exe'\n"
|
||||
" if os.environ.get('BAZEL_SH') != expected_bazel_sh:\n"
|
||||
" raise SystemExit(f'BAZEL_SH is not frozen: {os.environ.get(\"BAZEL_SH\")}')\n"
|
||||
"print(json.dumps(sys.argv[1:]))\n",
|
||||
@@ -229,7 +228,7 @@ class RunBazelWithBuildBuddyTest(unittest.TestCase):
|
||||
"CODEX_BAZEL_WINDOWS_EXECUTION_PATH": r"C:\substrate\bin",
|
||||
"CODEX_BAZEL_WINDOWS_TEST_PATH": r"C:\runtime\bin",
|
||||
"INCLUDE": r"C:\Visual Studio\include",
|
||||
"ProgramFiles": r"C:\Program Files",
|
||||
"ProgramFiles": "",
|
||||
"RUNNER_OS": "Windows",
|
||||
},
|
||||
"--windows-hybrid-execution",
|
||||
|
||||
Reference in New Issue
Block a user