From b1073afb356a1e37f0bdf8d81e90f411a1ffee3e Mon Sep 17 00:00:00 2001 From: Michael Oliver Date: Tue, 13 Oct 2026 22:04:24 -0700 Subject: [PATCH] ci(windows): retry Chocolatey installs and fail when a package is missing The Chocolatey community feed sometimes returns 504. choco then installs the other packages and the step passes, so the build fails later in CMake with "Could NOT find PkgConfig". Retry up to three times, fail the step if choco still fails, and check that pkg-config.exe is present. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Michael Oliver --- .github/actions/build-windows/action.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-windows/action.yml b/.github/actions/build-windows/action.yml index 1e49429c..68b6f3d7 100644 --- a/.github/actions/build-windows/action.yml +++ b/.github/actions/build-windows/action.yml @@ -243,9 +243,23 @@ runs: - name: Install build tools (Ninja, flex, bison, nasm, patch, pkg-config, Vulkan) run: | choco feature enable -n allowEmptyChecksums - choco install ninja winflexbison3 nasm patch pkgconfiglite --yes --no-progress --allow-empty-checksums --ignore-checksums + # The Chocolatey community feed sometimes times out (HTTP 504). Retry, and stop here on failure + # instead of letting CMake fail later with "Could NOT find PkgConfig". + function Install-ChocoPackages([string[]]$Packages) { + for ($Attempt = 1; $Attempt -le 3; $Attempt++) { + choco install @Packages --yes --no-progress --allow-empty-checksums --ignore-checksums + if ($LASTEXITCODE -eq 0) { return } + Write-Host "::warning::choco install $Packages failed (exit $LASTEXITCODE), attempt $Attempt of 3" + Start-Sleep -Seconds (30 * $Attempt) + } + throw "choco install $Packages failed after 3 attempts" + } + Install-ChocoPackages ninja, winflexbison3, nasm, patch, pkgconfiglite + if (-not (Test-Path "C:\ProgramData\chocolatey\bin\pkg-config.exe")) { + throw "pkg-config.exe is missing after installing pkgconfiglite" + } if ("${{ steps.windows-vulkan-cache.outputs.cache-hit }}" -ne "true") { - choco install vulkan-sdk --yes --no-progress --allow-empty-checksums --ignore-checksums + Install-ChocoPackages vulkan-sdk } "C:\ProgramData\chocolatey\bin" | Add-Content -Path $env:GITHUB_PATH $VulkanDir = Get-ChildItem -Path "C:\VulkanSDK" -ErrorAction SilentlyContinue | Sort-Object Name -Descending | Select-Object -First 1