Skip to content

Skip VS preview SDK setup when using dotnet MSBuild - #10704

Merged
akoeplinger merged 1 commit into
dotnet:mainfrom
akoeplinger:copilot/skip-vs-preview-sdk-setup
Nov 4, 2026
Merged

akoeplinger merged 1 commit into
dotnet:mainfrom
akoeplinger:copilot/skip-vs-preview-sdk-setup

Conversation

@akoeplinger

Copy link
Copy Markdown
Member

Skip EnablePreviewSdks in the F# and Roslyn build scripts when the selected MSBuild engine is dotnet. Preserve the existing behavior for Visual Studio builds and the standalone Roslyn preview-SDK setup script.

Both scripts currently write Visual Studio’s shared sdk.txt even when building with dotnet MSBuild. These unnecessary writes can race with concurrent repo builds. In build 1662411, Roslyn failed with a sharing violation during Set-Content despite being passed -msbuildEngine dotnet. Related context: dotnet/fsharp#18432.

Validated the actual helper bodies with mocked VS discovery and file writes: all 14 cases pass, including dotnet, VS, unspecified-engine, missing-VS, and cached-MSBuild scenarios. Both original helpers fail the dotnet regression check. Windows execution remains for CI.

Avoid unnecessary writes to Visual Studio sdk.txt from the F# and Roslyn build scripts when the selected engine is dotnet. Preserve existing behavior for Visual Studio builds and standalone preview SDK setup.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 94493bfb-271a-49e3-b741-92f0337d8f59
Copilot AI balanced review requested due to automatic review settings November 4, 2026 12:00
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team November 4, 2026 12:00
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change that skips preview-SDK setup when using dotnet MSBuild.

No open issues 🎉

What changed in this PR

Skips Visual Studio preview-SDK setup when F# and Roslyn use dotnet MSBuild, avoiding unnecessary writes to the shared sdk.txt file that can race with concurrent builds.

Changes:

  • Adds a dotnet-engine early return to both EnablePreviewSdks helpers.
  • Preserves Visual Studio behavior, F#’s cached-MSBuild guard, and standalone Roslyn preview-SDK setup.
File Description
src/​roslyn/​eng/​build-utils.ps1 Returns before Visual Studio discovery when using dotnet MSBuild.
src/​fsharp/​eng/​Build.ps1 Extends the existing early-return guard to cover dotnet MSBuild.

Review effort: Balanced

@akoeplinger
akoeplinger enabled auto-merge (squash) November 4, 2026 12:08
@akoeplinger
akoeplinger merged commit b625658 into dotnet:main Nov 4, 2026
11 checks passed
akoeplinger added a commit that referenced this pull request Nov 4, 2026
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 94493bfb-271a-49e3-b741-92f0337d8f59
(cherry picked from commit b625658)
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.

3 participants