Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SDK versions already on the VM are installed a second time and pre-installed SDKs become unavailableΒ #284

@xt0rted

Description

@xt0rted

Description:

Calling this action with an SDK version pre-installed on the VM causes it to be installed a second time and the pre-installed SDKs become unavailable.

Task version: v2

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Call actions/setup-dotnet with a list of sdks that are pre-installed:

- name: Set up .NET
  uses: actions/[email protected]
  with:
    dotnet-version: |
      3.1.417
      5.0.406
      6.0.201

Expected behavior:

  1. For any SDK version installed by this action to be skipped if it's already installed on the VM.
  2. All pre-installed SDKs to be available after calling this action.

Actual behavior:

On macos-latest the v3 and v5 SDKs are skipped because they're already installed while v6 is downloaded and installed. Calling this a second time shows all 3 SDKs being skipped. After calling this action the pre-installed and newly installed SDKs are shown with dotnet --info.

On ubuntu-latest and windows-latest all 3 SDKs are downloaded and installed even though they're pre-installed. Calling this a second time shows all 3 SDKs being skipped. After calling this action only the newly installed SDKs are shown with dotnet --info, any pre-installed SDK becomes unavailable.

This is being caused by the installation location of the SDKs on Ubuntu and Windows differing from the pre-installed location, while on macOS it's the same location.

Two test runs can be seen here:

Calling dotnet --info gives the following results (see the above build logs for more info):

macOS out of the box

.NET SDKs installed:
  3.1.101 [/Users/runner/.dotnet/sdk]
  3.1.201 [/Users/runner/.dotnet/sdk]
  3.1.302 [/Users/runner/.dotnet/sdk]
  3.1.417 [/Users/runner/.dotnet/sdk]
  5.0.102 [/Users/runner/.dotnet/sdk]
  5.0.202 [/Users/runner/.dotnet/sdk]
  5.0.302 [/Users/runner/.dotnet/sdk]
  5.0.406 [/Users/runner/.dotnet/sdk]

macOS after calling actions/setup-dotnet

.NET SDKs installed:
  3.1.101 [/Users/runner/.dotnet/sdk]
  3.1.201 [/Users/runner/.dotnet/sdk]
  3.1.302 [/Users/runner/.dotnet/sdk]
  3.1.417 [/Users/runner/.dotnet/sdk] <- skipped
  5.0.102 [/Users/runner/.dotnet/sdk]
  5.0.202 [/Users/runner/.dotnet/sdk]
  5.0.302 [/Users/runner/.dotnet/sdk]
  5.0.406 [/Users/runner/.dotnet/sdk] <- skipped
  6.0.201 [/Users/runner/.dotnet/sdk] <- installed

Windows out of the box (similar for Ubuntu)

.NET SDKs installed:
  3.1.120 [C:\Program Files\dotnet\sdk]
  3.1.202 [C:\Program Files\dotnet\sdk]
  3.1.302 [C:\Program Files\dotnet\sdk]
  3.1.417 [C:\Program Files\dotnet\sdk]
  5.0.104 [C:\Program Files\dotnet\sdk]
  5.0.212 [C:\Program Files\dotnet\sdk]
  5.0.303 [C:\Program Files\dotnet\sdk]
  5.0.406 [C:\Program Files\dotnet\sdk]
  6.0.201 [C:\Program Files\dotnet\sdk]

Windows after calling actions/setup-dotnet (similar for Ubuntu)

.NET SDKs installed:
  3.1.417 [C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk] <- installed
  5.0.406 [C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk] <- installed
  6.0.201 [C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk] <- installed

Where's versions 3.1.120, 3.1.202, 3.1.302, 5.0.104, 5.0.212, 5.0.303?

Metadata

Metadata

Assignees

No one assigned

    Labels

    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