Skip to content

Commit da824b0

Browse files
committed
compiler: add retry loop and enable allowEmptyChecksums on Windows
Enables allowEmptyChecksums globally on Chocolatey and implements a 3-attempt retry loop for pkgconfiglite to prevent Windows CI failures caused by transient network or SourceForge mirror errors. Even though --allow-empty-checksums is passed to choco install, newer Chocolatey versions do not propagate this CLI flag to the nested PowerShell installer script (chocolateyInstall.ps1). The inner script fails when downloading the binary from non-secure HTTP SourceForge mirrors unless the allowEmptyChecksums feature is globally enabled via choco feature beforehand.
1 parent 7fdcde1 commit da824b0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

buildscripts/make_dependencies.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1+
choco feature enable -n allowEmptyChecksums
2+
3+
set RETRY=0
4+
:install_pkgconfig
15
choco install -y pkgconfiglite --allow-empty-checksums
6+
if %ERRORLEVEL% neq 0 (
7+
if %RETRY% lss 3 (
8+
set /a RETRY=%RETRY%+1
9+
echo pkgconfiglite installation failed. Retrying %RETRY% of 3 in 5 seconds...
10+
@rem Sleep for 5 seconds using the loopback ping trick (timeout command fails in non-interactive CI)
11+
ping -n 6 127.0.0.1 >nul
12+
goto :install_pkgconfig
13+
)
14+
echo Failed to install pkgconfiglite after 3 attempts.
15+
exit /b 1
16+
)
17+
218
choco install -y openjdk --version=17.0
319
set PATH=%PATH%;"c:\Program Files\OpenJDK\jdk-17\bin"
420
set PROTOBUF_VER=35.1

0 commit comments

Comments
 (0)