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
Add missing RID combinations for Gentoo AND/OR hard-set RID for .NET build #100383
Comments
Tangent:
On the other hand if somehow adding a RID is just as easy as modding runtime.json Gentoo project can do it on is's own. I would like to also hear opinion of a .NET dev on this subject. |
I feel like there is no need as the runtime assembly code that gets generated would be the same as the normal |
Currently experimenting with just building with |
Bug: dotnet/runtime#100383 Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Our recommendation is to avoid all distro-specific RIDs unless you have some reason for creating binaries that are different from our official ones. You should be able to use the "portable" RIDs (linux-x64, linux-musl-x64, etc.) to produce binaries like .NET does. |
That does not seem to be the case, @vimproved reported that .NET SDK fails to compile if RID is enforced in a way he described above. |
Where is the build log? |
I hope @vimproved will upload his last build log here. But a different question is whether the options that he used are even supported outside of the CI environment. @agocke, do you know how this case would be handled in terms of passed configure options? |
You will have to provide more details. I don't know which options are being used. |
This is not the way to go. Distro specific build should have non-portable rids. This allows the SDK to distinguish between the portable assets that Microsoft provides through nuget.org and those built for the distro. By default the vmr (https://github.com/dotnet/dotnet) will determine a non-portable rid based on
Since
What is Can you provide a set of steps that reproduce the issue? |
We would like to use official assets from nuget.org if that's possible.
You are missing the point.
GentooDotnetInfo is Gentoo's tool that shows dotnet+system information, in this case it is irrelevant, it could as well be any other package.
Because we restore nuget packages for this specific architecture-dependent package build only. |
What's in the SDK's |
You're specifying a
I'm looking at the sources in https://gitlab.gentoo.org/dotnet/csharp-gentoodotnetinfo, and it's not clear why this would require specifying a rid. If you don't specify a rid, it should use the host that comes with Gentoo instead of looking for one elsewhere. |
This directory hosts all nuget packages that a given package requires. Btw this is very similar to what NixOS does.
We had to specify the RID explicitly for each package (in restore (src_prepare), build (src_compile) and test (src_test) phases) to have a general way of building most .NET-based packages. In our tests most pkgs would fail to restore with our old way of collecting SDK-version-bound nugets (see above explanation in this comment). |
-> pwd
/usr/lib/dotnet-sdk-8.0
-> uname -a
Linux magma-chroot-gentoo-amd64-musl-gcc-stable 6.6.21-gentoo-magentalane-0-local-workstation-2024.03.27 #1 SMP PREEMPT_DYNAMIC Wed Mar 27 02:49:27 CET 2024 x86_64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx AuthenticAMD GNU/Linux
-> grep 'RuntimeIdentifier>' ./sdk/8.0.102/Microsoft.NETCoreSdk.BundledVersions.props
<NETCoreSdkRuntimeIdentifier>gentoo.2.14-x64</NETCoreSdkRuntimeIdentifier>
<NETCoreSdkPortableRuntimeIdentifier>linux-musl-x64</NETCoreSdkPortableRuntimeIdentifier> |
If you change this line to match the .NET SDK framework version you'll no longer have the error: It's currently restoring the linux-x64 host for .NET 6. |
And if you drop the |
I think you mean that I have to change Can |
When you're building for .NET 8, set |
How is this is relevant to this issue? We are discussing SDK architecture mismatch only. We do not have to set it to net8.0 since we use |
When the When you set |
My main testing machine is currently not setup but I'll try to get you the log ASAP. |
Why does it do that despite the machine itself being musl? Is this intended behavior? |
Without looking deeper in the SDK, I don't know why it does this. For most users it doesn't pose an issue because it can find the package on nuget.org. Whereas the |
Description
Hello!
@vimproved raised a issue on the Gentoo IRC that after installing the from-source build of dotnet-sdk on musl the packages depending on dotnet-sdk would fail to find
Microsoft.NETCore.App.Host.linux-x64
see: https://paste.gentoo.zip/uQFu5vOg
This really got us both confused cause even if .NET failed to find the nuget it should have the
linux-musl-x64
RID and notlinux-x64
on musl.After a bit of digging we think we found the issue, that there are definitions for gentoo missing from the runtime.json file.
see: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
I did not open any PRs because i do not know if just adding it should be enough and I wanted to bring this up ASAP.
Reproduction Steps
compile the dontnet-sdk on Gentoo with musl variant, observe that that RID is gentoo.2.14-x64
Expected behavior
RID is gentoo.2.14-musl-x64
Actual behavior
RID is gentoo.2.14-x64
Regression?
No, unsupported yet.
Known Workarounds
Patch the runtime.json file - maybe?
Configuration
VERSION_ID="2.14"
Other information
dotnet --info
from a Gentoo musl chroot:The text was updated successfully, but these errors were encountered: