Skip to content

Use dotnetup to install preview SDK and runtime in build scripts #52699

@nagilson

Description

@nagilson

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 need dotnetup already built
  • The install script may not support preview SDK installation in all scenarios

Proposed Solution

  1. Download a pre-built dotnetup executable from a known location (e.g., GitHub releases, Azure blob storage, or a .NET CDN) instead of building it during the build process.

  2. Use dotnetup to install:

  3. Remove the EnsureDotnetupBuilt function from restore-toolset.ps1 and restore-toolset.sh and replace with an acquisition step.

Changes Required

eng/restore-toolset.ps1

  • Replace EnsureDotnetupBuilt with EnsureDotnetupDownloaded
  • Download pre-signed dotnetup.exe from official source
  • Verify checksum/signature for security
  • Add preview SDK/runtime installation calls

eng/restore-toolset.sh

  • Replace EnsureDotnetupBuilt with EnsureDotnetupDownloaded
  • Download pre-signed dotnetup binary for the appropriate RID
  • Verify checksum/signature for security
  • Add preview SDK/runtime installation calls

Related Issues

We need #51091 and #51092 to be complete as well and even the acquisition of dotnetup itself.

Acceptance Criteria

  • dotnetup is 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 dotnetup download fails

Notes

This is a follow-up to PR #52695 which established the pattern of using dotnetup for runtime installation during the SDK build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-InfrastructureCost:SLess than 4 person weeks of work per central guidancedotnetupWork items around the proposed `dotnetup` bootstrapper/toolchain management tool and library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions