Skip to content

Enable sccache for linux-musl-x64 coreclr builds#128050

Merged
agocke merged 1 commit into
dotnet:mainfrom
agocke:sccache-musl
May 12, 2026
Merged

Enable sccache for linux-musl-x64 coreclr builds#128050
agocke merged 1 commit into
dotnet:mainfrom
agocke:sccache-musl

Conversation

@agocke
Copy link
Copy Markdown
Member

@agocke agocke commented May 11, 2026

Note

This PR was generated with the assistance of GitHub Copilot.

Summary

Extends sccache caching from linux-x64 to also cover linux-musl-x64 coreclr build legs. Based on the linux-x64 results (~9 min/leg gross savings, 97.59% hit rate at steady state), this should provide similar speedups for the musl legs.

Changes

  • setup-sccache.yml: Widen condition to include osSubgroup == '_musl'; add osSubgroup to cache key to keep musl/glibc caches separate
  • sccache-stats.yml: Widen condition to match

Why this works

  • The sccache NuGet package (v0.15.0) is a statically-linked binary — verified with file showing static-pie linked. Works on both glibc and musl.
  • The sccache package is already downloaded by runtime-prereqs.proj on all Linux CI builds (line 13-14, condition: IsOsPlatform(Linux)).
  • Cache keys include osSubgroup so musl builds get sccache|linux_musl|x64|... vs sccache|linux|x64|... for glibc — no cross-contamination.
  • For non-musl builds, osSubgroup is empty, so the key is unchanged — existing caches remain valid.

Also included

SCCACHE_CACHE_SIZE=3.5G limit (from #128048) to prevent unbounded cache growth.

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 CI pipeline templates so sccache is enabled not only for linux-x64 (glibc) but also for linux-musl-x64, while keeping cache keys isolated between musl and glibc builds.

Changes:

  • Expand the sccache enablement condition to include osSubgroup == '_musl' (still Linux + x64 only).
  • Add osSubgroup into the Azure Pipelines Cache key segment (linux vs linux_musl) so caches don’t cross-contaminate.
  • Emit SCCACHE_CACHE_SIZE=3.5G as a pipeline variable in the sccache setup step.

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 Enables sccache for linux x64 glibc and musl, and separates cache keys by ${osGroup}${osSubgroup}; sets SCCACHE cache size.
eng/pipelines/coreclr/templates/sccache-stats.yml Matches the expanded enablement condition so stats are collected for linux x64 glibc and musl legs.

Widen the sccache condition from osSubgroup=='' to also include
osSubgroup=='_musl'. The sccache NuGet package (0.15.0) is a
statically-linked binary that works on both glibc and musl.

The cache key now includes osSubgroup to keep musl and glibc caches
separate (different system headers/compiler flags produce different
object files). For non-musl builds, osSubgroup is empty so the key
is unchanged — existing caches remain valid.

Also includes the SCCACHE_CACHE_SIZE=3.5G limit from PR dotnet#128048 to
prevent unbounded cache growth.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@agocke
Copy link
Copy Markdown
Member Author

agocke commented May 12, 2026

/ba-g timeouts in unrelated legs

@agocke agocke merged commit 7bb0446 into dotnet:main May 12, 2026
111 of 122 checks passed
@agocke agocke deleted the sccache-musl branch May 12, 2026 07:22
@github-project-automation github-project-automation Bot moved this to Done in AppModel May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants