msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Auto-derive BootstrapSdkVersion from global.json so it can never lag tools.dotnet

Open Copilot opened this issue 6 months ago • 8 comments

Fixes #13693

eng/Versions.props's hard-coded bootstrap SDK version and global.json's tools.dotnet were maintained independently and could drift. When the bootstrap SDK lags tools.dotnet, its shared runtime ends up older than the building SDK delivers, causing host-resolution failures (You must install or update .NET to run this application).

Changes

  • eng/Versions.props — Rename BootstrapSdkVersion -> BootstrapSdkVersionFloor: it is a minimum, not the literal version.
  • eng/BootStrapMsBuild.props — Derive the effective BootstrapSdkVersion = Max(BootstrapSdkVersionFloor, $(NETCoreSdkVersion)), so the bootstrap SDK can never lag global.json, while a higher floor can still pin a newer SDK.
  • eng/BootStrapMsBuild.targets — Add VerifyBootstrapRuntimeFloor: after the SDK is acquired, fail the build if none of the laid-down Microsoft.NETCore.App runtimes is at least $(BundledNETCoreAppPackageVersion) (the runtime the building SDK delivers).
  • eng/cibuild_bootstrapped_msbuild.ps1 / .sh — Resolve the version via dotnet msbuild -getProperty:BootstrapSdkVersion on MSBuild.Bootstrap.csproj instead of parsing Versions.props, so stage 2 locates sdk/<version>/MSBuild.dll using the effective value. Fail fast if it cannot be read.
  • Docs — Update documentation/release-checklist.md and .github/skills/release/SKILL.md for the rename.

Tests

src/Build.UnitTests/BootstrapRuntimeFloor_Tests.cs covers the guard: runtime equal/newer/older than the floor, multiple runtimes, prerelease-suffix handling, non-version directories, and absent/empty runtime root.

Copilot avatar May 05 '26 16:05 Copilot

Hello @Copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo.

/review

OvesN avatar Jun 19 '26 13:06 OvesN

⚠️ Security scanning failed for Expert Code Review (command). Review the logs for details.

Performance review complete for PR #13694.

github-actions[bot] avatar Jun 19 '26 13:06 github-actions[bot]

Design-level notes on PR #13694

🟡 Stale documentation — property rename not reflected

Two files still reference the old BootstrapSdkVersion property name (now BootstrapSdkVersionFloor in eng/Versions.props):

  • documentation/release-checklist.md line 232: Update BootstrapSdkVersion in eng/Versions.props if a fresh SDK was released.
  • .github/skills/release/SKILL.md line 119: table entry lists BootstrapSdkVersion in eng/Versions.props

Both references will mislead the next release engineer (the property no longer exists under that name). They also need a guidance update: under the new model the floor only needs raising when pinning a newer SDK than global.json would naturally deliver — a different trigger condition than before.

🟡 Stale PR description

The description states:

eng/cibuild_bootstrapped_msbuild.sh — Uses jq when available for proper JSON path traversal (.tools.dotnet); falls back to grep/sed.

The actual implementation uses dotnet msbuild -getProperty:BootstrapSdkVersion — no jq and no global.json read. The description appears to be from an earlier iteration of the PR and should be corrected to avoid confusion during review or future bisection.

[!WARNING]

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • dnceng.pkgs.visualstudio.com
  • pkgs.dev.azure.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "dnceng.pkgs.visualstudio.com"
    - "pkgs.dev.azure.com"

See Network Configuration for more information.

Generated by Expert Code Review (command) for issue #13694 · 2.9K AIC · ⊞ 29.8K ambient context · ◷ Comment /review to run again

github-actions[bot] avatar Jun 19 '26 14:06 github-actions[bot]

🔍 Skill Validator Results

⚠️ Warnings or advisories found

Scope Checked
Skills 1
Agents 0
Total 1
Severity Count
--- ---:
❌ Errors 0
⚠️ Warnings 2
ℹ️ Advisories 0

Summary

Level Finding
ℹ️ Found 1 skill(s)
ℹ️ [release] 📊 release: 2,904 BPE tokens [chars/4: 2,869] (standard ~), 12 sections, 0 code blocks
ℹ️ [release] ⚠ Skill is 2,904 BPE tokens (chars/4 estimate: 2,869) — approaching "comprehensive" range where gains diminish.
ℹ️ [release] ⚠ No code blocks — agents perform better with concrete snippets and commands.
ℹ️ ✅ All checks passed (1 skill(s))
Full validator output ```text Found 1 skill(s) [release] 📊 release: 2,904 BPE tokens [chars/4: 2,869] (standard ~), 12 sections, 0 code blocks [release] ⚠ Skill is 2,904 BPE tokens (chars/4 estimate: 2,869) — approaching "comprehensive" range where gains diminish. [release] ⚠ No code blocks — agents perform better with concrete snippets and commands. ✅ All checks passed (1 skill(s)) ```

github-actions[bot] avatar Jun 19 '26 14:06 github-actions[bot]

/review

OvesN avatar Jun 19 '26 14:06 OvesN

⚠️ Security scanning failed for Expert Code Review (command). Review the logs for details.

Expert-reviewer subagent launched for PR #13694 (24 dimensions, parallel sub-agent batches). The subagent will post its own inline review comments and submit a final review verdict directly to the PR once complete.

github-actions[bot] avatar Jun 19 '26 15:06 github-actions[bot]

@ViktorHofer @rainersigwald I converted this pr to ready, can you re-review it please?

OvesN avatar Jun 19 '26 16:06 OvesN

We decided to change the approach and do not auto-derive bootstrapSdkVersion and only add the clear fail message if runtime versions of bootstrapSdk is older than runtime of sdk from global.json. See https://github.com/dotnet/msbuild/pull/14221

OvesN avatar Jun 30 '26 15:06 OvesN