Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 882569 - virtual/dotnet-sdk uses slots for major versions, but always requires USE="dotnet-symlink" for them, which blocks multiple SLOTS coexisting.
Summary: virtual/dotnet-sdk uses slots for major versions, but always requires USE="do...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: dotnet project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 900597
  Show dependency tree
 
Reported: 2022-11-23 03:00 UTC by Anna
Modified: 2023-09-15 20:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
eselect module prototype (dotnet.eselect,1.95 KB, text/plain)
2022-11-24 21:29 UTC, Anna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anna 2022-11-23 03:00:04 UTC
This blocks from having multiple versions of dotnet coexisting.

An simple fix would be having IUSE="dotnet-symlink" in virtual/dotnet-sdk itself.

Tho a better solution would be a eselect module for dotnet-sdk, and having away with the symlink useflag at all.
Comment 1 Maciej Barć gentoo-dev 2022-11-23 16:25:41 UTC
> This blocks from having multiple versions of dotnet coexisting.

It does not, it will block multiple virtuals only (because they require dotnet-symlink), the way to get multiple dotnet versions is to have only one use dotnet-symlink.

See:

> (~)λ dotnet-bin-7.0 --list-runtimes                 
> Microsoft.AspNetCore.App 7.0.0 [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.AspNetCore.App]
> Microsoft.NETCore.App 7.0.0 [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.NETCore.App]

> (~)λ dotnet-bin-6.0 --list-runtimes             
> Microsoft.AspNetCore.App 6.0.10 [/opt/dotnet-sdk-bin-6.0/shared/Microsoft.AspNetCore.App]
>Microsoft.NETCore.App 6.0.10 [/opt/dotnet-sdk-bin-6.0/shared/Microsoft.NETCore.App]

I agree this is quite "meh" but this is the work of the previous maintainer (i think I have not changed it much...?)

Yes I agree we should drop symlink stuff and have a proper eselect and eclass.

Since "dotnet-bin-7.0" is able to pick up proper sdk/runtime (THX MS!) the eclass can determine the SDK to use using a simple loop check

> for _dotnet in dotnet-bin-7.0 dotnet-bin-7.0 ; do
>     if type $_dotnet ; then 
>         DOTNET_FOR_BUILD=$_dotnet
>         break
>     fi
> done

Instead of calling "dotnet" (which then would actually be a symlink) and probably failing miserably.
Comment 2 Anna 2022-11-24 21:29:23 UTC
Created attachment 836583 [details]
eselect module prototype

I made a basic prototype for it, based this on the lua eselect module, it's probably not the best since it's my first module tho.
Comment 3 Marat Radchenko 2023-03-13 08:32:27 UTC
Are there plans to fix "dotnet --list-sdks" so it actually would list ALL installed sdks or it is out opf scope of this issue?
Comment 4 Maciej Barć gentoo-dev 2023-03-13 11:30:33 UTC
(In reply to Marat Radchenko from comment #3)
> Are there plans to fix "dotnet --list-sdks" so it actually would list ALL
> installed sdks or it is out opf scope of this issue?

"dotnet --list-sdks" does not work on Gentoo currently and will not work with the new approach. And by that I mean that it can list only the SDKs that the currently used (current approach) or eselected (new) "dotnet" exe detects.

Afaik list-sdks can only detect SDKs from the given "dotnet" exe prefix.
I do not think we can throw all of .NET SDKs to one directory.
Maybe an approach would be to just copy the right SDK dirs into one /opt/dotnet?
which "dotnet" executable would we use then?

I think "dotnet --list-sdks" was designed for people who run a dotnet install under their user. For system "listing" we could use eselect (new approach) which could be able to detect SDK dirs.
> 7.0.201 [/opt/dotnet-sdk-bin-7.0/sdk]
but would we need that?

Yes, the new approach will differ slightly from what somebody might be used to with their .NET development but imho it will be more usable than current one.
Comment 5 Maciej Barć gentoo-dev 2023-09-15 20:55:38 UTC
https://github.com/gentoo/gentoo/pull/32109 merged.