-
Notifications
You must be signed in to change notification settings - Fork 0
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
Should snap installs automatically create symlinks? #13
Comments
Hi @nagilson! Thank you for bringing this to our attention. Currently, there are no plans to create the The new snap will include an installer tool that lets users pick and choose the runtimes and SDKs they want installed on their systems, effectively allowing them to have more than one major version installed at once (which is currently not possible with the existing Are there any alternatives that we can discuss, such as creating the |
Thanks for following up with my issue! :) I think the alternative solution you propose is a better idea. Really, the symlink is more of a patch than solving the underlying issue, though both work well, I understand why you don't have plans to make that symlink automatically now. I'm not sure on the benefit of I don't have a ton of knowledge/authority in this space, but @richlander does and I'm curious to hear his take. |
Well, if I understand correctly, the Since that's a well-known location for getting the absolute path of the For reference, I currently have the .NET .debs installed on my machine, this is what I see on both of these files:
Curious to hear the others takes as well 😃 |
@mateusrodrigues - are you suggesting that snaps also utilize /etc/dotnet/install_location to mark an installed snap's entrypoint? |
@leecow not the snap's entrypoint, but the actual location of the .NET installation. It would contain something like Since the issue was raised because the snap's own executable on PATH does not link to the dotnet executable directly (see snippet below),
|
Seems like a good solution to me but would want @richlander, @baronfel or @marcpopMSFT to weigh in. |
Yes, that should be an acceptable solution. It would conflict with a .NET installation from a deb pkg but I don't think that's necessarily a bad thing - we generally don't recommend that users mix installation methods anyway. |
There are two reasons why that file could be used:
I don't know much about snaps, but I'm wondering if they would break the second use case. It isn't clear to me that it would be a deal killer, but good to understand what the behavior will be. |
@richlander IIUC the " If so, the fact that we're shipping with snaps shouldn't matter, because the behavior of
Being more specific on the .NET snap case,
Hope this makes sense :) |
Also, if we all agree with this approach, I can work on the PR for this change 😃 |
So I have found the culprit in the @baronfel @nagilson Ideally, I'd like to trigger this code path, so that I'm able to attach a debugger and work further on this function. I tried doing that through numerous I'm a bit unfamiliar with the Resolver itself, so I would appreciate any pointers on how I could achieve that, or if there's a better way even :) |
@mateusrodrigues Thank you so much for your willingness to help investigate the issue. 😄 I apologize for our long delay to get back to you as we have been focused on a lot of other things atm. Great eye on spotting the I was able to attach a debugger to the I hope that answers your question? Btw, you need to also run the commands shown above after build and attach to the process ID as in my screenshot to get it to work. I show it in VS and using the windows script, but we have a shell script equivalent for linux. Hopefully this is helpful. |
Hey @nagilson! Thank you so much, that was very helpful! I noticed that the realpath logic sits inside the
Going a little bit on a tangent here, but when is I was able to go into the |
That's a good question, honestly I can't think of any scenario where that would be the case. That might just be a safe-guard. @JanKrivanek are you aware of a case where |
IIRC it was for selfcontained executables and sdk tests (code is hosted in runner). |
Thanks @JanKrivanek! That makes sense. |
Based on the history of dotnet/sdk#10403.
When dotnet is installed via
snap
, the dotnet on PATH resolves to a realpath of /usr/bin/snap and not to a dotnet executable next to the sdk folder.This breaks an assumption of the resolver that we can use realpath on dotnet on PATH to find the SDK. Thus, for a snap install to execute successfully, there are cases where manual intervention is required from the user to create a symbolic link to the actual .NET Path on their system, e.g.
ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
.Should we consider doing this automatically for snap installs?
The text was updated successfully, but these errors were encountered: