Repository navigation
CI: Add compiler caches to the native PR builds - #28
Merged
Merged
Conversation
Windows x64 and arm64 had no compiler cache, so every PR recompiled
OBS from scratch (10-14 min of MSBuild on the critical path). Enable
the ccache path OBS already has in cmake/windows/compilerconfig.cmake:
ccache 4.14.1 (pinned, SHA-256 checked) copied in as cl.exe and run
through MSBuild's CLToolExe. That path never worked because a later
block reset CMAKE_MSVC_DEBUG_INFORMATION_FORMAT to ProgramDatabase
(/Zi), which ccache refuses; keep /Z7 while ccache is enabled.
zccache (soldr 0.9.31, zccache 1.15.2) and sccache were evaluated
first. Neither can stand in for cl.exe under the Visual Studio
generator, and zccache treats every compile with /Fd as non-cacheable
(zccache-compiler side_outputs.rs), which CMake passes on every MSVC
compile, so it would cache nothing even under Ninja.
The other jobs had caches that froze at their first save: Ubuntu
ccache and the macOS Xcode CAS used a fixed key and only saved on a
miss, and flatpak-builder's ccache lives in the dependency cache keyed
by the manifest hash. Key them by commit, save only on master pushes
(zackees/ci.yml), and prune ccache to the entries the master build used
so each saved cache stays the size of one build. Flatpak restores a
separate ccache directory before the action extracts its snapshot.
macOS master pushes build cold because the CAS cannot be pruned by age.
Log ccache stats (hit rate, uncacheable reasons) for Linux, Windows
and Flatpak so the hit rates are visible in the job logs.
Local-Gate: v1 tree=752e084324056aaf39f980541c2803b25cb2f14c secs=540 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791533188,"gate":"rust/all/fmt","host":"linux-x86_64","key":"816edad2ecc6b0b15e7802401af1fe8bb1d35a728c2d88ebc5588c39c5930c0e","lane":"lint","parents":["2c1f11b500123b80439308cb62535650ff57eeaa"],"secs":526,"stamp":"1f43395c228704774b36e73ad95c1226","tree":"752e084324056aaf39f980541c2803b25cb2f14c","v":1,"via":"run"}
Ci-Attestation: {"at":1791533188,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"816edad2ecc6b0b15e7802401af1fe8bb1d35a728c2d88ebc5588c39c5930c0e","lane":"lint","parents":["2c1f11b500123b80439308cb62535650ff57eeaa"],"secs":526,"stamp":"1a2830f57c23d6f863209e4cc887cac7","tree":"752e084324056aaf39f980541c2803b25cb2f14c","v":1,"via":"run"}
Ci-Attestation: {"at":1791533188,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"a4d9714a127445dc789aacaf2a7fd67439fa91d3f98142f2fbfac6b1b2fdf370","lane":"rust-test","parents":["2c1f11b500123b80439308cb62535650ff57eeaa"],"secs":3,"stamp":"5049dec518d245aa5a21c7dd5b3979df","tree":"752e084324056aaf39f980541c2803b25cb2f14c","v":1,"via":"run"}
Ci-Attestation: {"at":1791533188,"gate":"general/linux-x64/tier2","host":"linux-x86_64","key":"c1e54f4ab167df63818b1e5d7f3563ad7c6d8fe4b75dcfa3be7d648488b054a9","lane":"tier2-linux","parents":["2c1f11b500123b80439308cb62535650ff57eeaa"],"secs":11,"stamp":"399202c98678f10246496abe72b5ad81","tree":"752e084324056aaf39f980541c2803b25cb2f14c","v":1,"via":"run"}
6 tasks done
Member
Author
Measurements
Times are job wall time. The compile step is in parentheses (MSBuild
On Windows, the 17 compiles ccache cannot cache are 15 "compiler output file missing" and 2 "could not use precompiled header". Saved cache sizes after pruning to one build: Windows x64 299 MB, Windows arm64 285 MB, Ubuntu 150 MB, Xcode CAS 296 MB and 294 MB, Flatpak ccache 158 MB. A warm master push keeps the same sizes, so the pruning works. Repo cache usage is about 6.6 GB of the 10 GB limit, and 2.35 GB of that is the existing flatpak-builder dependency cache. Notes:
|
icp4u
pushed a commit
to icp4u/obs-studio
that referenced
this pull request
Oct 9, 2026
Comment-only change. It also serves as the warm-cache measurement for the native CI compiler caches added in obs-rust#28. Local-Gate: v1 tree=1e2d0b50af134d9d3371eaf70644f4c82b288f69 secs=22 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791534651,"gate":"rust/all/fmt","host":"linux-x86_64","key":"fd633a3887ad9584c2dc1d93873601315f68394be1156534f866b796bfae6334","lane":"lint","parents":["a15fda4045084da0b0aa8a8a79c921332a76abad"],"secs":9,"stamp":"23e742f11064a715a981be28fa8a6fc0","tree":"1e2d0b50af134d9d3371eaf70644f4c82b288f69","v":1,"via":"run"} Ci-Attestation: {"at":1791534651,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"fd633a3887ad9584c2dc1d93873601315f68394be1156534f866b796bfae6334","lane":"lint","parents":["a15fda4045084da0b0aa8a8a79c921332a76abad"],"secs":9,"stamp":"c0843501afcf834f8cd5d3ef99acd7f4","tree":"1e2d0b50af134d9d3371eaf70644f4c82b288f69","v":1,"via":"run"} Ci-Attestation: {"at":1791534651,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"a340432c0fc182b243d058246468f322eccc5079cdda68c5bdf52620533476b1","lane":"rust-test","parents":["a15fda4045084da0b0aa8a8a79c921332a76abad"],"secs":3,"stamp":"eba36256d742720864d810c6d18555fd","tree":"1e2d0b50af134d9d3371eaf70644f4c82b288f69","v":1,"via":"run"}
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a working compiler cache to every native build job in
build-project.yaml, so a PR that touches C/C++ no longer recompiles OBS from scratch.cl.exethrough MSBuildCLToolExe, using the existingENABLE_CCACHEpath incmake/windows/compilerconfig.cmake--ccache, stored inside the dependency cache keyed by the manifest hash, so it was frozen too.flatpak-builder/ccachedirectory gets its own commit-keyed cache, restored before the actionWhy the Windows MSVC ccache path never worked: a later block in
compilerconfig.cmakeresetCMAKE_MSVC_DEBUG_INFORMATION_FORMATtoProgramDatabase(/Zi), and ccache refuses/Zi. While ccache is enabled the format now staysEmbedded(/Z7). ccache handles/Fdand/MPwithout problems (seeargprocessing.cppin v4.14.1).Why not zccache or sccache: neither can run as a
cl.exestand-in under the Visual Studio generator. On top of that, zccache 1.15.2 marks every MSVC compile that carries/Fdas non-cacheable (zccache-compiler/src/side_outputs.rs, from zccache#1175). CMake passes/Fdon every MSVC compile, under both the VS and Ninja generators, so zccache would cache nothing here.Cache policy (zackees/ci.yml): PRs only restore. Only
pushtorefs/heads/mastersaves. Only compiler-cache directories are cached, never build trees. Before saving, a master build runsccache --evict-older-than <job age>, so each saved cache holds only the entries that build used.Every job now writes ccache stats (hit rate and reasons for uncacheable compiles) to its log.
Motivation and Context
Windows x64 (about 15-16 min) is the critical path for native PRs. Measurements (cold PR run, master seed, warm follow-up PR) will be posted in the comments.
How Has This Been Tested?
./lint,./unittest, and the local gate passed and stamped this commit.actionlintis clean except for the existingubuntu-26.04runner-label warnings.Types of changes
Checklist: