Repository navigation
ci(build): Cache MSVC and VC6 compilation with ccache - #3608
CryoTheRenegade wants to merge 9 commits into
Conversation
Extend ccache to the VC6 CI presets. Weekly releases keep compiling fresh because vc6-weekly uses /Zi, which ccache cannot cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pull requests restore the newest cache from main but no longer save their own, so caches change only after changes are merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe build workflows add conditional ccache setup, compiler-launcher configuration, statistics reporting, and cache management. The changes also grant cache-management permissions and update includes in two pathfinder source files and the profiler frame-capture source. ChangesConditional ccache workflow
Pathfinder include updates
Profiler include updates
Priority: Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Actions workflow
participant ActionsCache as Actions cache
participant CMake
participant ccache
Workflow->>ActionsCache: Restore configuration-specific cache
CMake->>ccache: Use compiler launcher
Workflow->>ccache: Report statistics
Workflow->>ActionsCache: Save eligible cache
Possibly related PRs
Suggested reviewers: Merge Risk:
|
[Medium impact] The changes appear safe to merge.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What happens if that limit is reached? |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccache drops the least recently used entries once it passes 500 MB. The build keeps working, it just misses on older objects, and the saved cache never grows past 500 MB per configuration. |
|
How do we know this is not going to come back at us later? How can we be absolutely sure this works and keeps working? There has been a lot of tinkering on the CI pipeline lately and not always for the better. |
Honestly if this breaks, we have bigger issues. The main benefit is to speed up ci times by not having to recompile every file every time a pr is made. I agree that CI work has been a pain (or at least from what i have seen) and the hope is that this makes iterative changes to prs not take a million years to finish. The biggest issue i can see is if github has a mega stroke(which is often unfortunately) and doesnt let us download our toolkits, then all we have to do is turn the EDIT: Changed the build steps to continue on ccache download failure, it will just do a normal build. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d6ad605a-3a92-482b-bae8-0dd27f4abb5b
Files selected for processing: 4-
.github/workflows/ci.yml.github/workflows/reusable-build-toolchain.ymlCore/GameEngine/Source/GameLogic/AI/Pathfinder/Path.cppCore/GameEngine/Source/GameLogic/AI/Pathfinder/PathfindLayer.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
Pull request build jobs no longer need actions: write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every push to a PR recompiles every file in CI. With an empty cache, the Zero Hour Release build step takes about 18 minutes, so each round of review fixes waits that long for results. This PR caches compiled objects so unchanged files are reused across pushes and commits.
Cache C and C++ compilation in the modern MSVC and VC6 CI jobs with ccache 4.14.2, which the workflow checksums on download. Each cache key includes the game, preset and compiler version. Restore prefixes let a new commit reuse objects from earlier commits.
ccache does not cache MSVC files that use a precompiled header unless its time-macro checks are relaxed. The cached CI jobs disable PCH instead, which keeps those checks and the existing source encoding. Path.cpp, PathfindLayer.cpp and W3DProfilerFrameCapture.cpp gain explicit includes for headers that PCH used to supply. Weekly VC6 releases compile with /Zi, which ccache cannot cache, so they keep their current setup. Local presets also stay unchanged.
Evidence
win32+t+ejobs, Generals' build step dropped from 6m 21s to 1m 03s and Zero Hour's from 4m 36s to 1m 03s. Whole jobs dropped from 7m 26s to 2m 41s and from 5m 30s to 2m 34s. Timings on hosted runners vary between runs.