Skip to content

5.3.0 breaks the installation of .NET previews when rollForward is present #740

@martincostello

Description

@martincostello

Description:

Consider the following global.json file:

{
  "sdk": {
    "version": "11.0.100-preview.4.26230.115",
    "allowPrerelease": false,
    "rollForward": "latestMajor",
    "paths": [
      ".dotnet",
      "$host$"
    ],
    "errorMessage": "The required version of the .NET SDK could not be found. Please run ./build.ps1 to bootstrap the .NET SDK."
  },
  "msbuild-sdks": {
    "Aspire.AppHost.Sdk": "13.3.5"
  }
}

Since updating from 5.2.0 to 5.3.0, branches using .NET 11 previews now fail to install the .NET SDK, breaking builds.

To workaround, "rollForward": "latestMajor" has to be removed.

I would expect the version specified to be installed when it is absent.

Note that despite "allowPrerelease": false being set it false, .NET always uses a preview version if explicitly asked for without needing to change that value.

Task version:

5.3.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Attempt to install the .NET SDK using the above global.json.

Expected behavior:

The 11.0.100-preview.4.26230.115 SDK is installed.

Run actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2
/home/runner/work/_actions/actions/setup-dotnet/9a946fdbd5fb07b82b2f5a4466058b876ab72bb2/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '10.0.8' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/9a946fdbd5fb07b82b2f5a4466058b876ab72bb2/externals/install-dotnet.sh --skip-non-versioned-files --version 11.0.100-preview.4.26230.115
dotnet-install: Attempting to download using primary link https://builds.dotnet.microsoft.com/dotnet/Sdk/11.0.100-preview.4.26230.115/dotnet-sdk-11.0.100-preview.4.26230.115-linux-x64.tar.gz
dotnet-install: Remote file https://builds.dotnet.microsoft.com/dotnet/Sdk/11.0.100-preview.4.26230.115/dotnet-sdk-11.0.100-preview.4.26230.115-linux-x64.tar.gz size is 193967666 bytes.
dotnet-install: Extracting archive from https://builds.dotnet.microsoft.com/dotnet/Sdk/11.0.100-preview.4.26230.115/dotnet-sdk-11.0.100-preview.4.26230.115-linux-x64.tar.gz
dotnet-install: Downloaded file size is 193967666 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 11.0.100-preview.4.26230.115
dotnet-install: Adding to current process PATH: `/usr/share/dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.

Actual behavior:

The SDK is not installed as the action detects the pre-installed SDK versions to be sufficient:

Run actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2
/home/runner/work/_actions/actions/setup-dotnet/9a946fdbd5fb07b82b2f5a4466058b876ab72bb2/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '10.0.8' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/9a946fdbd5fb07b82b2f5a4466058b876ab72bb2/externals/install-dotnet.sh --skip-non-versioned-files --channel LTS
dotnet-install: .NET Core SDK with version '10.0.300' is already installed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions