-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK versions already on the VM are installed a second time and pre-installed SDKs become unavailable #284
Comments
I think a workaround for this is to set the - run: echo "DOTNET_INSTALL_DIR=/usr/share/dotnet" >> $GITHUB_ENV
if: startsWith(matrix.os, 'ubuntu')
shell: bash
- run: echo "DOTNET_INSTALL_DIR=C:\Program Files\dotnet" >> $GITHUB_ENV
if: startsWith(matrix.os, 'windows')
shell: bash |
@vsafonkin That's great news that there's a PR to handle this issue! .. except .. that PR was created in |
@PureKrome, sure, it was discussed by our team but now it's not priority feature unfortunately. |
Cheers @vsafonkin for the prompt reply - really appreciate it! 🍻
I'll actually edit your reply, on behalf of a large chunk of the community when they actually read what you're saying: "It was discussed by our team but we believe .NET is a 3rd class citizen behind all the other cooler langs so no one is going to be bothered. Look, I know it's a simple'ish fix but ... nope. Go learn node then talk to us. kthxbai! 👋🏻 " sadness :( |
@PureKrome, our team supports several setup actions and |
@vsafonkin cheers for the reply! are you (or someone else?) able to list/release top |
You can see usage in public repos, but that's it. Action authors can't see usage stats either unfortunately. My guess is
|
Great data @xt0rted !!! Awesome to see the public repo breakdown 👍🏻 👏🏻 ( but I'm crying inside 😢 ) |
An alternative form of the workaround, if you don't want to run additional steps: env:
DOTNET_INSTALL_DIR: ${{ startsWith(matrix.os, 'ubuntu') && '/usr/share/dotnet' || startsWith(matrix.os, 'windows') && 'C:\Program Files\dotnet' || '' }} |
In the end I set up a composite action that handles this and a few other things that aren't yet supported so it's easier to apply to all of my repos. The workaround was adjusted so it supports all three platforms now: - shell: bash
run: |
case "${{ runner.os }}" in
macOS) echo "DOTNET_INSTALL_DIR=/Users/runner/.dotnet" >> $GITHUB_ENV;;
Linux) echo "DOTNET_INSTALL_DIR=/usr/share/dotnet" >> $GITHUB_ENV;;
Windows) echo "DOTNET_INSTALL_DIR=C:\Program Files\dotnet" >> $GITHUB_ENV;;
*) echo "::warning::Unsupported runner os: ${{ runner.os }}";;
esac |
With v3 out, shouldn't there be no installation happen if the desired version is already installed on the image? I don't see any change in behavior. Running the following under Windows, for example, still takes about 43s, not what I'd expect if it would just use the preinstalled .NET SDK: - name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x' |
Hi, @Piedone 👋 Thanks for the question! The latest version of the .NET SDK on the 6.0 channel now is 6.0.402. The latest preinstalled .NET SDK version on our hosted runners is still 6.0.401 ( due to the deployment delays, but it will be updated very soon). That's why when you're specifying |
Ah, I see, that makes sense, my understanding of the behavior was wrong. Thank you for your quick reply! I can verify that it works faster if I specify a version already installed (<10s vs 15s under Ubuntu, and <25s vs almost 3 minutes under Windows). |
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:
Runner type:
Repro steps:
Call
actions/setup-dotnet
with a list of sdks that are pre-installed:Expected behavior:
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 withdotnet --info
.On
ubuntu-latest
andwindows-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 withdotnet --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
macOS after calling
actions/setup-dotnet
Windows out of the box (similar for Ubuntu)
Windows after calling
actions/setup-dotnet
(similar for Ubuntu)Where's versions 3.1.120, 3.1.202, 3.1.302, 5.0.104, 5.0.212, 5.0.303?
The text was updated successfully, but these errors were encountered: