gentoo / dotnet

[MIRROR] Newer mono, .NET languages, and libraries
https://gitweb.gentoo.org/repo/proj/dotnet.git
79 stars 57 forks source link

Inquiry about dotnet-sdk-bin vs dotnetcore-sdk-bin #516

Closed bunder2015 closed 1 year ago

bunder2015 commented 1 year ago

Hello, I recently was using this repo for dotnetcore-sdk-bin, but noticed the comment in the readme saying that it is deprecated. I tried switching over to dotnet-sdk-bin, but wound up running into issues running applications saying they couldn't find the runtime (despite finding one in /opt) and pointing me to a download link over at Microsoft.

The application I was mostly having issues with is https://github.com/SourMesen/Mesen2#development-builds

At the time I had mono-6.12.0.122 and dotnet-sdk-bin-6.0.404 installed, and I wound up having to install dotnetcore-sdk-bin-6.0.102 to get the application to run. (I don't know if mono is relevant here anymore, the old version of Mesen did need it)

Eg:

You must install or update .NET to run this application.

App: /home/chris/mesen2_2023-03-17/Mesen
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
.NET location: /opt/dotnet-sdk-bin-7.0

The following frameworks were found:
  7.0.3 at [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.NETCore.App]

Go to aka.ms blah blah blah

(This might also be unrelated, but I also had issues with https://github.com/squid-man/MegaMan2Randomizer2 a couple years ago, and both of these apps seem to rely on Avalonia, so maybe that's the cause? I haven't tried it again since I got Mesen2 working.)

Unfortunately the error message Microsoft supplies doesn't help much, all I could get out of it was that I had the wrong version. I tried dotnet-sdk-bin-7.0.200 and 7.0.102 as well as 6.0.404, but it wasn't happy with any of them. Only dotnetcore-sdk-bin-6.0.102 worked... and only after I set export DOTNET_ROOT="/opt/dotnet_core" into my /etc/profile.

Are both of these packages infact the same package? What is the difference between them if not? Is anyone else able to run Mesen2 using a stock dotnet-sdk-bin configuration (without DOTNET_ROOT)?

Thanks

fluffynuts commented 1 year ago

I've had a similar issue in the past, solved with slotting, but that doesn't seem to be an option for now. I can offer you a hack-around if you like:

  1. unmerge dotnet-sdk-bin
  2. emerge dotnet-sdk-bin:6.0
  3. copy off /opt/dotnet-sdk-bin/6.0/shared/* somewhere
  4. unmerge dotnet-sdk-bin
  5. remerge dotnet-sdk-bin, without a slot modifier (ie, emerge dotnet-sdk-bin)
  6. copy in the contents from [3] above to /opt/dotnet-sdk-bin/7.0/shared

I don't know enough about ebuilds, but I'd imagine there should be a way to use symlinks with slotting instead. For now at least, this will probably work around the issue.

fluffynuts commented 1 year ago

Also, it looks like we should be using dotnet-sdk-bin from the main gentoo repo. Perhaps this (and other issues here) should rather be raised at bugs.gentoo.org? Some time ago I raised https://bugs.gentoo.org/833356, which links to the larger-scoped https://bugs.gentoo.org/show_bug.cgi?id=900597 so it looks like there are people on it, trying to sort out upstream issues. I guess an hack-around is the best I can think of for now.

fluffynuts commented 1 year ago

thanks to a discussion on https://github.com/gentoo/dotnet/issues/447, there's a much better way:

  1. Disable the symlink from the 6.0 slot: echo dev-dotnet/dotnet-sdk-bin:6.0 -dotnet-symlink >> /etc/portage/package.use/dotnet
  2. Install the 6.0 slot emerge dotnet-sdk-bin:6.0
  3. symlink in the runtimes:
    ln -s /opt/dotnet-sdk-bin-6.0/shared/Microsoft.AspNetCore.App/6.0.12 /opt/dotnet-sdk-bin-7.0/shared/Microsoft.AspNetCore.App/6.0.12
    ln -s /opt/dotnet-sdk-bin-6.0/shared/Microsoft.NETCore.App/6.0.12 /opt/dotnet-sdk-bin/7.0/shared/Microsoft.NETCore.App/6.0.12

after that, dotnet --list-runtimes produces:

Microsoft.AspNetCore.App 6.0.12 [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.3 [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.12 [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.3 [/opt/dotnet-sdk-bin-7.0/shared/Microsoft.NETCore.App]

hope this helps

bunder2015 commented 1 year ago

Hi, thanks for looking into this... been busy the past few days, I'll try this when I have some time and report back. Thanks again

bunder2015 commented 1 year ago

Sorry for the delay... I gave this a go, and it seems to be working, I did have to change DOTNET_ROOT to point to the 7.x install, but at least it's working... unsetting it just told me I had no .net installed. I think I can close this for now, if anything I can ask on bgo now that I have a working setup on non-overlay packages. Thanks again