[2.x] Tracking issue for RID-related binary loading issues on Linux
まだ誰も着手していません。
評価
- 難易度
- 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 の本文から書いたものです。
説明
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:
- https://github.com/dotnet/Silk.NET/issues/2601 (and technically unresolved, https://github.com/dotnet/Silk.NET/issues/2599)
- https://github.com/dotnet/Silk.NET/issues/2571
- https://github.com/dotnet/Silk.NET/issues/2568
- https://github.com/dotnet/Silk.NET/issues/2465
- RID/distro not specified, but very likely to be this issue
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 はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/Silk.NET のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
bug verify-3.0
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
dotnet/Silk.NET の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
stryker-mutator/stryker-net#3892 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MobiFlight/MobiFlight-Connector#3419 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Kryptos-FR/MarkView.Avalonia#105 ·
メンテナーはふだん 1 日以内に返信
-
[辞書]オープン提案 辞書
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/fluentui-blazor#5410 ·
メンテナーはふだん 1 日以内に返信