Skip to content

Support ILLink caching in runtime library builds - #135066

Merged
sbomer merged 2 commits into
mainfrom
sbomer/illink-runtime-cache
Oct 20, 2026
Merged

sbomer merged 2 commits into
mainfrom
sbomer/illink-runtime-cache

Conversation

@sbomer

@sbomer sbomer commented Oct 1, 2026

Copy link
Copy Markdown
Member

Make shared-framework, out-of-band, and per-library trimming invocations eligible for the experimental ILLink cache. Use existing task parameters where possible and support the narrow extra-argument forms needed for link attributes, substitutions, and assembly search directories. Fingerprint their inputs without changing assembly resolution or the precedence of custom arguments. Caching remains opt-in.

Linux x64 prototype measurements reduced warm-hit ILLink task time from 4,103 ms to 80 ms for CoreLib and from 1,036 ms to 63 ms for System.Collections. These are task-level measurements, not whole-build speedups.

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 4 pipeline(s).
12 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-runtime-cache branch from 61a24f9 to f1916c4 Compare October 2, 2026 17:27
@sbomer
sbomer force-pushed the sbomer/illink-runtime-cache branch 3 times, most recently from 883ca84 to 253c1fd Compare October 6, 2026 21:49
@sbomer
sbomer force-pushed the sbomer/illink-runtime-cache branch from 253c1fd to 896eb0b Compare October 13, 2026 21:13
Base automatically changed from sbomer/illink-task-cache to main October 14, 2026 17:01
Use structured task parameters for runtime trimming and model the narrow extra-argument shapes needed by shared-framework, out-of-band, and per-library builds. Preserve custom argument precedence.

Assisted-by: Copilot:gpt-6-astra
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
@sbomer
sbomer force-pushed the sbomer/illink-runtime-cache branch from 896eb0b to 1182903 Compare October 14, 2026 17:01
@sbomer
sbomer requested a balanced review from Copilot October 14, 2026 20:14

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.

🟡 Changes recommended

Custom arguments can override previously enforced unresolved-reference and symbol policies, changing behavior even with caching disabled.

2 open findings
What changed in this PR

Extends opt-in ILLink caching to runtime library builds by modeling their inputs and reusing existing task parameters.

Changes:

  • Supports narrow extra-argument forms and hashes XML files, assembly candidates, and sidecars.
  • Migrates library-build options to task parameters.
  • Adds cache-key tests and updates cache documentation.

Builds and tests were not run.

File Description
src/​tools/​illink/​test/​ILLink.Tasks.Tests/​ILLink.Tasks.Tests.cs Tests input invalidation and cache bypasses.
src/​tools/​illink/​src/​ILLink.Tasks/​LinkTask.cs Parses supported arguments and fingerprints inputs.
src/​libraries/​sfx-finish.proj Uses the symbol-retention task parameter.
src/​libraries/​oob-trim.proj Moves warning suppression to a task parameter.
eng/​illink.targets Makes per-library trimming eligible for caching.
docs/​tools/​illink/​illink-tasks.md Documents supported cache inputs.
docs/​design/​tools/​illink/​task-cache.md Updates fingerprinting and bypass rules.

🧠 Review effort: Balanced

Comment thread eng/illink.targets
Comment thread src/libraries/sfx-finish.proj
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
@sbomer
sbomer merged commit 47df4db into main Oct 20, 2026
159 of 161 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 20, 2026
@sbomer
sbomer deleted the sbomer/illink-runtime-cache branch October 20, 2026 16:47
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