Repository navigation
fix(build): restore the tools once per build instead of once per project - #45
Open
xperiandri wants to merge 1 commit into
Open
xperiandri wants to merge 1 commit into
xperiandri wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The MSBuild delegation correctly serializes identical restoration requests without changing normal restore behavior.
0 open findings
What changed in this PR
This PR prevents concurrent local-tool restores by coordinating them through a single MSBuild project instance.
Changes:
- Delegates tool restoration to the incremental
ToolRestoreOncetarget. - Removes redundant tool restoration from Copilot setup.
- Documents the intentional second Fantomas pass.
| File | Description |
|---|---|
Directory.Build.targets |
Coordinates tool restoration and documents formatting behavior. |
.github/workflows/copilot-setup-steps.yml |
Relies on solution restore to restore local tools. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`ToolRestore` runs in every project before its restore, and a solution restores its projects in parallel, so several projects can run `dotnet tool restore` at the same time and touch the same marker file. Whether they overlap depends on timing: with this solution they did not in local runs. Every project now delegates to one instance of `Directory.Build.targets`, which MSBuild builds once per build, so the tools are restored once and the projects that ask at the same time wait for that run. The Copilot setup no longer restores the tools on its own before restoring the solution. `Format` says why it runs Fantomas twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xperiandri
force-pushed
the
fix/tool-restore-once
branch
from
October 11, 2026 15:07
31979d2 to
1f5230f
Compare
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.
Proposed Changes
ToolRestoreruns in every project before its restore, and a solution restores its projects in parallel, so several projects can rundotnet tool restoreat the same time and touch the same marker file. Every project now delegates to one instance ofDirectory.Build.targets, which MSBuild builds once per build, so the tools are restored once and the projects that ask at the same time wait for that run. TheRestore dependenciesstep of the Copilot setup no longer runsdotnet tool restoreon its own before restoring the solution.Formatgets a comment that says why it runs Fantomas twice.Types of changes
What types of changes does your code introduce to FSharp.Control.R3?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.build.cmdwithCI=trueandENABLE_COVERAGE=true; a solution restore without the marker file restores the tools once, and a repeated one does not restore themDirectory.Build.targetsFurther comments
No failure was observed in this repository: in five local solution restores without the marker file the tools were restored once each time, before and after the change. Whether the projects overlap depends on timing, so the change removes the possibility rather than a reproduced failure.
🤖 Generated with Claude Code