Skip to content
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

Install runs twice after update from v3 to v4 #491

Closed
4 of 5 tasks
bkoelman opened this issue Dec 6, 2023 · 7 comments
Closed
4 of 5 tasks

Install runs twice after update from v3 to v4 #491

bkoelman opened this issue Dec 6, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@bkoelman
Copy link

bkoelman commented Dec 6, 2023

Description:

After update from v3 to v4, it looks like the install runs twice.

Github Actions step:

    - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: |
          6.0.x
          8.0.x

Original output:

Run actions/setup-dotnet@v[3](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7041019307/job/19162902448#step:2:3)
  with:
    dotnet-version: 6.0.x
  8.0.x
  
    cache: false
  env:
    DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
    DOTNET_CLI_TELEMETRY_OPTOUT: true
/home/runner/work/_actions/actions/setup-dotnet/v3/externals/install-dotnet.sh --channel 6.0
dotnet-install: .NET Core SDK with version '6.0.[4](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7041019307/job/19162902448#step:2:4)1[7](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7041019307/job/19162902448#step:2:7)' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v3/externals/install-dotnet.sh --channel [8](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7041019307/job/19162902448#step:2:8).0
dotnet-install: .NET Core SDK with version '8.0.[10](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7041019307/job/19162902448#step:2:11)0' is already installed.

New output:

Run actions/setup-dotnet@v[4](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7089943142/job/19313357238?pr=38#step:2:4)
  with:
    dotnet-version: [6](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7089943142/job/19313357238?pr=38#step:2:6).0.x
  8.0.x
  
    cache: false
  env:
    DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
    DOTNET_CLI_TELEMETRY_OPTOUT: true
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '8.0.0' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --channel 6.0
dotnet-install: .NET Core SDK with version '6.0.41[7](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7089943142/job/19313357238?pr=38#step:2:7)' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '[8](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7089943142/job/19313357238?pr=38#step:2:8).0.0' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --channel 8.0
dotnet-install: .NET Core SDK with version '8.0.[10](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7089943142/job/19313357238?pr=38#step:2:11)0' is already installed.

Task version:
v4.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Example at https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/actions/runs/7089943142/job/19313357238?pr=38.

Expected behavior:
Installation occurs once per target framework.

Actual behavior:
Installation occurs twice per target framework.

@dusan-trickovic
Copy link

Hello, @bkoelman! Thank you for reporting this issue, we will look into it and see what can be done :)

@aparnajyothi-y
Copy link

Thank you for creating the issue, @bkoelman!

This is the expected behavior for setup-dotnet@v4. Install script runs two times with different settings:

  1. Minimal installation of the latest runtime version in order to obtain latest stable version of the dotnet executable
  2. Installation of the required SDK

    This approach was introduced in order to fix the issue #387.
    setup-dotnet@v3 used to overwrite dotnet executable on each action run, which was causing action to fail on some occasions due to executable being still in use. In setup-dotnet@v4 we solved this issue by adding another install-script run that installs LTS version of dotnet executable and uses it for all subsequent dotnet installations. (#433) The first install-script run conducts the actual download only once per workflow.

    If you have any other concerns regarding install-script running twice, please feel free to share them!

@bkoelman
Copy link
Author

bkoelman commented Dec 8, 2023

Thanks for looking into this. The duplicate installation does not pose any problems, it just came as a surprise. Now I understand it's intentional and was done to fix a problem, so I'm fine with it. It would be worth mentioning this in the release notes though.

@aparnajyothi-y aparnajyothi-y self-assigned this Dec 11, 2023
@aparnajyothi-y
Copy link

Added this expected behaviour to the release notes of v4.0.0 and closing this issue. Thank you.

@bkoelman
Copy link
Author

Thanks

@VAllens
Copy link

VAllens commented Jan 8, 2024

However, even after I create the global.json file specifying that I want to use version 7.0, it still always installs the latest version(8.0), for me, before finally installing the version specified by the dotnet-version parameter(7.0) for me.
This is unnecessary, it wastes a lot of my time, especially with a slow network, and it doesn't seem to cache the installer packages and the install directory for me.

@zeeshanpolaris
Copy link

However, even after I create the global.json file specifying that I want to use version 7.0, it still always installs the latest version(8.0), for me, before finally installing the version specified by the dotnet-version parameter(7.0) for me. This is unnecessary, it wastes a lot of my time, especially with a slow network, and it doesn't seem to cache the installer packages and the install directory for me.

I have noticed same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants