From cdc263621ec7c462040e6b66c9caa4a49e9585f1 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Fri, 2 Oct 2026 14:36:58 -0700 Subject: [PATCH] Seed Debug Roslyn caches in rolling builds Add rolling-only Debug CoreCLR builds for cache-enabled Unix PR legs and isolate their Roslyn cache entries from Release builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b47078d-4fe1-4db0-93fd-264f9a651be7 --- .../coreclr/templates/setup-roslyn-cache.yml | 10 ++++++---- eng/pipelines/runtime.yml | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/coreclr/templates/setup-roslyn-cache.yml b/eng/pipelines/coreclr/templates/setup-roslyn-cache.yml index dcc5e6152ec062..091e8dcbc9f8cc 100644 --- a/eng/pipelines/coreclr/templates/setup-roslyn-cache.yml +++ b/eng/pipelines/coreclr/templates/setup-roslyn-cache.yml @@ -9,16 +9,18 @@ steps: # request itself or its target branch. This lets rolling builds seed the # cache without allowing pull requests to modify caches used by main. # - # The managed configuration is intentionally excluded. Roslyn's - # deterministic key includes the compilation options, and some pipeline - # legs override the matrix configuration in their build arguments. + # Keep Debug and Release entries separate so rolling builds can seed both + # configurations without competing for the same immutable cache key. + # Roslyn's own deterministic key accounts for legs that override the + # matrix configuration in their build arguments. - task: Cache@2 displayName: Roslyn compiler cache continueOnError: true inputs: - key: roslyn | v1 | ${{ parameters.osGroup }}${{ parameters.osSubgroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | "$(Build.BuildId)" + key: roslyn | v2 | ${{ parameters.osGroup }}${{ parameters.osSubgroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | "$(buildConfigUpper)" | "$(Build.BuildId)" path: $(Pipeline.Workspace)/.roslyn-cache restoreKeys: | + roslyn | v2 | ${{ parameters.osGroup }}${{ parameters.osSubgroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | "$(buildConfigUpper)" roslyn | v1 | ${{ parameters.osGroup }}${{ parameters.osSubgroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} - script: | diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 9fabe16d48fd80..1dd60140236382 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -351,6 +351,25 @@ extends: eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(variables['isRollingBuild'], true)) + # Seed the Debug compiler cache used by the CoreCLR_AllSubsets PR builds. + - ${{ if eq(variables.isRollingBuild, true) }}: + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: debug + platforms: + - linux_x64 + - linux_musl_x64 + - osx_arm64 + jobParameters: + nameSuffix: CoreCLR_AllSubsets + buildArgs: -s clr+libs+libs.tests+host+packs -rc Release -c $(_BuildConfig) /p:ArchiveTests=true + timeoutInMinutes: 180 + preBuildSteps: + - template: /eng/pipelines/coreclr/templates/setup-sccache.yml + postBuildSteps: + - template: /eng/pipelines/coreclr/templates/sccache-stats.yml + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml