-
Couldn't load subscription status.
- Fork 514
Use dotnet-install.sh in .NET feature #467
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for refactoring! ✨
Left some comments/thoughts
| { | ||
| "id": "dotnet", | ||
| "version": "1.1.3", | ||
| "version": "2.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid bumping the major version? People pin to the major version and aren't proactive to update their dev config once new major version is released. Hence, they would stay back on older releases.
I bumped the version to 2.0 in order to break the version format. dotnet-install.sh requires a version to be latest, have the form X, or have the form X.Y.Z. For example, 7 and 7.0.3. The old schema allowed version to have the for X.Y (e.g., 3.1). We need to come up with a way to map X.Y to X.Y.Z in order to preserve this option.
Can we find three part version when X.Y is provided with GH releases/tags?
Look at find_version_from_git_tags() and we could probably use https://github.com/dotnet/installer/releases
If you update the Feature, then we could avoid avoid bumping the major version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention of this change is to rip out the complexity that using a hybrid of apt + github tags + official install scripts brings.
If it's really unfavorable to bump to 2.0.0 (which I understand is a real concern in leaving people behind), perhaps figuring out a way to deprecate the arguments would be a nicer solution.
I agree that if the three part versioning was the only thing holding us back, we should definitely keep that for compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samruddhikhandale @joshspicer it's possible to support 'X.Y' if you use --channel:
./dotnet-install.sh --channel 3.1Is the same as:
./dotnet-install.sh --version 3.1.426There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also how the script currently works when you only pass a major version (form 'X').
features/src/dotnet/install.sh
Lines 45 to 49 in 7d818c2
| # If version is just a major value (form 'X'), assume it is a channel | |
| if [[ "$version" =~ ^[0-9]+$ ]]; then | |
| channel="$version.0" | |
| version="latest" | |
| fi |
So all you have to do is add a special case for form 'X.Y':
if [[ "$version" =~ ^[0-9]+.[0-9]+$ ]]; then
channel="$version"
version="latest"
fiWorks perfectly.
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Install just the dotnet runtime if true, and sdk if false." | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should keep this option as is?
Some people might prefer install .NET from apt as it's quicker and provides a fallback if the the .NET install script regresses.
|
Here are more details regarding how this feature installs .NET along with a comparison to the current implementation. Both the "old" (current) and "new" (this PR) features install a Single versionWith just 1 .NET installation, there is no difference between the two features except for the version that Additional versionsThe old and new features differ noticeably when you install more than one version of .NET. The old feature makes 2 isolated installations of .NET in On the other hand, the new feature installs both versions to the same directory. This allows Links |
|
Thanks for the detailed explanation! Few clarifying questions,
"ghcr.io/devcontainers/features/dotnet:1": {
"version": "7",
"installUsingApt": "false",
"additionalVersions": "6"
}What is returned with |
That behavior mirrored New behavior for latestI added a new path for an LTS versionThe new feature also accepts an
|
|
Unfortunately, my work situation has changed recently and I'm no longer in a position to maintain this contribution. I'm going to close this PR. I believe that this change is still needed in order to enable |
|
Dang, I just found this PR after a few hours experimenting with different combinations of |
|
I was able to modify the script from this PR and get it working perfectly. A few of my notes:
Here is the modified script that I'm currently using |
|
Thank you for all the wonderful feedback and insights.
We appreciate and value community contributions, @sliekens would you be interested in opening a PR which modifies the |
Changing the install path seems reasonable to me. I stuck with
Agreed. I don't think
Great news! That means v2 can support |
|
@samruddhikhandale Now that we've answered the versioning/install path questions, do you have updated thoughts on bumping this Feature to v2 and ditching the This PR stalled because of the v2 bump, the install path confusion, and the @sliekens I'm traveling abroad the next few weeks, but I can help you make an updated PR if you're patient :) |
|
Absolutely, whenever you have time @jungaretti. About the version bump, what is considered a breaking change? One could make the case this should be a minor/patch update because nothing changes in the way you eventually use the dotnet cli? (Added to PATH same as before.) |
|
Although the CLI's usage is (nearly) the same, I assumed this would be a major version bump because:
|
|
@jungaretti checking if your schedule has freed up yet? I'm still interested in getting this merged. There are too many improvements in this script over the original for me to do nothing about it. |
Thank you for answering all the questions.@jungaretti Sounds like a good plan to me. Would appreciate your contribution, thank you! ✨ Let us know how we could help. |
|
I'll create a PR, still working on improving the test scenarios a bit. |















Closes #464
Fixes #293
Fixes #389
Refactors the .NET feature to use
dotnet-install.shto install the .NET SDK and runtime. This PR bumps the .NET feature to a new major version (v2) in order to remove theaptoption.This PR changes the behavior of
dotnetwhenadditionalVersionsare installed. v1 installs each .NET version to its own directory. These directories are independent. If you install anadditionalVersionof .NET with v1, you cannot use that version withdotnetuntil you modify$PATH.My team's codebase uses both .NET 3 and 6. We cannot build our project using v1 of the .NET feature because of this bug.
v2 installs
additionalVersionsto the same directory as the primaryversion. This enables you to--list-sdksall of the SDKs fromversionandadditionalVersions. v2 unblocks users who need to useadditionalVersionsof .NET.When
dotnet --list-sdksincludes multiple versions of .NET,dotnet --version(and other SDK commands) use "the latest SDK installed on the machine by default." Uses can override this behavior with aglobals.jsonfile.