Enable sccache for arm64 and FreeBSD cross-builds#128065
Open
agocke wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the CoreCLR pipeline sccache templates to enable sccache (and its pipeline cache) for additional cross-build scenarios and to avoid cache collisions between libc variants by incorporating osSubgroup into the cache key.
Changes:
- Broaden the sccache enablement condition to include
linux+freebsdandx64+arm64. - Update the Azure Pipelines Cache key / restore key to include
osSubgroup(viaosGroup + osSubgroup) so variants like_muslget distinct entries. - Keep the stats step gated by the same condition as setup to avoid invoking
sccachewhen it isn’t configured.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/pipelines/coreclr/templates/setup-sccache.yml | Expands the sccache setup/caching condition and adds osSubgroup to the cache key. |
| eng/pipelines/coreclr/templates/sccache-stats.yml | Mirrors the updated condition so stats are only shown when sccache is expected to be enabled. |
Widen the sccache condition to cover arm64 (cross-compiled on x64 machines) and FreeBSD in addition to linux-x64. Also include osSubgroup in the cache key so musl builds get a separate cache entry when that change lands. All these targets use the same x64 sccache binary since the builds are cross-compiled in ADO. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 3.5 GiB limit was causing sccache to evict useful entries, dropping the hit rate from ~97% to ~89%. The full working set is around 7-8 GiB. Bumping to 5 GiB should recover most of the hit rate. With continueOnError on the Cache task (dotnet#128052), any disk space issues during upload will no longer fail the build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
68ec04a to
2f6b803
Compare
Add setup-sccache.yml and sccache-stats.yml to build legs that were missing them: - AllSubsets_CoreCLR_ReleaseRuntimeLibs (linux_musl_arm, linux_musl_arm64) - AllSubsets_CoreCLR (linux_arm64, linux_musl_x64) - Libraries_CheckedCoreCLR (linux_arm64) - CoreCLR_ReleaseLibraries (linux_x64, linux_musl_arm, linux_musl_arm64) - CoreCLR_Bootstrapped (freebsd_x64) The sccache condition filters to linux/freebsd x64/arm64 only, so arm32 legs will be a no-op. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add setup-sccache.yml and sccache-stats.yml to both the CoreCLR and NativeAOT job groups in jit-hardware-intrinsics-common.yml. Covers linux_x64 and linux_arm64 legs; arm32 is filtered out by the sccache condition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The global-build.yml Musl_Validation leg builds clr.native+libs.native+ host.native on linux_musl_x64 and benefits from sccache caching. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced May 12, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was created with Copilot assistance.
Widens the sccache caching condition to cover:
The cache key already includes
archTypeand now includesosSubgroup, so all variants get separate cache entries.