Skip to content

Purge compiler cache in CI - #135758

Closed
jjonescz wants to merge 2 commits into
dotnet:mainfrom
jjonescz:purge-cache
Closed

jjonescz wants to merge 2 commits into
dotnet:mainfrom
jjonescz:purge-cache

Conversation

@jjonescz

Copy link
Copy Markdown
Member

Without purging, the cache keeps growing and downloading it can take more time than cold builds...

Measurements from the Linux leg:

Date / log Content (MB) Download phase Full restore
Sep 19 483.4 4.1 s 10.5 s
Sep 22 1,822.1 16.1 s 22.8 s
Sep 29 4,823.4 40.1 s 51.0 s
Oct 6 5,666.5 25.7 s 57.4 s
Oct 13 7,848.5 55.2 s 63.0 s

cc @agocke

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The purge command, timing, platform handling, and failure behavior are consistent with the cache lifecycle and Roslyn tooling.

0 open findings

What changed in this PR

Purges stale Roslyn compiler-cache entries before Azure Pipelines saves the cache, preventing unbounded growth and slower restores.

Changes:

  • Adds cross-platform cache purging with non-fatal warnings.
  • Runs cache maintenance after all compilation and test-build steps.
File Description
eng/​pipelines/​runtime.yml Moves cache maintenance to the end of post-build steps.
eng/​pipelines/​coreclr/​templates/​jit-hardware-intrinsics-common.yml Purges after hardware-intrinsics test builds.
eng/​pipelines/​coreclr/​templates/​build-cache-stats.yml Adds Roslyn cache purging and diagnostics.

🧠 Review effort: Balanced

@agocke

agocke commented Oct 15, 2026

Copy link
Copy Markdown
Member

Turns out I implemented the same thing in #135820

@jjonescz jjonescz closed this Oct 19, 2026
@jjonescz
jjonescz deleted the purge-cache branch October 19, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Infrastructure-coreclr Only use for closed issues

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants