Skip to content

ci(build): Cache MinGW-w64 compilation with ccache - #3677

Open
OmarAglan wants to merge 2 commits into
TheSuperHackers:mainfrom
OmarAglan:ci/mingw-ccache
Open

OmarAglan wants to merge 2 commits into
TheSuperHackers:mainfrom
OmarAglan:ci/mingw-ccache

Conversation

@OmarAglan

@OmarAglan OmarAglan commented Nov 12, 2026 •

Copy link
Copy Markdown

The MinGW-w64 jobs compile everything from scratch on every run, which takes about 15 minutes per game. This uses ccache the same way #3608 does for the MSVC and VC6 jobs.

  • ccache is installed from the Ubuntu packages together with the toolchain.
  • CMake uses ccache as the C and C++ compiler launcher.
  • The cache is restored for every run, and saved only for runs that are not pull requests. The cache key has the game, the preset, the compiler version and the commit, like the MSVC keys.
  • CCACHE_SLOPPINESS=pch_defines,time_macros is set, because ccache does not cache files compiled with GCC precompiled headers without it. Precompiled headers stay enabled.
  • The cleanup-ccache job in ci.yml now also waits for the MinGW-w64 jobs, so it deletes their older caches too.

The first CI run with precompiled headers on showed that all 1161 Generals and 1194 Zero Hour compiles can be cached, using 0.2 GB and 0.3 GB of the 0.5 GB limit. Precompiled headers are now off, so a build with an empty cache is slower. The cache sizes may also change.

AI USE

Used AI to make the change.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The reusable MinGW workflow now uses ccache for C and C++ builds, restores and saves compiler caches under defined conditions, and reports cache statistics. CI adds MinGW build jobs for Generals and GeneralsMD and waits for both jobs before cache cleanup.

Changes

MinGW Build CI

Layer / File(s) Summary
Reusable MinGW compiler cache
.github/workflows/reusable-build-mingw.yml
The workflow installs ccache, configures cache settings and CMake compiler launchers, restores and conditionally saves cache entries, and reports cache statistics.
Generals CI job wiring
.github/workflows/ci.yml
CI adds MinGW build jobs for Generals and GeneralsMD, triggered by manual dispatch or changes to the respective game or shared files. Cache cleanup now waits for both jobs.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Suggested reviewers: xezon

Merge Risk: Minimal · up to e7776

This change adds ccache-based caching to the MinGW CI builds and adds the corresponding CI jobs. It affects only CI build time, not product behavior, and no concrete problem was found, so it is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: MinGW-w64 compilation is now cached with ccache. The raw summary confirms ccache installation, CMake compiler launcher setup, and a restore/save cache flow in the reu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states the PR adds ccache to the MinGW-w64 build jobs, which matches the raw summary: ccache installed with the toolchain, CMake compiler launcher set, a game- and preset-specific cach…
Full details: Title check

Explanation

The title states the main change: MinGW-w64 compilation is now cached with ccache. The raw summary confirms ccache installation, CMake compiler launcher setup, and a restore/save cache flow in the reusable MinGW workflow. The title is specific and matches the changeset, though it omits the added MinGW build jobs and the cleanup-ccache change.

Full details: Description check

Explanation

The description states the PR adds ccache to the MinGW-w64 build jobs, which matches the raw summary: ccache installed with the toolchain, CMake compiler launcher set, a game- and preset-specific cache key, cache save restricted to non-PR runs, and cleanup-ccache waiting on the MinGW jobs. It is specific about the cache key, the CCACHE_SLOPPINESS setting, and the removal of precompiled headers' effect on build time. The description is related to the changeset, so the check passes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent 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: 0347b7a3-eb18-4a78-9d6c-79c40d8b9b6f
Commits

Reviewing files that changed from the base of the PR and between 22abe99 and e77760f.

Files selected for processing: 1

  • .github/workflows/reusable-build-mingw.yml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@OmarAglan
OmarAglan marked this pull request as ready for review November 15, 2026 09:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T15:00:59.739995Z 5beda9f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the previous timestamp issue is fixed and no new actionable issues were found.

Summary

Adds ccache to the MinGW-w64 builds.

  • MinGW builds reuse compiler results from earlier CI runs.

Reviews (2) · Last reviewed commit: "ci(build): Disable precompiled headers i..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant