CI: force CC=gcc-14 for vcpkg cache hits in copilot-setup-steps

vcpkg detects the compiler hash before the CMake toolchain file loads,
so -DCMAKE_C_COMPILER=gcc-14 on the cmake line was too late -- vcpkg
picked up /usr/bin/c++ (gcc-13 on Ubuntu 24.04) and computed an ABI
hash that did not match the gcc-14 entries baked into the image's
/opt/vcpkg-cache-gcc, restoring 0 packages and rebuilding all 102
ports from source. Export CC/CXX in the step env to match the
Dockerfile's vcpkg-builder-gcc stage.
This commit is contained in:
Magne Sjaastad committed 2026-05-24 12:07:32 +02:00
1 parent ecb928d832
commit dfc007e54e
1 file changed
+8
@@ -78,6 +78,14 @@ jobs:
- name: Configure
env:
# vcpkg's compiler-hash detection runs before the CMake toolchain
# file is loaded, so -DCMAKE_C_COMPILER on the cmake line is too
# late -- vcpkg picks up /usr/bin/c++ (gcc-13 on Ubuntu 24.04) and
# computes an ABI hash that does not match the gcc-14 entries baked
# into /opt/vcpkg-cache-gcc. Forcing CC/CXX in the env matches what
# the Dockerfile's vcpkg-builder-gcc stage exports.
CC: gcc-14
CXX: g++-14
VCPKG_FEATURE_FLAGS: binarycaching
# Read vcpkg dependencies from the gcc binary cache baked into the
# image. buildcache is auto-discovered on PATH by CMakeLists.txt's