Skip to content

Commit 7608a50

Browse files
Fix antlr4-cpp-runtime VERSION filename collision on Windows
On case-insensitive filesystems (Windows), antlr4-cpp-runtime's VERSION file collides with C++ standard library <version> header, causing build failures. Adding powershell-based patch_win_cmds to correctly rename it inside Windows Kokoro builds. PiperOrigin-RevId: 922465750
1 parent 78b2d31 commit 7608a50

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

MODULE.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ single_version_override(
5454
"mv VERSION VERSION.txt || true",
5555
"mv version version.txt || true",
5656
],
57+
patch_win_cmds = [
58+
"powershell -Command \"if (Test-Path VERSION) { Move-Item VERSION VERSION.txt -Force }\"",
59+
"powershell -Command \"if (Test-Path version) { Move-Item version version.txt -Force }\"",
60+
],
5761
)
5862

5963
# Configure rules_python's hermetic toolchains to resolve external

release/kokoro/set_env_windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ echo Python Version Selected: %PYTHON_VERSION%
5353
:: Detect Python executable first (needed for downloading BCR assets dynamically)
5454
set PYTHON_EXE=python
5555
where python%PYTHON_VERSION% >nul 2>&1
56-
if !ERRORLEVEL! EQU 0 (
56+
if %ERRORLEVEL% EQU 0 (
5757
set PYTHON_EXE=python%PYTHON_VERSION%
5858
) else if exist C:\Python%PY_VER_NO_DOT%\python.exe (
5959
set PYTHON_EXE=C:\Python%PY_VER_NO_DOT%\python.exe

0 commit comments

Comments
 (0)