Skip to content

Enable ILLink caching and post-build purging in CI - #135067

Merged
sbomer merged 16 commits into
mainfrom
sbomer/illink-ci-cache
Oct 20, 2026
Merged

sbomer merged 16 commits into
mainfrom
sbomer/illink-ci-cache

Conversation

@sbomer

@sbomer sbomer commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Enable experimental ILLink task caching in the Linux x64, Windows x64, and macOS arm64 CoreLib/libraries jobs. Restore a job-private cache from Azure Pipelines, with snapshots separated by platform and configuration. After all build and post-build steps finish, purge entries unused by the current build before saving the next snapshot.

In CI build 1642482, linker cache hits were 254/255 on Linux and macOS (99.6%) and 252/255 on Windows (98.8%). Restore, reuse, purge, and snapshot saving succeeded on all three platforms.

This content was created with assistance from AI.

@dotnet-policy-service dotnet-policy-service Bot added the linkable-framework Issues associated with delivering a linker friendly framework label Oct 1, 2026
@github-actions github-actions Bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Oct 1, 2026
@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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.

@sbomer
sbomer added this pull request to stack #135070 October 1, 2026 22:43
@sbomer
sbomer force-pushed the sbomer/illink-ci-cache branch from 031091b to 486774e Compare October 2, 2026 17:27
@sbomer
sbomer force-pushed the sbomer/illink-ci-cache branch from 486774e to 22842f2 Compare October 5, 2026 20:07
sbomer and others added 4 commits October 5, 2026 14:35
Cache eligible whole-task invocations with environment-only opt-in and explicit timestamp-based purging. Bypass caching for extra arguments; runtime-specific argument support is deferred to the next layer.

Assisted-by: Copilot:gpt-6-astra
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Assisted-by: Copilot:gpt-6-astra
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Assisted-by: Copilot:gpt-6-astra
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Replace the write-to-temp + File.Replace + retry approach with a plain
overwrite. File.Replace's ReplaceFile API isn't meant for concurrent
writers to the same destination, which caused a transient Windows CI
failure. A plain File.WriteAllText is safe here: FileShare.Read makes
the OS serialize conflicting writers, so a losing writer's open fails
before touching the file. The marker is advisory bookkeeping, and
CachePurge.cs already tolerates malformed content per entry.

Assisted-by: Claude:claude-sonnet-5 (GitHub Copilot CLI)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Keep purge usable if a best-effort last-used refresh leaves an invalid marker. Report the fallback while preserving errors for actual maintenance failures.

Assisted-by: GitHub Copilot CLI:gpt-6-sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
@sbomer
sbomer force-pushed the sbomer/illink-ci-cache branch from a59ddf6 to 948a922 Compare October 6, 2026 21:49
Update the lower stack layer before propagating main to the dependent CI cache PR.

Assisted-by: Copilot:gpt-6.1-sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Preserve both Roslyn and ILLink final-job purge hooks after updating the stack bottom-up from main.

Assisted-by: Copilot:gpt-6.1-sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Comment thread eng/pipelines/common/global-build-job.yml Outdated
Comment thread eng/pipelines/coreclr/templates/purge-illink-cache.yml
sbomer and others added 2 commits October 20, 2026 10:08
Assisted-by: Copilot:gpt-6.1-sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Assisted-by: Copilot:gpt-6.1-sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Comment thread eng/pipelines/global-build.yml

@agocke agocke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@sbomer

sbomer commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

/ba-g "Unrelated failures: #136096"

@sbomer
sbomer merged commit 14c6c99 into main Oct 20, 2026
181 of 191 checks passed
@sbomer
sbomer deleted the sbomer/illink-ci-cache branch October 20, 2026 23:36
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants