Skip to content

Enable sccache for arm64 and FreeBSD cross-builds#128065

Open
agocke wants to merge 5 commits into
dotnet:mainfrom
agocke:sccache-arm64-freebsd
Open

Enable sccache for arm64 and FreeBSD cross-builds#128065
agocke wants to merge 5 commits into
dotnet:mainfrom
agocke:sccache-arm64-freebsd

Conversation

@agocke
Copy link
Copy Markdown
Member

@agocke agocke commented May 12, 2026

Note

This PR was created with Copilot assistance.

Widens the sccache caching condition to cover:

The cache key already includes archType and now includes osSubgroup, so all variants get separate cache entries.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + freebsd and x64 + arm64.
  • Update the Azure Pipelines Cache key / restore key to include osSubgroup (via osGroup + osSubgroup) so variants like _musl get distinct entries.
  • Keep the stats step gated by the same condition as setup to avoid invoking sccache when 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.

agocke and others added 2 commits May 12, 2026 18:41
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>
@agocke agocke force-pushed the sccache-arm64-freebsd branch from 68ec04a to 2f6b803 Compare May 12, 2026 18:42
Copilot AI review requested due to automatic review settings May 12, 2026 18:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread eng/pipelines/coreclr/templates/setup-sccache.yml
Comment thread eng/pipelines/coreclr/templates/setup-sccache.yml
agocke and others added 2 commits May 12, 2026 18:48
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>
Copilot AI review requested due to automatic review settings May 12, 2026 18:49
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread eng/pipelines/coreclr/templates/setup-sccache.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants