Skip to content

Restore Arcade's Build.proj and remove Tools.proj - #7491

Draft
ViktorHofer wants to merge 1 commit into
mainfrom
RestoreToolsetBuildProj
Draft

ViktorHofer wants to merge 1 commit into
mainfrom
RestoreToolsetBuildProj

Conversation

@ViktorHofer

@ViktorHofer ViktorHofer commented Jun 30, 2026

Copy link
Copy Markdown
Member

Pass the /restore flag to the msbuild process invocation so that the toolset Build.proj gets restored. With that, the separate Tools.proj restore invocation isn't necessary and with that, the toolset restore happens immediately.

Blocked on dotnet/msbuild#14223 - until the change is consumed in an SDK re-boostrap and until VS images are updated and include the change. I opened this PR now to link to it from the msbuild change and to save the changes somewhere.

Pass the /restore flag to the msbuild process invocation so that the toolset
Build.proj gets restored. With that, the separate Tools.proj restore invocation
isn't necessary and with that, the toolset restore happens immediately.
@dotnet-policy-service
dotnet-policy-service Bot requested review from a team June 30, 2026 16:32
ViktorHofer added a commit to dotnet/msbuild that referenced this pull request Jun 30, 2026
…metaproject MSB4057 in parallel builds (#14223)

Unblocks dotnet/dotnet#7491

### Summary

Fixes a bug where building a solution that requests a non-default target
(e.g. `Pack`) fails with `MSB4057: The target "Pack" does not exist in
the project` in **parallel / multithreaded** builds, while the same
build succeeds serially.

This was observed building the `dotnet/dotnet` VMR (Arcade builds the
solution in two phases with different `__BuildPhase` global properties;
the `SolutionBuild` phase requests `Build;Pack`).

### Root cause

`BuildRequestConfiguration.RequestedTargets` was a get-only
auto-property that was **never serialized** in `Translate`. In
parallel/MT builds the configuration is round-tripped through
translation (even when the work appears to run in-proc on node 1), so
the deserialized configuration reset `RequestedTargets` to an empty
collection.

`SolutionProjectGenerator` only emits user-requested targets (such as
`Pack`) into the generated `.slnx.metaproj` when they are present in
`config.RequestedTargets`. With an empty set, `Pack` was omitted from
the metaproject and the build failed with `MSB4057`. Serial builds never
serialized the configuration, so they were unaffected.

### Fix

Back `RequestedTargets` with a `List<string>` field and translate it in
`BuildRequestConfiguration.Translate`.

### Validation

Reproduced end-to-end against the `dotnet/dotnet` VMR (`symreader`). A/B
with patched MSBuild deployed into the VMR SDK:

| Serialization | targets reaching `SolutionBuild` generation | Result |
| --- | --- | --- |
| disabled (before) | `[]` | metaproject lacks `Pack` -> **MSB4057** |
| enabled (this fix) | `[Build;Pack]` | metaproject contains `Pack` ->
**build succeeds** |

Added regression test `TestTranslationPreservesRequestedTargets`; full
`*TestTranslation*` suite passes (56/56, net10.0 + net472).

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant