dotnet/source-build: Unable to load shared library 'git2-8e0b172'
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- csharp, git, linux
調査の方向性
LibGit2Sharp/Core/NativeMethods.cs から始め、特に stack trace に記載されている LoadNativeLibrary() のパスを確認し、packages/libgit2sharp.nativebinaries/1.0.235/runtimes/ 配下のネイティブアセットを調べます。Exherbo Linux 上で ./build.sh を使って再現し、/etc/os-release に基づくディストリビューション検出を比較します。source-build の clone 操作中に、適切な OpenSSL 互換のネイティブ libgit2 ライブラリが読み込まれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I am working on a Dotnet package for Exherbo Linux.
Following the error message below, I realized that there were several libraries libgit2-8e0b172.so
s0dy ~/source-build (release/3.0) find . -name libgit2-8e0b172.so
./packages/libgit2sharp.nativebinaries/1.0.235/runtimes/debian.9-x64/native/libgit2-8e0b172.so
./packages/libgit2sharp.nativebinaries/1.0.235/runtimes/fedora-x64/native/libgit2-8e0b172.so
./packages/libgit2sharp.nativebinaries/1.0.235/runtimes/alpine-x64/native/libgit2-8e0b172.so
./packages/libgit2sharp.nativebinaries/1.0.235/runtimes/linux-x64/native/libgit2-8e0b172.so
./packages/libgit2sharp.nativebinaries/1.0.235/runtimes/rhel-x64/native/libgit2-8e0b172.so
I also noticed that the lib for debian and fedora was related to openssl-1.1
s0dy ~/source-build (release/3.0) lddtree packages/libgit2sharp.nativebinaries/1.0.235/runtimes/debian.9-x64/native/libgit2-8e0b172.so
libgit2-8e0b172.so => packages/libgit2sharp.nativebinaries/1.0.235/runtimes/debian.9-x64/native/libgit2-8e0b172.so (interpreter => none)
librt.so.1 => /usr/host/lib/librt.so.1
libpthread.so.0 => /usr/host/lib/libpthread.so.0
ld-linux-x86-64.so.2 => /usr/host/lib/ld-linux-x86-64.so.2
libcurl.so.4 => /usr/host/lib/libcurl.so.4
libssh2.so.1 => /usr/x86_64-pc-linux-gnu/lib/libssh2.so.1
libssl.so.1.1 => /usr/host/lib/libssl.so.1.1
libcrypto.so.1.1 => /usr/host/lib/libcrypto.so.1.1
libdl.so.2 => /usr/host/lib/libdl.so.2
libz.so.1 => /usr/host/lib/libz.so.1
libc.so.6 => /usr/host/lib/libc.so.6
While the others (alpine, linux and rhel) are related to openssl-1.0
s0dy ~/source-build (release/3.0) lddtree packages/libgit2sharp.nativebinaries/1.0.235/runtimes/alpine-x64/native/libgit2-8e0b172.so
libgit2-8e0b172.so => packages/libgit2sharp.nativebinaries/1.0.235/runtimes/alpine-x64/native/libgit2-8e0b172.so (interpreter => none)
libcurl.so.4 => /usr/host/lib/libcurl.so.4
libssh2.so.1 => /usr/x86_64-pc-linux-gnu/lib/libssh2.so.1
libssl.so.1.1 => /usr/x86_64-pc-linux-gnu/lib/libssl.so.1.1
libcrypto.so.1.1 => /usr/x86_64-pc-linux-gnu/lib/libcrypto.so.1.1
libdl.so.2 => /usr/host/lib/libdl.so.2
ld-linux-x86-64.so.2 => /usr/host/lib/ld-linux-x86-64.so.2
libpthread.so.0 => /usr/x86_64-pc-linux-gnu/lib/libpthread.so.0
libc.so.6 => /usr/x86_64-pc-linux-gnu/lib/libc.so.6
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
libz.so.1 => /usr/host/lib/libz.so.1
libc.musl-x86_64.so.1 => not found
-
The version of my distribution is not recognized, I guess I use the linux-x64 version that is related to openssl-1.0. So I have libssl and libcrypto that are not found as you can see above.
-
I tried replacing my /etc/os-release file with that of a debian machine and it works.
-
I would like to find a solution, make a patch. Which file exactly checks the distribution? How to tell him to use the good library related to openssl-1.1?
Reproduction steps
- git clone https://github.com/dotnet/source-build.git
- cd source-build.git
- ./build.sh
Expected behavior
successful compilation ?
Actual behavior
fail: Microsoft.DotNet.Darc.Operations.Operation[0]
Something failed while cloning.
System.Exception: Something went wrong when cloning repo https://github.com/dotnet/arcade at <default branch> into /home/s0dy/source-build/bin/src/arcade ---> System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'git2-8e0b172' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-8e0b172: cannot open shared object file: No such file or directory
at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.LoadNativeLibrary() in C:\projects\libgit2sharp\LibGit2Sharp\Core\NativeMethods.cs:line 47
at LibGit2Sharp.Core.NativeMethods..cctor() in C:\projects\libgit2sharp\LibGit2Sharp\Core\NativeMethods.cs:line 37
--- End of inner exception stack trace ---
at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts)
at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 354
at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) in C:\projects\libgit2sharp\LibGit2Sharp\Repository.cs:line 715
at Microsoft.DotNet.DarcLib.RemoteRepoBase.Clone(String repoUri, String commit, String targetDirectory, ILogger _logger, String pat, String gitDirectory) in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/DarcLib/RemoteRepoBase.cs:line 176
--- End of inner exception stack trace ---
at Microsoft.DotNet.DarcLib.RemoteRepoBase.Clone(String repoUri, String commit, String targetDirectory, ILogger _logger, String pat, String gitDirectory) in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/DarcLib/RemoteRepoBase.cs:line 210
at Microsoft.DotNet.DarcLib.GitHubClient.Clone(String repoUri, String commit, String targetDirectory, String gitDirectory) in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/DarcLib/GitHubClient.cs:line 875
at Microsoft.DotNet.Darc.Operations.CloneOperation.HandleMasterCopyAndCreateGitDir(RemoteFactory remoteFactory, String repoUrl, String masterGitRepoPath, String masterRepoGitDirPath, String gitDirRedirect, ILogger log) in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 282
at Microsoft.DotNet.Darc.Operations.CloneOperation.HandleMasterCopyWithGitDirPath(RemoteFactory remoteFactory, String repoUrl, String masterGitRepoPath, String masterRepoGitDirPath, ILogger log) in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 270
at Microsoft.DotNet.Darc.Operations.CloneOperation.HandleMasterCopy(RemoteFactory remoteFactory, String repoUrl, String masterGitRepoPath, String masterRepoGitDirPath, ILogger log) in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 225
at Microsoft.DotNet.Darc.Operations.CloneOperation.ExecuteAsync() in /home/s0dy/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 102
/home/s0dy/source-build/tools-local/init-build.proj(169,5): error MSB3073: The command "/home/s0dy/source-build/Tools/dotnetcli/dotnet /home/s0dy/source-build/tools-local/arcade-services/artifacts/bin/Microsoft.DotNet.Darc/Release/netcoreapp2.1/Microsoft.DotNet.Darc.dll clone --repos-folder /home/s0dy/source-build/bin/src/ --git-dir-folder /home/s0dy/source-build/.git/modules/src/ --include-toolset --ignore-repos ";https://dev.azure.com/dnceng/internal/_git/dotnet-optimization;https://dev.azure.com/devdiv/DevDiv/_git/DotNet-Trusted;https://devdiv.visualstudio.com/DevDiv/_git/DotNet-Trusted;https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-optimization;https://dev.azure.com/dnceng/internal/_git/dotnet-core-setup" --azdev-pat bogus --github-pat bogus --depth 0 --debug" exited with code 42.
Version of LibGit2Sharp (release number or SHA1)
Versions pulled from NuGet package
LibGit2Sharp.NativeBinaries - version="1.0.235"
Operating system(s) tested; .NET runtime tested
Exherbo Linux trying to compile dotnet/source-build release/3.0
- 主要言語
- C#
- スター
- 3.5k
- フォーク
- 925
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libgit2/libgit2sharp のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
libgit2/libgit2sharp#2193 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
libgit2/libgit2sharp#2192 · コメント 1 件 ·
-
Website is down オープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
libgit2/libgit2sharp#2191 · リアクション 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
libgit2/libgit2sharp#2189 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
libgit2/libgit2sharp#2187 · コメント 2 件 ·
libgit2/libgit2sharp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
dotnet/AspNetCore.Docs#37699 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15108 · コメント 1 件 ·
-
area/docs-content Bug pulumi/docs
難易度 1/5 1〜3時間 初心者へのやさしさ 94/100
-
agentic-workflows untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100