Repository navigation
Conversation
Map declared source roots into structured cache identity and use relative execution arguments for eligible single-root invocations. Retain full content hashing, conservative symbol and resolution checks, and original execution for uncached requests. Assisted-by: Copilot:gpt-6.1-sol Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cf203c67-3550-4744-a063-3f1230546d53
|
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. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Untracked assembly-resolution paths and Windows drive-root rewriting can produce unsound cache keys.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds root-relative ILLink cache identities so equivalent worktrees can share eligible cached outputs.
Changes:
- Maps source-root paths into stable cache keys and relative invocations.
- Expands cache eligibility checks and input hashing.
- Adds target wiring, documentation, and extensive tests.
| File | Description |
|---|---|
LinkTask.cs |
Implements path mapping and cache validation. |
Microsoft.NET.ILLink.targets |
Forwards SDK source roots. |
Mock.cs |
Captures cache invocation details. |
ILLink.Tasks.Tests.cs |
Tests sharing, eligibility, and fallback behavior. |
eng/illink.targets |
Defines the runtime repository source root. |
sfx-finish.proj |
Forwards source roots for framework trimming. |
oob-trim.proj |
Forwards source roots for OOB trimming. |
illink-tasks.md |
Documents task behavior and configuration. |
task-cache.md |
Updates cache design decisions. |
Comment on lines
+458
to
+459
| foreach (var argument in extraPaths) | ||
| cacheableExtraArgs.Append(argument.Option).Append(' ').AppendLine(Quote(renderPath(argument.Path))); |
Comment on lines
+561
to
+567
| foreach (AssemblyReferenceHandle reference in metadata.AssemblyReferences) | ||
| { | ||
| if (HasPathSyntax(metadata.GetString(metadata.GetAssemblyReference(reference).Name))) | ||
| { | ||
| Log.LogMessage(MessageImportance.Low, "ILLink cache bypassed: Path-shaped assembly references can resolve outside the input inventory."); | ||
| return false; | ||
| } |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
This was referenced Oct 7, 2026
Open
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Allow eligible ILLink task cache entries to be shared across worktrees with equivalent layouts. Map declared source roots into stable cache identities while retaining full content hashing, and run single-root invocations from that root with structured relative arguments rather than rewriting raw command strings.
Caching remains opt-in, with compiler and symbol-preservation defaults unchanged. Unsupported inputs run uncached with their original arguments and working directory. Runtime's existing raw arguments still bypass caching on this base; structured runtime integration is separate. Validated with 281 task tests, both task build targets, and a two-worktree hit matching independently linked DLL/PDB bytes; Windows execution and full runtime builds were not run.
Note
This pull request description was created with assistance from GitHub Copilot.