-
Notifications
You must be signed in to change notification settings - Fork 29
use ccache in GitHub actions #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideConfigures ccache in multiple GitHub Actions workflows and wires it into CMake builds to cache compiler outputs and speed up CI builds on Linux, macOS, AppImage, and Wasm targets. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've found 1 issue, and left some high level feedback:
- The ccache keys in the AppImage and Wasm workflows are just
${{ github.job }}, which means cache entries won’t vary by branch or significant build inputs; consider including something like${{ github.ref_name }}or a hash of key CMake files in the key (or restore-keys) to avoid suboptimal or incorrect cache reuse. - In
build-release.ymlandbuild-test.yml, the CMake*_LAUNCHER=ccachearguments are passed unconditionally even on Windows where ccache is not configured; you may want to guard those flags with the same OS condition as the ccache step or restrict them to non-Windows generators. - To make cache invalidation easier in the future, consider adding an explicit cache version segment (e.g.,
ccache-v1-...) to thekeyvalues so you can bump it without changing the rest of the key structure.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The ccache keys in the AppImage and Wasm workflows are just `${{ github.job }}`, which means cache entries won’t vary by branch or significant build inputs; consider including something like `${{ github.ref_name }}` or a hash of key CMake files in the key (or restore-keys) to avoid suboptimal or incorrect cache reuse.
- In `build-release.yml` and `build-test.yml`, the CMake `*_LAUNCHER=ccache` arguments are passed unconditionally even on Windows where ccache is not configured; you may want to guard those flags with the same OS condition as the ccache step or restrict them to non-Windows generators.
- To make cache invalidation easier in the future, consider adding an explicit cache version segment (e.g., `ccache-v1-...`) to the `key` values so you can bump it without changing the rest of the key structure.
## Individual Comments
### Comment 1
<location> `.github/workflows/build-release.yml:93` </location>
<code_context>
cd build
cmake --version
- cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -S .. || exit -1
+ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -S .. || exit -1
cmake --build . --parallel
</code_context>
<issue_to_address>
**issue (bug_risk):** Guard the CMake ccache launcher flags to match the platforms where ccache is configured
These `-DCMAKE_*_COMPILER_LAUNCHER=ccache` flags are always set, but the ccache setup only runs on Linux/macOS. On Windows this will likely reference a non‑existent `ccache` binary and break configuration. Please gate these flags with the same `if: runner.os == 'Linux' || runner.os == 'macOS'` condition (e.g., via an env var or matrix flag) so they’re only applied where ccache is available.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| cd build | ||
| cmake --version | ||
| cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -S .. || exit -1 | ||
| cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -S .. || exit -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Guard the CMake ccache launcher flags to match the platforms where ccache is configured
These -DCMAKE_*_COMPILER_LAUNCHER=ccache flags are always set, but the ccache setup only runs on Linux/macOS. On Windows this will likely reference a non‑existent ccache binary and break configuration. Please gate these flags with the same if: runner.os == 'Linux' || runner.os == 'macOS' condition (e.g., via an env var or matrix flag) so they’re only applied where ccache is available.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #437 +/- ##
==========================================
- Coverage 66.48% 65.48% -1.01%
==========================================
Files 85 86 +1
Lines 4186 3963 -223
Branches 255 264 +9
==========================================
- Hits 2783 2595 -188
+ Misses 1403 1368 -35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by Sourcery
Enable compiler caching in CI builds to speed up repeated compilations across workflows.
Build: