From 42401a36f0e1124e981ae6fa1997057e2b61bac4 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 19 Aug 2026 17:06:37 -0400 Subject: [PATCH 1/6] ci(vcpkg): Update builtin-baseline to the 2026.07.29 release The baseline had not moved since March 2025. MSYS2 mirrors purge superseded packages, so the msys2-runtime pinned by that vcpkg tree now 404s on every mirror and any cold build of ffmpeg fails. The 2026.07.29 tree pins a runtime that is still published. --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 9ce3c6667c3..6242036392f 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", - "builtin-baseline": "b02e341c927f16d991edbd915d8ea43eac52096c", + "builtin-baseline": "9e593bb18ea69cc5095e012465dcd675a822ed0d", "dependencies": [ "zlib", "ffmpeg", From f87758a7095d6851773b5a2d12675d9962276796 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 19 Aug 2026 17:06:47 -0400 Subject: [PATCH 2/6] ci(vcpkg): Restore compiler tracking for the x86-windows triplet Disabling compiler tracking removed the compiler from the ABI hash, so a runner image update could restore binaries built by a different MSVC. It was a workaround for hand-written cache keys invalidating on every image update. The NuGet binary cache addresses that directly, keyed by vcpkg's own ABI hash, so the workaround is no longer needed and a compiler bump can rebuild once. --- triplets/x86-windows.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/triplets/x86-windows.cmake b/triplets/x86-windows.cmake index 106900a72d7..7e8327d9323 100644 --- a/triplets/x86-windows.cmake +++ b/triplets/x86-windows.cmake @@ -2,8 +2,3 @@ set(VCPKG_TARGET_ARCHITECTURE x86) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE dynamic) - -# Exclude compiler version from ABI hash so that weekly GitHub runner image -# updates don't invalidate the binary cache. Minor MSVC version bumps do not -# cause ABI incompatibilities for this project. -set(VCPKG_DISABLE_COMPILER_TRACKING ON) From 6f61f095c06de3716a8d69b202a0b565ca8d2e6a Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 19 Aug 2026 17:06:55 -0400 Subject: [PATCH 3/6] ci: Add the vcpkg manifest and triplets to the shared path filter A change touching only vcpkg.json or triplets produced no build jobs, so a baseline or triplet edit could land without ever being compiled. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b15bc3a3c9e..bec85596444 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,8 @@ jobs: - 'cmake/**' - 'Core/**' - 'Dependencies/**' + - 'triplets/**' + - 'vcpkg.json' - name: Changes Summary run: | From 03674cdc0c9c941b7fc79729e3df59280f6b5288 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 19 Aug 2026 17:07:05 -0400 Subject: [PATCH 4/6] chore(vcpkg): Remove the unused vcpkg-lock.json The file is not vcpkg's lockfile format and nothing reads it. Dependency versions are resolved from builtin-baseline and overrides in vcpkg.json, so the checked-in file only suggested a version pinning that was not in effect. --- README.md | 6 +++--- vcpkg-lock.json | 48 ------------------------------------------------ 2 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 vcpkg-lock.json diff --git a/README.md b/README.md index 71ef5135ad0..f6f6cb46e0b 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,9 @@ cmake --build build/win32 --config Release ### Dependency management -The repository uses a vcpkg manifest (`vcpkg.json`) paired with a lockfile (`vcpkg-lock.json`). When you add or upgrade -dependencies, run `vcpkg install --x-manifest-root . --triplet ` with `VCPKG_FEATURE_FLAGS=versions` so the -lockfile picks up the new versions and include the updated lockfile in your change. GitHub Actions consumes these ports +The repository uses a vcpkg manifest (`vcpkg.json`). Dependency versions come from the `builtin-baseline` commit +recorded there, with per-port `overrides` when a specific version is required. Update the baseline to pick up new +versions. GitHub Actions consumes these ports through `VCPKG_BINARY_SOURCES=clear;files,/vcpkg-bincache,readwrite` (paired with an `actions/cache` entry for that folder), so the first CI build warms the cache and subsequent builds pull prebuilt binaries instead of re-compiling everything. diff --git a/vcpkg-lock.json b/vcpkg-lock.json deleted file mode 100644 index 422998f0378..00000000000 --- a/vcpkg-lock.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "version": 1, - "dependencies": [ - { - "name": "ffmpeg", - "version-string": "7.1.1", - "port-version": 1, - "git-tree": "6ff75f1f596ada519241989f44077cda442480b2" - }, - { - "name": "pkgconf", - "version-string": "2.3.0", - "port-version": 0, - "git-tree": "ae3886d8a627ec99dd18890389b6d5d331e29799" - }, - { - "name": "vcpkg-cmake", - "version-string": "2024-04-23", - "port-version": 0, - "git-tree": "e74aa1e8f93278a8e71372f1fa08c3df420eb840" - }, - { - "name": "vcpkg-cmake-get-vars", - "version-string": "2024-09-22", - "port-version": 0, - "git-tree": "f23148add155147f3d95ae622d3b0031beb25acf" - }, - { - "name": "vcpkg-pkgconfig-get-modules", - "version-string": "2024-04-03", - "port-version": 0, - "git-tree": "6845369c8cb7d3c318e8e3ae92fd2b7570a756ca" - }, - { - "name": "vcpkg-tool-meson", - "version-string": "1.6.1", - "port-version": 0, - "git-tree": "dc948c67d7f1359319f801078422e996b0a89fd0" - }, - { - "name": "zlib", - "version-string": "1.3.1", - "port-version": 0, - "git-tree": "3f05e04b9aededb96786a911a16193cdb711f0c9" - } - ] -} - From 60920d0e1a0e2de038bacbe10e09b68dfee9ec49 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Mon, 6 Apr 2026 14:13:35 -0400 Subject: [PATCH 5/6] ci(vcpkg): Switch binary cache from local files to GitHub Packages NuGet feed --- .github/workflows/build-toolchain.yml | 63 +++++++-------------------- .github/workflows/ci.yml | 1 + README.md | 7 ++- 3 files changed, 20 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 10afc857916..c1c38c8dbd6 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -3,6 +3,7 @@ name: Build Toolchain permissions: contents: read pull-requests: write + packages: write on: workflow_call: @@ -33,8 +34,10 @@ jobs: timeout-minutes: 30 env: - VCPKG_FILE_CACHE: ${{ github.workspace }}\vcpkg-bincache - VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}\vcpkg-bincache,readwrite + # Fork pull requests get a read-only GITHUB_TOKEN, so they restore from the + # feed but must not attempt to upload to it. + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json,${{ github.event.pull_request.head.repo.fork && 'read' || 'readwrite' }}" + VCPKG_NUGET_REPOSITORY: "https://github.com/${{ github.repository }}.git" VCPKG_FEATURE_FLAGS: manifests,versions,binarycaching steps: @@ -105,52 +108,26 @@ jobs: with: arch: x86 - - name: Compute vcpkg cache key parts - if: contains(inputs.preset, 'vcpkg') - id: vcpkg_key - shell: pwsh - run: | - $baseline = (Get-Content vcpkg.json | ConvertFrom-Json)."builtin-baseline" - - $triplet = "x86-windows" - if ("${{ inputs.preset }}" -like "x64*") { $triplet = "x64-windows" } - - "baseline=$baseline" >> $env:GITHUB_OUTPUT - "triplet=$triplet" >> $env:GITHUB_OUTPUT - - Write-Host "vcpkg cache key parts: baseline=$baseline, triplet=$triplet" - - - name: Restore vcpkg binary cache - if: contains(inputs.preset, 'vcpkg') - id: vcpkg_cache - uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 - with: - path: ${{ github.workspace }}\vcpkg-bincache - key: vcpkg-bincache-v3-${{ runner.os }}-baseline${{ steps.vcpkg_key.outputs.baseline }}-${{ steps.vcpkg_key.outputs.triplet }}-${{ hashFiles('triplets/*.cmake') }} - restore-keys: | - vcpkg-bincache-v3-${{ runner.os }}-baseline${{ steps.vcpkg_key.outputs.baseline }}- - vcpkg-bincache-v3-${{ runner.os }}- - - name: Setup vcpkg if: contains(inputs.preset, 'vcpkg') uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6 with: runVcpkgInstall: false - doNotCache: false + doNotCache: true - - name: Configure vcpkg to use cached directory + - name: Configure NuGet Source for vcpkg Binary Cache if: contains(inputs.preset, 'vcpkg') shell: pwsh run: | - $cacheDir = "${{ github.workspace }}\vcpkg-bincache" - New-Item -ItemType Directory -Force -Path $cacheDir | Out-Null - - # lukka/run-vcpkg sets its own temp cache dir; override to force our cached dir - $env:VCPKG_DEFAULT_BINARY_CACHE = $cacheDir - $env:VCPKG_BINARY_SOURCES = "clear;files,$cacheDir,readwrite" - - "VCPKG_DEFAULT_BINARY_CACHE=$cacheDir" >> $env:GITHUB_ENV - "VCPKG_BINARY_SOURCES=$env:VCPKG_BINARY_SOURCES" >> $env:GITHUB_ENV + $nuget = & "$env:VCPKG_ROOT\vcpkg.exe" fetch nuget | Select-Object -Last 1 + & $nuget sources add ` + -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` + -StorePasswordInClearText ` + -Name GitHubPackages ` + -UserName "${{ github.repository_owner }}" ` + -Password "${{ secrets.GITHUB_TOKEN }}" + & $nuget setapikey "${{ secrets.GITHUB_TOKEN }}" ` + -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" "VCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}\triplets" >> $env:GITHUB_ENV "VCPKG_INSTALL_OPTIONS=--x-abi-tools-use-exact-versions" >> $env:GITHUB_ENV @@ -176,14 +153,6 @@ jobs: run: | cmake --build --preset ${{ inputs.preset }} - - name: Save vcpkg binary cache - # Only one job should save to avoid "Unable to reserve cache" conflicts. - if: ${{ contains(inputs.preset, 'vcpkg') && steps.vcpkg_cache.outputs.cache-hit != 'true' && inputs.game == 'Generals' && inputs.preset == 'win32-vcpkg-debug' }} - uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 - with: - path: ${{ github.workspace }}\vcpkg-bincache - key: vcpkg-bincache-v3-${{ runner.os }}-baseline${{ steps.vcpkg_key.outputs.baseline }}-${{ steps.vcpkg_key.outputs.triplet }}-${{ hashFiles('triplets/*.cmake') }} - - name: Collect ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact shell: pwsh run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bec85596444..8f41e9a2425 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ name: GenCI permissions: contents: read pull-requests: write + packages: write on: push: diff --git a/README.md b/README.md index f6f6cb46e0b..5f6e2c54eb2 100644 --- a/README.md +++ b/README.md @@ -83,10 +83,9 @@ cmake --build build/win32 --config Release The repository uses a vcpkg manifest (`vcpkg.json`). Dependency versions come from the `builtin-baseline` commit recorded there, with per-port `overrides` when a specific version is required. Update the baseline to pick up new -versions. GitHub Actions consumes these ports -through `VCPKG_BINARY_SOURCES=clear;files,/vcpkg-bincache,readwrite` (paired with an `actions/cache` entry for -that folder), so the first CI build warms the cache and subsequent builds pull prebuilt binaries instead of -re-compiling everything. +versions. GitHub Actions consumes these ports through a vcpkg binary cache backed by a NuGet feed on GitHub +Packages, keyed by vcpkg's own ABI hashes, so the first CI build warms the feed and subsequent builds pull prebuilt +binaries instead of re-compiling everything. Pull requests from forks restore from the feed but cannot write to it. ### Profiling From 4a2d650ef96f2f60d283753fe5a88e34479ba9f8 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sun, 19 Jul 2026 17:27:55 +0400 Subject: [PATCH 6/6] ci: Re-enable win32 vcpkg presets --- .github/workflows/ci.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f41e9a2425..c559a005256 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,15 +83,15 @@ jobs: - preset: "win32-debug" tools: true extras: true - #- preset: "win32-vcpkg" - # tools: true - # extras: true - #- preset: "win32-vcpkg-profile" - # tools: true - # extras: true - #- preset: "win32-vcpkg-debug" - # tools: true - # extras: true + - preset: "win32-vcpkg" + tools: true + extras: true + - preset: "win32-vcpkg-profile" + tools: true + extras: true + - preset: "win32-vcpkg-debug" + tools: true + extras: true fail-fast: false uses: ./.github/workflows/build-toolchain.yml with: @@ -147,15 +147,15 @@ jobs: - preset: "win32-debug" tools: true extras: true - #- preset: "win32-vcpkg" - # tools: true - # extras: true - #- preset: "win32-vcpkg-profile" - # tools: true - # extras: true - #- preset: "win32-vcpkg-debug" - # tools: true - # extras: true + - preset: "win32-vcpkg" + tools: true + extras: true + - preset: "win32-vcpkg-profile" + tools: true + extras: true + - preset: "win32-vcpkg-debug" + tools: true + extras: true fail-fast: false uses: ./.github/workflows/build-toolchain.yml with: