release/dotnetup uses dotnetup to Install the SDK + Daily Version Parsing Fix#54469
Conversation
…but arcade fails if it does not yet exist
…ting an issue to fix.
this can be changed in the future but for now this will ensure if theres a bug fix the CI machines get the bug fix
There was a problem hiding this comment.
Pull request overview
This PR updates the release/dotnetup toolset bootstrap flow to use dotnetup for installing the SDK early (before Arcade’s toolset initialization), and fixes channel parsing so fully-qualified prerelease SDK versions (with dotted prerelease segments) resolve correctly.
Changes:
- Install the
global.json-pinned bootstrap SDK into the repo-local.dotnetviadotnetupduring toolset configuration (with VMR/source-build and non-restore guards). - Fix
ChannelVersionResolverparsing to properly recognize fully-qualified prerelease SDK versions (e.g.,10.0.100-preview.1.32640) as “fully specified”. - Improve
get-dotnetupscripts by adding a “freshness” short-circuit (24h) with--force/-Force+DOTNETUP_FORCE_REINSTALL=1override, and remove--no-progressfrom CI toolset installs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/dotnetup.Tests/ChannelVersionResolverTests.cs | Adds coverage ensuring fully-qualified prerelease channel strings resolve to the exact version. |
| src/Installer/Microsoft.Dotnet.Installation/Internal/ChannelVersionResolver.cs | Fixes parsing so prerelease suffix dots don’t break version-part splitting; treats prerelease fully-qualified versions as fully specified. |
| scripts/get-dotnetup.sh | Adds “skip download if recent binary exists” behavior and a --force override. |
| scripts/get-dotnetup.ps1 | Adds “skip download if recent binary exists” behavior with -Force override; computes SHA-512 via .NET instead of Get-FileHash. |
| eng/restore-toolset.sh | Removes --no-progress from dotnetup runtime install invocation. |
| eng/restore-toolset.ps1 | Removes --no-progress from dotnetup runtime install invocation and seeds $LASTEXITCODE to avoid strict-mode issues when scripts short-circuit. |
| eng/configure-toolset.sh | Adds dotnetup-based bootstrap SDK installation into repo-local .dotnet during restore (with CI forcing re-download). |
| eng/configure-toolset.ps1 | Adds dotnetup-based bootstrap SDK installation into repo-local .dotnet during restore (with CI forcing re-download) and telemetry/exit-code handling. |
dont think this is relevant to my change... but seems that it made the build fail
So wouldn't the version parsing fix need to be merged separately from the script changes for things to work? Otherwise the script would be merged but not working. |
|
I don't think we should change the default for the get-dotnetup scripts. It's fine for them to allow an option to control this, and the CI restore-toolset can set that option by default, but I think the default if you download and run the scripts should be that you always get the latest version of dotnetup. |
|
Good call, I will move that logic to be part of our tooling but not part of the script. I agree it should not be part of the script. |
- get-dotnetup.ps1/sh now always download dotnetup (no freshness check). CI caching policy belongs in engineering infra, not the install script. - Remove DOTNETUP_FORCE_REINSTALL env var logic from configure-toolset. - Restructure configure-toolset to collect all SDK versions (primary + additionalDotNetVersions from global.json) and install them in a single dotnetup invocation for better perf. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
I think this PR should be failing because it should be getting the unfixed version of dotnetup and so dotnetup is failing to install the SDK. It sounds like then it's falling back to the arcade logic to install the SDK, but I think it should fail the build and abort instead. We want to use this for validation that dotnetup works, but if it's going to fail and silently fall back to the dotnet-install scripts, then we're not really getting that validation. |
I totally get where you're coming from. From my perspective we still get the validation - telemetry is visible to us (at least while the data is not being corrupted by a new data transformation service but we shouldn't expect that to happen often) and we have data on the % success of each command, as well as the error breakdowns for each command. For example, I see that this error was hit 3 times in CI and is a top contender for sdk install failures:
As soon as signing is merged, I'd like to scope this out to the SDK repo itself. There, we will be able to get this data without causing pain for people (arcade fallback will still work) if we have a bug. The same is true for when we roll out to Arcade. Once we have high adoption and high numbers, then I'd want to remove the arcade fallback. What do you think? I can see on one side that having it fail the build would make it more obvious and urgent to fix or potentially easier to spot right there in the failing build, but the failure is still visible with the arcade fallback locally. This also makes it simpler because I can apply the same patch in the release/dnup branch as |
|
I am OK either way but would still choose failing fast myself, especially in the release/dnup branch. As we move to main and other repos we might want to be more forgiving, but hopefully dotnetup is at least as reliable as the install scripts so it should be moot. |
dotnetup already checks if the sdk exists, no need to dupe that logic and the 24hr check was supposed to be present, just not within the dotnetup scripts themselves - this is great feedback. I think I will keep it locally because it makes the build of dotnetup and the .net sdk when working locally as a dev take way longer than necessary when dotnetup is not changing that often
That's totally fair, I don't think either of us feel super strongly about it. Thanks for leaving that feedback; I'll leave it as is but I can go either way too. It's easier to keep all of the scripts the same rather than have that nuance of modifying the behavior when we port it in and out. |
The first part of #54257
Modifies the setup scripts to install the SDK before arcade tooling gets a chance to do so, causing the install script invocation to be a no-op.
This fixes a bug which would cause the version parsing to not download the correct version. This PR needs to be merged for the script to actually work because the downloaded version of dotnetup at this time will not contain the bug fix.
I found --no-progress is a bogus flag now and needs to be fixed so I removed it from the CI call:
dotnetup--no-progressshows progress (and poorly formatted progress at that) #54468potentially contentious: