Skip to content

Conversation

@sharder996
Copy link
Collaborator

@sharder996 sharder996 commented Jan 1, 2026

This PR adds support for and replaces the use of ccache with sccache in 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 by github-merge-queue. A cache for a PR is selected as the cache that was published from main where the current branch originated from, and if not found, the next cache matching against the restore-keys field.

Documentation for sccache can be found here.
Documentation for the sccache GitHub action can be found here.

@sharder996 sharder996 marked this pull request as draft January 1, 2026 17:49
@sharder996 sharder996 marked this pull request as ready for review January 1, 2026 17:49
@sharder996 sharder996 closed this Jan 1, 2026
@sharder996 sharder996 reopened this Jan 1, 2026
@sharder996 sharder996 force-pushed the kaizen/use-sccache branch 2 times, most recently from 818fcd0 to f6bad2a Compare January 1, 2026 18:39
@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.62%. Comparing base (6f690d9) to head (14516f2).
⚠️ Report is 66 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sharder996 sharder996 force-pushed the kaizen/use-sccache branch 3 times, most recently from dea58cc to ead41cc Compare January 1, 2026 22:02
@sharder996 sharder996 marked this pull request as draft January 5, 2026 17:13
@sharder996 sharder996 force-pushed the kaizen/use-sccache branch 3 times, most recently from 177482f to 79da6e3 Compare January 9, 2026 04:11
@sharder996 sharder996 marked this pull request as ready for review January 9, 2026 14:07
@sharder996 sharder996 requested review from ricab, tobe2098 and xmkg and removed request for ricab January 9, 2026 14:08
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>")
Copy link
Member

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?

Copy link
Collaborator Author

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)

Copy link
Member

@xmkg xmkg left a 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.

tobe2098
tobe2098 previously approved these changes Jan 20, 2026
Copy link
Contributor

@tobe2098 tobe2098 left a 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!

@sharder996 sharder996 added this pull request to the merge queue Jan 20, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 20, 2026
@tobe2098 tobe2098 added this pull request to the merge queue Jan 20, 2026
@sharder996 sharder996 removed this pull request from the merge queue due to a manual request Jan 20, 2026
@sharder996 sharder996 enabled auto-merge January 20, 2026 16:18
@sharder996 sharder996 requested a review from tobe2098 January 20, 2026 17:27
@sharder996 sharder996 disabled auto-merge January 20, 2026 17:28
@sharder996 sharder996 force-pushed the kaizen/use-sccache branch 2 times, most recently from 14516f2 to fd57384 Compare January 20, 2026 18:25
@xmkg xmkg added this pull request to the merge queue Jan 21, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2026
@tobe2098 tobe2098 added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 64d044e Jan 21, 2026
29 of 41 checks passed
@tobe2098 tobe2098 deleted the kaizen/use-sccache branch January 21, 2026 12:59
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.

4 participants