-
Notifications
You must be signed in to change notification settings - Fork 762
[ci] Replace ccache with sccache #4594
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
818fcd0 to
f6bad2a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4594 +/- ##
==========================================
+ Coverage 87.19% 87.62% +0.44%
==========================================
Files 249 250 +1
Lines 14276 14279 +3
==========================================
+ Hits 12446 12511 +65
+ Misses 1830 1768 -62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dea58cc to
ead41cc
Compare
177482f to
79da6e3
Compare
79da6e3 to
9d92529
Compare
a628028 to
c3214e2
Compare
| set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}") | ||
| set(CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}") | ||
| if("${HOST_OS_NAME}" STREQUAL "Windows") | ||
| set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>") |
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.
Is there a reason why this is only needed when sccache is present?
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.
From https://github.com/mozilla/sccache?tab=readme-ov-file#usage:
For versions of cmake 3.25 and later, to compile with MSVC, you have to use the new CMAKE_MSVC_DEBUG_INFORMATION_FORMAT option, meant to configure the -Z7 flag. Additionally, you must set the cmake policy number 0141 to the NEW setting:
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>") cmake_policy(SET CMP0141 NEW)Example configuration where we automatically look for sccache in the PATH:
find_program(SCCACHE sccache REQUIRED) set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE}) set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE}) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>") cmake_policy(SET CMP0141 NEW)
xmkg
left a comment
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.
LGTM, except for a small question inline.
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.
LGTM. Good work Scott!
14516f2 to
fd57384
Compare
This PR adds support for and replaces the use of
ccachewithsccachein Windows/macOS CI.This provides several benefits such Windows support and the additional ability to also cache Rust builds.
The control of cache dumps in GitHub cache is also improved so that caches are only published when a PR has been pushed to
main, usually bygithub-merge-queue. A cache for a PR is selected as the cache that was published frommainwhere the current branch originated from, and if not found, the next cache matching against therestore-keysfield.Documentation for
sccachecan be found here.Documentation for the
sccacheGitHub action can be found here.