[CI] Build the Windows and macOS legs without debug information (#7798)

* [CI] Build the Windows and macOS legs without debug information

Debug information is most of what a compiler cache stores: one Linux
configuration measures 1.2 GB with full DWARF and 660 MB at -g1. The Windows leg
cannot be lowered that way, because MSVC has no -g level and /Z7 is the only
cacheable form, so it sits at full debug info and fills a 1.2 GB cache.

Teach COCKATRICE_DEBUG_INFO_LEVEL=0 to mean something on MSVC by leaving /Z7
out, and build the vcpkg legs (Windows and macOS) at level 0 for every non-tag
ref. A tag is the build that ships and is symbolicated, so it keeps the full
set. The Linux legs keep -g1: a sanitizer report without file and line is not
worth the quota it would save.

Report the ccache directory and the object total at the end of each leg, so the
working set a bound has to fit is a number in the log rather than an estimate.

* [CI] Size the Windows cache for the no-debug footprint

Measured on run 42377451921, one Windows configuration without /Z7 writes a
890 MB ccache directory, against 1.2 GB with it. A 950M bound holds that with
5.4% headroom, which is the same rule the Linux bounds follow.

The comment block that splits the quota follows: 4.25 GB of bounds, 3.9 GB of
stored compiler cache, 8.1 GB of 10 in total.
This commit is contained in:
BruebachL 2026-11-07 20:58:28 +01:00 • committed by GitHub
parent ee66e73b2c
commit 1df8c8efcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 7 deletions

View file

@ -248,10 +248,10 @@ jobs:
# Debian 13 Release + suite 625 MB 800M # Debian 13 Release + suite 625 MB 800M
# Fedora 45 debug Debug + suite 660 MB 850M # Fedora 45 debug Debug + suite 660 MB 850M
# Fedora 45 release Release + package 614 MB 800M # Fedora 45 release Release + package 614 MB 800M
# Windows 10 Release + package 1.2 GB working set 1300M # Windows 10 Release + package 890 MB working set 950M
# #
# That is 4.6 GB of bounds; what lands in the quota is 4.3 GB of compiler cache, # That is 4.25 GB of bounds; what lands in the quota is 3.9 GB of compiler cache,
# 2.97 GB stored by the Linux legs and 1.30 GB by Windows, for 8.4 GB of 10 in total. # 2.97 GB stored by the Linux legs and 0.95 GB by Windows, for 8.1 GB of 10 in total.
# So only legs worth their share get one. A leg keeps no cache when it duplicates # So only legs worth their share get one. A leg keeps no cache when it duplicates
# another leg's coverage (Ubuntu 26.04 behind Debian 13's Release + suite; the macOS # another leg's coverage (Ubuntu 26.04 behind Debian 13's Release + suite; the macOS
# legs behind the Linux ones) or finishes well inside the Windows leg (Servatrice # legs behind the Linux ones) or finishes well inside the Windows leg (Servatrice
@ -680,7 +680,7 @@ jobs:
qt_modules: qtimageformats qtmultimedia qtshadertools qtwebsockets qt_modules: qtimageformats qtmultimedia qtshadertools qtwebsockets
type: Release type: Release
ccache_eviction_age: 7d ccache_eviction_age: 7d
ccache_size: 1300M # Release plus the package: 1.2 GB working set at /Z7 ccache_size: 950M # Release plus the package: 890 MB working set without /Z7
use_ccache: 1 use_ccache: 1
# Scope is named after the vs2026 toolchain, not the generator: the # Scope is named after the vs2026 toolchain, not the generator: the
# ABI hash covers cl.exe, which is identical, so this leg keeps # ABI hash covers cl.exe, which is identical, so this leg keeps
@ -702,8 +702,11 @@ jobs:
CCACHE_DIR: ${{ github.workspace }}/.cache/ CCACHE_DIR: ${{ github.workspace }}/.cache/
CCACHE_SIZE: ${{ matrix.ccache_size || '700M' }} CCACHE_SIZE: ${{ matrix.ccache_size || '700M' }}
PERSIST_CCACHE: ${{ matrix.persist_ccache || 'true' }} PERSIST_CCACHE: ${{ matrix.persist_ccache || 'true' }}
# MSVC has no -g level, so the Windows leg does not ask for one. # MSVC has no -g level, so there is nothing to ask for on Windows: level 0 is the one
COCKATRICE_DEBUG_INFO_LEVEL: ${{ matrix.os != 'Windows' && github.ref_type != 'tag' && '1' || '' }} # value with a meaning there, and it drops /Z7 rather than lowering a level. Pull-request
# builds carry no debug information, which is most of what a compiler cache stores; a
# tag is the build whose binary is shipped and symbolicated, so it keeps the full set.
COCKATRICE_DEBUG_INFO_LEVEL: ${{ github.ref_type != 'tag' && '0' || '' }}
# Shared with build-vcpkg-nightly so the two leg sets run the same steps. # Shared with build-vcpkg-nightly so the two leg sets run the same steps.
steps: &vcpkg-steps steps: &vcpkg-steps
@ -877,6 +880,21 @@ jobs:
WITH_CRASH_REPORTING: ${{ matrix.type == 'Release' && 'ON' || '' }} WITH_CRASH_REPORTING: ${{ matrix.type == 'Release' && 'ON' || '' }}
run: .ci/compile.sh --server --test --vcpkg run: .ci/compile.sh --server --test --vcpkg
# What the compiler cache has to hold for this leg. ccache stores the objects it
# compiles, so their total is the working set a bound has to fit, and the cache
# directory shows what this build actually wrote. Debug information dominates both,
# which is why the level above is reported next to them.
- name: "Report compiler cache footprint"
if: always()
shell: bash
run: |
echo "=== ccache directory"
du -sh "$CCACHE_DIR" 2>/dev/null || echo "(none)"
echo "=== objects and archives"
find build -type f \( -name '*.o' -o -name '*.obj' -o -name '*.a' -o -name '*.lib' \) -exec du -k {} + 2>/dev/null \
| awk '{n++; s+=$1} END {printf "%d files, %.2f GB\n", n, s/1048576}'
echo "=== debug info level in use: '${COCKATRICE_DEBUG_INFO_LEVEL}'"
- name: "Install sentry-cli" - name: "Install sentry-cli"
if: needs.configure.outputs.tag != null && matrix.make_package == '1' if: needs.configure.outputs.tag != null && matrix.make_package == '1'
# Same as the Linux leg above: the install downloads from Sentry's registry, so a # Same as the Linux leg above: the install downloads from Sentry's registry, so a

View file

@ -279,7 +279,14 @@ set(COCKATRICE_DEBUG_INFO_LEVEL
) )
if(NOT COCKATRICE_DEBUG_INFO_LEVEL STREQUAL "") if(NOT COCKATRICE_DEBUG_INFO_LEVEL STREQUAL "")
if(MSVC) if(MSVC)
message(WARNING "COCKATRICE_DEBUG_INFO_LEVEL is ignored on MSVC") # MSVC has no -g level, so /Z7 is either there or it is not. Level 0 is the only value
# that means something here: without /Z7 the objects carry no debug information, which is
# what a cache that has to fit a bound holds. Anything else is the full debug info.
if(COCKATRICE_DEBUG_INFO_LEVEL STREQUAL "0")
string(REPLACE " /Z7" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
message(WARNING "COCKATRICE_DEBUG_INFO_LEVEL is ignored on MSVC except 0")
endif()
else() else()
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -g${COCKATRICE_DEBUG_INFO_LEVEL}") string(APPEND CMAKE_CXX_FLAGS_DEBUG " -g${COCKATRICE_DEBUG_INFO_LEVEL}")
string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g${COCKATRICE_DEBUG_INFO_LEVEL}") string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g${COCKATRICE_DEBUG_INFO_LEVEL}")