-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Summary
Extend the SDK build scripts to use dotnetup for installing preview SDKs and preview runtimes, in release/dnup until signing is complete, rather than just stable runtime versions. This requires downloading a pre-built dotnetup executable instead of building it during the build process.
Background
PR #52695 introduced using dotnetup to download core .NET runtimes (6.0, 7.0, 8.0, 9.0) during the SDK build process. However, the current approach builds dotnetup from source using the SDK that was just installed via the install script.
This approach has a bootstrapping problem for preview SDK scenarios:
- To build
dotnetup, we need an SDK - To install a preview SDK via
dotnetup, we needdotnetupalready built - The install script may not support preview SDK installation in all scenarios
Proposed Solution
-
Download a pre-built
dotnetupexecutable from a known location (e.g., GitHub releases, Azure blob storage, or a .NET CDN) instead of building it during the build process. -
Use
dotnetupto install:- Preview SDK versions (e.g.,
dotnetup sdk install preview) - Preview runtime versions
- Stable runtime versions (already implemented in .NET SDK
release/dnupbranchbuildusesdotnetupto download core .NET runtimes #52695)
- Preview SDK versions (e.g.,
-
Remove the
EnsureDotnetupBuiltfunction fromrestore-toolset.ps1andrestore-toolset.shand replace with an acquisition step.
Changes Required
eng/restore-toolset.ps1
- Replace
EnsureDotnetupBuiltwithEnsureDotnetupDownloaded - Download pre-signed
dotnetup.exefrom official source - Verify checksum/signature for security
- Add preview SDK/runtime installation calls
eng/restore-toolset.sh
- Replace
EnsureDotnetupBuiltwithEnsureDotnetupDownloaded - Download pre-signed
dotnetupbinary for the appropriate RID - Verify checksum/signature for security
- Add preview SDK/runtime installation calls
Related Issues
dotnetup install sdk previewfails when no preview version is available for latest #52675 -dotnetup install sdk previewfails when no preview version is available for latest
We need to enable installing daily /nightly builds in a separate PR. Install Nightly SDK Builds with DNUP #51097
We need #51091 and #51092 to be complete as well and even the acquisition of dotnetup itself.
Acceptance Criteria
-
dotnetupis downloaded (not built) during the build process - Build scripts work on Windows x64, Windows ARM64, Linux x64, Linux ARM64, macOS x64, macOS ARM64
- Security: Downloaded binary is verified (checksum or signature)
- Falls back gracefully if
dotnetupdownload fails
Notes
This is a follow-up to PR #52695 which established the pattern of using dotnetup for runtime installation during the SDK build.