Repository navigation
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Missing regression coverage for nonzero telemetry reference counts after an actual project-based run with SDK-path defaults removed and an explicit extensions-path override leaves swallowed evaluation failures undetected.
1 open issue
What changed in this PR
This PR lets MSBuild discover SDK locations from its selected toolset, preventing CLI-generated defaults from interfering with nested invocations that select another SDK. Explicit overrides and DOTNET_HOST_PATH remain preserved.
Changes:
- Remove SDK-path environment defaults and the extensions-path global default used by run/MTP evaluation and run telemetry.
- Add or update coverage for nested SDK selection, worker nodes, direct evaluation, overrides, run, MTP, and Native AOT forwarding.
- Document discovery behavior, inherited-override limitations, and test-environment requirements.
| File | Description |
|---|---|
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Sdks/Discovery.Sdk/Sdk/Sdk.targets |
Supplies minimal custom SDK targets. |
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Sdks/Discovery.Sdk/Sdk/Sdk.props |
Records the resolved custom SDK path. |
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Program.cs |
Adds a file-based run fixture. |
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Probe.proj |
Probes toolset paths, nested invocations, and worker execution. |
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Override.proj |
Exercises explicit SDK and extensions overrides. |
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Extensions/Discovery.props |
Records the resolved extensions path. |
test/TestAssets/TestProjects/MSBuildSdkDiscovery/Directory.Build.targets |
Detects SDK-path environment leakage during build and run evaluation. |
test/Microsoft.NET.TestFramework/SdkTestContext.cs |
Removes initialization of the deleted extensions-path test hook. |
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestProducesBinaryLog.cs |
Runs MTP coverage without harness-supplied SDK paths. |
test/dotnet.Tests/CommandTests/Run/RunCommandTests.cs |
Checks property preservation and clean-environment run evaluation. |
test/dotnet.Tests/CommandTests/MSBuild/GivenMSBuildSdkDiscovery.cs |
Adds discovery and override regression scenarios. |
test/dotnet.Tests/CommandTests/MSBuild/GivenMsbuildForwardingApp.cs |
Verifies forwarding preserves overrides without generating defaults. |
test/dotnet-aot.Tests/MSBuildEvaluationTests.cs |
Updates Native AOT forwarding expectations. |
src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs |
Stops supplying SDK-path environment defaults. |
src/Cli/dotnet/Commands/Run/RunCommand.cs |
Removes the extensions-path default from telemetry evaluation. |
src/Cli/dotnet/Commands/Run/CommonRunHelpers.cs |
Preserves caller properties without adding an extensions-path default. |
src/Cli/dotnet-aot/SdkRootResolution.md |
Documents forwarding behavior and corrects the component name. |
documentation/project-docs/developer-guide.md |
Documents the discovery contract and test isolation requirements. |
Review effort: Balanced
Evangelink
left a comment
There was a problem hiding this comment.
Note
This review was AI-generated.
Two additional test issues are noted inline. The project-based telemetry evaluation coverage gap is already reported in an existing Copilot review comment and is not duplicated here.
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="FSharp.Core" Version="4.1.*" /> | ||
| <PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" /> |
There was a problem hiding this comment.
Is this snapshot change expected?
There was a problem hiding this comment.
I checked the branch flow. The equivalent fix merged into release/11.0.1xx in #57175, but it has not reached release/11.0.2xx yet. The open 1xx → 2xx merge PR #56929 predates the fix and still has the old snapshot; the current 2xx VMR backflow PR #57132 also lacks it. Once the 1xx → 2xx flow is updated and merged, I expect a rebase to make this snapshot diff unnecessary. For now, this PR keeps the snapshot update so its CI passes.
da3ea7e to
6b13edb
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep alternate SDK files at a distinct physical path, normalize macOS temp paths, and refresh the F# sample approval. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
6b13edb to
6139072
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Summary
MSBuildExtensionsPathandMSBuildSDKsPathenvironment variables. Preserve explicit overrides andDOTNET_HOST_PATH.MSBuildExtensionsPathglobal-property defaults used by run/MTP evaluation and run telemetry.An older parent CLI can still pass stale SDK-path values to a newer child. The child preserves them because it cannot distinguish them from intentional overrides.
Validation
Closes dotnet/msbuild#14701
Relates to #55772.