Skip to content

Commit db7a9f5

Browse files
committed
compiler: add retry loop and enable empty checksums for Windows pkg-config installation
Enables allowEmptyChecksums globally on Chocolatey and implements a self-healing 3-attempt retry loop for pkgconfiglite. This avoids unnecessary Windows build failures in Kokoro/GitHub Actions caused by transient network glitches or secure-source download restrictions when fetching the pkg-config binary from SourceForge mirrors.
1 parent 7fdcde1 commit db7a9f5

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)