Skip to content

ci: use ccache to speed up builds - #110

Merged
everoddandeven merged 1 commit into
libmonero:mainfrom
everoddandeven:ci/ccache
Oct 24, 2026
Merged

everoddandeven merged 1 commit into
libmonero:mainfrom
everoddandeven:ci/ccache

Conversation

@everoddandeven

Copy link
Copy Markdown
Member

ccache was installed in CI and monero-project used it, but the cache was
never kept between runs, so it was always empty. This keeps .ccache
between runs and makes monero-cpp and the bindings use it too.

  • restore/save .ccache in test, build-macos, build-windows and build-deb
  • PRs only restore, pushes to main and workflow_dispatch save
  • -DCMAKE_*_COMPILER_LAUNCHER=ccache for monero-cpp (workflows and docker/build.sh)
  • new USE_CCACHE option (ON) in the root CMakeLists.txt, off with -DUSE_CCACHE=OFF
  • ccache stats at the end of each job
  • docs/ci-ccache.md with the details and limits

Limits:

  • with ENABLE_COVERAGE, ccache 4.9.1 doesn't cache -fprofile-update=atomic. In the Linux test job that is monero-cpp and the bindings, monero-project is still cached.
  • Windows installs ccache from rolling MSYS2 while the toolchain is pinned. Not tested locally, if it gives trouble drop the ccache steps from the two Windows jobs.

Not run on CI yet. The first run is cold and the cache is only written on
main or manual runs, so to see a difference run test.yml twice with
workflow_dispatch on this branch and compare the "Show ccache statistics" step.

@codacy-production

codacy-production Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

monero-project already picked up ccache, but nothing kept the cache
between runs, so every job started cold. Restore/save .ccache in the
test, macOS, Windows and deb workflows, and pass the compiler launcher
to monero-cpp and monero-python, which didn't use ccache at all.

Pull requests only restore the cache, pushes to main and manual runs
save it. Add USE_CCACHE (ON) to the root CMakeLists and document the
limits in docs/ci-ccache.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@everoddandeven
everoddandeven merged commit 38ceb8c into libmonero:main Oct 24, 2026
4 of 6 checks passed
@everoddandeven
everoddandeven deleted the ci/ccache branch October 24, 2026 13:42
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