V2 setup-dotnet ADR#171
V2 setup-dotnet ADR#171vsafonkin wants to merge 12 commits intoactions:mainfrom vsafonkin:v-vlsafo/adr-v2-doc
Conversation
| Status: Proposed | ||
|
|
||
| # Context | ||
| - GitHub-hosted Ubuntu and Windows runners have .NET versions pre-installed in system directories (Ubuntu:`/usr/share/dotnet`, Windows:`C:\Program Files\dotnet`), but the `v1` version of action installs .NET to user's directory (Ubuntu:`/home/runner/.dotnet`, Windows: `C:\Users\runneradmin\AppData\Local\Microsoft\dotnet`) for that runners. It means that action always download and install .NET version even if it is pre-installed and after using the action all pre-installed .NET versions are unavailable. |
There was a problem hiding this comment.
To summarize the current behavior for .NET team review
We have a bunch of .NET Core versions pre-installed on images. And the problem is that action works very inconsistent on different platforms.
- Ubuntu:
- Pre-installed location (where .NET is pre-installed): “/usr/share/dotnet”
- Action installs to: “/home/runner/.dotnet”
- Windows:
- Pre-installed location: “C:\Program Files\dotnet”
- Action installs to “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet”
- MacOS:
- Pre-installed location: “/Users/runner/.dotnet”
- Action installs to “/Users/runner/.dotnet”
How it works currently on macOS
Pre-installed location and action location are the same. It means that if we have versions 2.1.x, 3.1.x and 5.0.x pre-installed on image and user will install 3.1 via action, installation will be skipped because version already exists. if customer runs dotnet --version it will report version 5.x if customer doesn't have global.json (because both 2.1, 3.1, 5.0 will be located in the same folder and dotnet will choose the latest one based on https://docs.microsoft.com/en-us/dotnet/core/versions/selection)
How it works currently on Windows / Ubuntu
Pre-installed location and action location are different. It means if we have versions 2.1.x, 3.1.x and 5.0.x pre-installed on image and user will install 3.1 via action, version 3.1 will be installed to the separate location and dotnet --version will report version 3.1 because it is the single version installed in that location.
Problems
- Behavior is inconsistent between platforms and it confuses users
- macOS users complain that
dotnetstill uses 5.x despite the fact that they invoked action with 3.1 - Windows / Ubuntu users complain that pre-installed .NET are not consumed and it is always installed that takes build time
In our understand, the correct behavior is on macOS right now.
The new versions should be installed in the same location like pre-installed. It is expected behavior that dotnet --version will point the latest one and we should just point customers to documentation.
This PR outlines the basic proposals for the v2 version of setup-java.
Internal issue: 1807