SDK versions already on the VM are installed a second time and pre-installed SDKs become unavailable
See original GitHub issueDescription:
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/setup-dotnet@v2.0.0
with:
dotnet-version: |
3.1.417
5.0.406
6.0.201
Expected behavior:
- For any SDK version installed by this action to be skipped if it’s already installed on the VM.
- 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?
Issue Analytics
- State:
- Created a year ago
- Comments:14 (5 by maintainers)
Top GitHub Comments
@PureKrome, sure, it was discussed by our team but now it’s not priority feature unfortunately.
You can see usage in public repos, but that’s it. Action authors can’t see usage stats either unfortunately. My guess is
setup-dotnet
is used in a lot of private repos making this number not accurate but who knows. I’m sure there’s a fair amount of missed opportunities here with people sticking with Azure DevOps too.