diff --git a/.github/scripts/audit_bazel_windows_hermeticity.py b/.github/scripts/audit_bazel_windows_hermeticity.py index 45cc6a90db..6065830054 100755 --- a/.github/scripts/audit_bazel_windows_hermeticity.py +++ b/.github/scripts/audit_bazel_windows_hermeticity.py @@ -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" diff --git a/.github/scripts/sanitize-bazel-windows-environment.sh b/.github/scripts/sanitize-bazel-windows-environment.sh index 50cc503d3a..489638ff50 100755 --- a/.github/scripts/sanitize-bazel-windows-environment.sh +++ b/.github/scripts/sanitize-bazel-windows-environment.sh @@ -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" } diff --git a/.github/scripts/test_audit_bazel_windows_hermeticity.py b/.github/scripts/test_audit_bazel_windows_hermeticity.py index 1be7e4e9f1..5f9011890f 100755 --- a/.github/scripts/test_audit_bazel_windows_hermeticity.py +++ b/.github/scripts/test_audit_bazel_windows_hermeticity.py @@ -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") diff --git a/.github/scripts/test_run_bazel_with_buildbuddy.py b/.github/scripts/test_run_bazel_with_buildbuddy.py index 1ea73526c6..76bc924248 100644 --- a/.github/scripts/test_run_bazel_with_buildbuddy.py +++ b/.github/scripts/test_run_bazel_with_buildbuddy.py @@ -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",