Conversation
Move the incremental semaphore outside the output directory, let the task prepare a clean output directory, and give per-library trimming a dedicated output directory. Assisted-by: Copilot:gpt-6-astra Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
|
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
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
sbomer
added this pull request to stack #135070
October 1, 2026 22:43
This was referenced Oct 2, 2026
Open
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
ExtraArgs can redirect output after the task cleans a different directory, defeating the ownership guarantee.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Makes ILLink task output ownership explicit by clearing dedicated output directories before execution.
Changes:
- Cleans and recreates task output directories with failure handling and tests.
- Moves incremental semaphores and per-library trim outputs outside task-owned directories.
- Documents the new ownership contract.
One blocking issue remains: ExtraArgs can override -out, causing ILLink to write to an uncleared directory.
| File | Description |
|---|---|
LinkTask.cs |
Adds output-directory cleanup. |
Microsoft.NET.ILLink.targets |
Moves and invalidates the link semaphore. |
eng/illink.targets |
Introduces dedicated per-library output staging. |
ILLink.Tasks.Tests.cs |
Tests cleanup, failures, and repeated execution. |
Mock.cs |
Captures task errors for assertions. |
illink-tasks.md |
Documents output ownership behavior. |
Member
|
Does iltrim need the same change? |
…opt-out Keep OutputDirectory authoritative over extra arguments when cleanup is enabled. Add an undocumented ClearOutputDirectory escape hatch that preserves legacy cleanup and argument precedence behavior. Assisted-by: GitHub Copilot CLI:gpt-6-astra Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 561d1c87-e14b-46f8-be7f-a08f544ec537
Member
Author
|
I don't think we have an ILTrim task yet, but once we do it should inherit this behavior. |
jtschuster
reviewed
Oct 2, 2026
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.

Make the ILLink task clear its output directory before execution instead of having the SDK targets delete only selected outputs. This prevents stale files from surviving a link and establishes the output ownership needed for whole-invocation caching.
Move the incremental-build semaphore outside that directory and give per-library trimming a dedicated output directory. Callers must keep inputs and unrelated intermediate files outside the task-owned directory; direct command-line linker behavior is unchanged.