Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[2.x] Tracking issue for RID-related binary loading issues on Linux

オープン
#2,610 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, linux

調査の方向性

src/Core/Silk.NET.Core/Loader/DefaultPathResolver.cs の 357 行目あたりから始め、2 つの runtime identifier API と runtime.json の RID グラフを比較します。影響を受ける Linux ディストリビューションで識別子を再現し、選択した識別子で runtimes 内のバイナリを検索できることを確認します。新しい Silk バージョンが公開された後、直接関連する issue を確認します。

索引モデルが issue の本文から書いたものです。

説明

bug good first issue verify-3.0

Summary

This is an issue I'm opening specifically to track the other open issues related to the RID-related binary loading issue. Solving this issue should solve the related issues.

The symptom of this issue is that Silk 2 fails to find binaries located in the runtimes folder.
Moving the binary out and next to the built executable is a common workaround for this issue.

At its core, the problem is the following:

// linux-x64
Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier);

// vanilla.2.0-x64 - This is what Silk 2 uses
Console.WriteLine(Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier());

vanilla... and many other RIDs obtained from the PlatformAbstractions call don't exist as part of the RID graph found here: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json

Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier() is called here:
https://github.com/dotnet/Silk.NET/blob/57e0f8643c07702a16e14c027b1f15d60809d15b/src/Core/Silk.NET.Core/Loader/DefaultPathResolver.cs#L357

Steps to reproduce

For a given affected distro, run the code above and see what RIDs are produced. The second RID is the one that Silk uses. If that RID is not part of the RID graph, then that's why the binary fails to be found as part of the runtimes folder.

Comments

There's a lot of workarounds and fixes suggested in these issues, but I think a better fix is that we make use of the System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier value instead.

From what I remember, modern .NET is no longer including per-distro RIDS anymore, so it makes sense that these distro RIDs are not part of the graph.

I also remember seeing some #if preprocessors related to the RuntimeInformation code, so I'm guessing that the RuntimeInformation APIs are not available on .NET Standard or something. If my guess is wrong, then this fix is easy and we just use both so we preserve the old behavior and fallback to the new.

My investigation of this issue can be found here: https://discord.com/channels/521092042781229087/607634593201520651/1540594381956972695

Edit: Apparently this exact underlying issue was mentioned here and probably not investigated further: https://discord.com/channels/521092042781229087/607634593201520651/1331176382339743755

Directly related issues

Solving this issue should close all of the following issues:

Fedora is part of the RID graph, but only versions v39 and before. Latest is v44.
Ubuntu is part of the RID graph, but only versions v23 and before. Latest is v26.

Vanilla OS is another report I got from a user in Discord (https://discord.com/channels/521092042781229087/607634593201520651/1540577683195568178), which is also not part of the RID graph.

Once this issue is fixed and a new version of Silk is published, we should go through these issues, ask if the issue is fixed, and close the issues after a week or so if resolved or no response.

主要言語
C#
スター
5.2k
フォーク
480
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/Silk.NET のほかの issue

dotnet/Silk.NET の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。