Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ bazel_dep(name = "rules_python", version = "1.9.0")
single_version_override(
module_name = "antlr4-cpp-runtime",
patch_cmds = [
"mv VERSION VERSION.txt || true",
"mv version version.txt || true",
"python3 -c \"import os; [os.rename(f, f + '.txt') for f in ['VERSION', 'version'] if os.path.exists(f)]\" || python -c \"import os; [os.rename(f, f + '.txt') for f in ['VERSION', 'version'] if os.path.exists(f)]\"",
],
)

Expand Down
10 changes: 6 additions & 4 deletions release/kokoro/presubmit_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ setlocal enabledelayedexpansion

set "IN_PRESUBMIT=1"
set "PRESUBMIT_STATUS=0"
set "FETCH_RETRIES=10"
set "FETCH_RETRY_DELAY_S=10"
if "%PYTHON_VERSIONS%" == "" (
set "PYTHON_VERSIONS=3.11"
)
Expand Down Expand Up @@ -53,18 +55,18 @@ for %%V in (%PYTHON_VERSIONS%) do (
set ATTEMPTS=0
:fetch_loop
set /a ATTEMPTS+=1
echo Fetch attempt !ATTEMPTS! of %FETCH_RETRIES%...
echo Fetch attempt !ATTEMPTS! of !FETCH_RETRIES!...
bazel %STARTUP_FLAGS% fetch //... > fetch.log 2>&1
set FETCH_STATUS=!ERRORLEVEL!
type fetch.log
if !FETCH_STATUS! NEQ 0 (
findstr /i "timeout timed" fetch.log >nul
if !ERRORLEVEL! EQU 0 (
if !ATTEMPTS! LSS %FETCH_RETRIES% (
echo Fetch failed with timeout. Retrying in %FETCH_RETRY_DELAY_S% seconds...
if !ATTEMPTS! LSS !FETCH_RETRIES! (
echo Fetch failed with timeout. Retrying in !FETCH_RETRY_DELAY_S! seconds...
:: Use ping instead of timeout because timeout command fails in non-interactive Kokoro environments
:: with "ERROR: Input redirection is not supported, exiting the process immediately."
set /a PINGS=%FETCH_RETRY_DELAY_S%+1
set /a PINGS=!FETCH_RETRY_DELAY_S!+1
ping -n !PINGS! 127.0.0.1 >nul
goto fetch_loop
)
Expand Down
16 changes: 7 additions & 9 deletions release/kokoro/release_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@
:: limitations under the License.
::
setlocal enabledelayedexpansion
:: release_windows.bat
:: Kokoro entrypoint for Windows Release builds.
set "RELEASE_STATUS=0"
set "FETCH_RETRIES=10"
set "FETCH_RETRY_DELAY_S=10"

echo === Loading Environment Configuration ===
call "%~dp0set_env_windows.bat"
if !ERRORLEVEL! NEQ 0 (
echo Failed to configure build environment!
exit /b 1
)

set "RELEASE_STATUS=0"

:: If running locally (not on Kokoro), authenticate with gcloud.
if "%KOKORO_BUILD_ID%" == "" (
gcloud auth application-default print-access-token --quiet >nul 2>&1
Expand Down Expand Up @@ -126,18 +124,18 @@ echo --- Pre-fetching Dependencies ---
set ATTEMPTS=0
:fetch_loop
set /a ATTEMPTS+=1
echo Fetch attempt !ATTEMPTS! of %FETCH_RETRIES%...
echo Fetch attempt !ATTEMPTS! of !FETCH_RETRIES!...
bazel %STARTUP_FLAGS% fetch //... > fetch.log 2>&1
set FETCH_STATUS=!ERRORLEVEL!
type fetch.log
if !FETCH_STATUS! NEQ 0 (
findstr /i "timeout timed" fetch.log >nul
if !ERRORLEVEL! EQU 0 (
if !ATTEMPTS! LSS %FETCH_RETRIES% (
echo Fetch failed with timeout. Retrying in %FETCH_RETRY_DELAY_S% seconds...
if !ATTEMPTS! LSS !FETCH_RETRIES! (
echo Fetch failed with timeout. Retrying in !FETCH_RETRY_DELAY_S! seconds...
:: Use ping instead of timeout because timeout command fails in non-interactive Kokoro environments
:: with "ERROR: Input redirection is not supported, exiting the process immediately."
set /a PINGS=%FETCH_RETRY_DELAY_S%+1
set /a PINGS=!FETCH_RETRY_DELAY_S!+1
ping -n !PINGS! 127.0.0.1 >nul
goto fetch_loop
)
Expand Down
6 changes: 1 addition & 5 deletions release/kokoro/set_env_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ echo BAZEL_SH set to %BAZEL_SH%
:: Configure a very short Bazel output user root to completely bypass the Windows 260-character path length limit (MAX_PATH)
set "STARTUP_FLAGS=--output_user_root=C:/tmp"

:: Configure retry parameters for Bazel fetch to absorb transient download timeouts
set "FETCH_RETRIES=10"
set "FETCH_RETRY_DELAY_S=10"

echo --- Bazel Version ---
bazel %STARTUP_FLAGS% version

Expand All @@ -53,7 +49,7 @@ echo Python Version Selected: %PYTHON_VERSION%
:: Detect Python executable first (needed for downloading BCR assets dynamically)
set PYTHON_EXE=python
where python%PYTHON_VERSION% >nul 2>&1
if !ERRORLEVEL! EQU 0 (
if %ERRORLEVEL% EQU 0 (
set PYTHON_EXE=python%PYTHON_VERSION%
) else if exist C:\Python%PY_VER_NO_DOT%\python.exe (
set PYTHON_EXE=C:\Python%PY_VER_NO_DOT%\python.exe
Expand Down
Loading