-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Auto-derive BootstrapSdkVersion from global.json so it can never lag tools.dotnet #13694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,8 +85,11 @@ try { | |
| else | ||
| { | ||
| $buildToolPath = "$bootstrapRoot\core\dotnet.exe" | ||
| $propsFile = Join-Path $PSScriptRoot "Versions.props" | ||
| $bootstrapSdkVersion = ([xml](Get-Content $propsFile)).SelectSingleNode("//PropertyGroup/BootstrapSdkVersion").InnerText | ||
| $globalJsonPath = Join-Path $PSScriptRoot "..\global.json" | ||
| $bootstrapSdkVersion = (Get-Content $globalJsonPath -Raw | ConvertFrom-Json).tools.dotnet | ||
| if ([string]::IsNullOrWhiteSpace($bootstrapSdkVersion)) { | ||
| throw "Could not read tools.dotnet from $globalJsonPath." | ||
| } | ||
|
Comment on lines
+88
to
+92
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change seems wrong. It now always uses the SDK version from global.json. It would be better to still allow to hardcode a newer version via the I would use the msbuild -getproperty function here to avoid direct XML parsing and invoke some project that imports the microsoft.net.sdk, i.e. the msbuild.bootstrap.csproj. This also applies to the bash changes. |
||
| $buildToolCommand = "$bootstrapRoot\core\sdk\$bootstrapSdkVersion\MSBuild.dll" | ||
| $buildToolFramework = "net" | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a standard property. Use
NetCoreSdkVersioninstead: https://github.com/dotnet/sdk/blob/7bfcbfa069151ac1f7b602fd4cad874f99fb2c1d/src/Layout/redist/targets/GenerateBundledVersions.targets#L654There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we are missing here is doing some kind of
Math.Min('$(NetCoreSdkVersion)', '10.0.106'))