ci/cd: build vcpkg ports release-only via an overlay triplet

vcpkg builds every port twice (release + debug) in manifest mode and the
VCPKG_BUILD_TYPE environment variable is ignored there; pin the build
type in overlay triplets instead (tooling/vcpkg-triplets/release, one per
supported triplet). The release configuration is what both workflows
consume: FFMPEG_DIR drives the release layout (lib/pkgconfig) and the C
ABI is identical for the debug binary CI tests. Verified locally in
debian:12: a release-only overlay builds zlib/libpng/openssl/pkgconf/
libsndfile with zero debug trees.

Debug-only is not an option: ports like zlib patch files in the release
layout and fail when only the debug configuration is built.
This commit is contained in:
2026-09-24 18:19:06 +08:00
parent 6de991de33
commit 1dc5a77ab0
7 changed files with 77 additions and 4 deletions
+2 -2
View File
@@ -274,7 +274,7 @@ jobs:
# whole install — vcpkg refuses to retry that class of curl
# error — so retry here.
for attempt in 1 2 3; do
vcpkg install --triplet ${{ matrix.triplet }} && exit 0
vcpkg install --triplet ${{ matrix.triplet }} --overlay-triplets tooling/vcpkg-triplets/release && exit 0
echo "vcpkg install failed (attempt $attempt); retrying"
sleep 15
done
@@ -285,7 +285,7 @@ jobs:
shell: pwsh
run: |
for ($i = 1; $i -le 3; $i++) {
vcpkg install --triplet ${{ matrix.triplet }}
vcpkg install --triplet ${{ matrix.triplet }} --overlay-triplets tooling/vcpkg-triplets/release
if ($LASTEXITCODE -eq 0) { exit 0 }
Write-Host "vcpkg install failed (attempt $i); retrying"
Start-Sleep -Seconds 15
+2 -2
View File
@@ -315,7 +315,7 @@ jobs:
# error — so retry here. vcpkg resumes from its archive and
# download caches, so a repeat attempt is cheap.
for attempt in 1 2 3; do
vcpkg install --triplet ${{ matrix.triplet }} && exit 0
vcpkg install --triplet ${{ matrix.triplet }} --overlay-triplets tooling/vcpkg-triplets/release && exit 0
echo "vcpkg install failed (attempt $attempt); retrying"
sleep 15
done
@@ -326,7 +326,7 @@ jobs:
shell: pwsh
run: |
for ($i = 1; $i -le 3; $i++) {
vcpkg install --triplet ${{ matrix.triplet }}
vcpkg install --triplet ${{ matrix.triplet }} --overlay-triplets tooling/vcpkg-triplets/release
if ($LASTEXITCODE -eq 0) { exit 0 }
Write-Host "vcpkg install failed (attempt $i); retrying"
Start-Sleep -Seconds 15
+23
View File
@@ -0,0 +1,23 @@
# vcpkg overlay triplets
Small overlays over vcpkg's builtin triplets, passed to `vcpkg install`
with `--overlay-triplets <dir>` (both workflows, see
`.github/workflows/ci.yml` and `.github/workflows/cd.yml`).
`release/` pins every supported triplet to the release configuration
(`set(VCPKG_BUILD_TYPE release)`): vcpkg otherwise builds every port
twice — release and debug — which doubles the FFmpeg/port build time in
CI and CD. Our build scripts only ever consume the release layout
(`FFMPEG_DIR=<prefix>` with `<prefix>/lib/pkgconfig`, plus the linker
paths those `.pc` files carry), so the debug half was pure waste; the C
libraries' ABI is identical for the debug cargo binary CI tests.
Notes:
- The non-build-type settings mirror vcpkg's builtin triplets
(`scripts/triplets/`) so the overlay stays a drop-in replacement; a
vcpkg upgrade that changes a builtin triplet should be mirrored here.
- `VCPKG_BUILD_TYPE` must be set in the triplet: the environment
variable of the same name is ignored in manifest mode.
- Do not try `debug` here: several ports (e.g. zlib) patch files in the
release layout and fail when only the debug configuration is built.
@@ -0,0 +1,12 @@
# Oak's build-type overlay triplet for arm64-linux (see the note in
# ../README.md): the settings mirror vcpkg's builtin arm64-linux.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
# Build only the release configuration (see x64-linux.cmake).
set(VCPKG_BUILD_TYPE release)
@@ -0,0 +1,13 @@
# Oak's build-type overlay triplet for arm64-osx (see the note in
# ../README.md): the settings mirror vcpkg's builtin arm64-osx.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)
# Build only the release configuration (see x64-linux.cmake).
set(VCPKG_BUILD_TYPE release)
@@ -0,0 +1,14 @@
# Oak's build-type overlay triplet for x64-linux (see the note in
# ../README.md): the settings mirror vcpkg's builtin x64-linux.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
# Build only the release configuration. vcpkg otherwise builds every port
# twice (release + debug) and our build scripts/vcpkg caches only ever use
# the release layout (FFMPEG_DIR's lib/pkgconfig).
set(VCPKG_BUILD_TYPE release)
@@ -0,0 +1,11 @@
# Oak's build-type overlay triplet for x64-windows (see the note in
# ../README.md): the settings mirror vcpkg's builtin x64-windows.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PROVIDED_FORTRAN ON)
# Build only the release configuration (see x64-linux.cmake).
set(VCPKG_BUILD_TYPE release)