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