TypeInitializationException on M1 chip
まだ誰も着手していません。
評価
調査の方向性
報告された macOS 12.1 arm64 環境で Utilities.cs の GitSetup を使用して失敗を再現し、その後 LibGit2Sharp.Core.NativeMethods と、NewDomainProjectCommand.cs および NewExampleCommand.cs を経由する呼び出しパスを調査します。Repository.Init と初回の commit が、M1 チップ上で TypeInitializationException なしに正常に完了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Reproduction steps
I had a bug report on my project about this.
this is the code that's failing on an M1 chip.
public static void GitSetup(string solutionDirectory)
{
GitBuilder.CreateGitIgnore(solutionDirectory);
Repository.Init(solutionDirectory);
var repo = new Repository(solutionDirectory);
string[] allFiles = Directory.GetFiles(solutionDirectory, "*.*", SearchOption.AllDirectories);
Commands.Stage(repo, allFiles);
var author = new Signature("Craftsman", "craftsman", DateTimeOffset.Now);
repo.Commit("Initial Commit", author, author);
}
Expected behavior
I should have a new repo created and an initial commit made. This works fine on my intel chip.
Actual behavior
This is the exception that gets thrown
TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an
exception.
In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment
variable: dlopen(libgit2-106a5f2, 0x0001): tried: 'libgit2-106a5f2' (no such file),
'/usr/local/lib/libgit2-106a5f2' (no such file), '/usr/lib/libgit2-106a5f2' (no such file),
'/Users/me/Desktop/code/csharp/libgit2-106a5f2' (no such file),
'/usr/local/lib/libgit2-106a5f2' (no such file), '/usr/lib/libgit2-106a5f2' (no such file)
at git_libgit2_init()
at InitializeNativeLibrary()
at cctor()
at git_repository_init_ext(git_repository*& repository, FilePath path, GitRepositoryInitOptions options)
at git_repository_init_ext(FilePath workdirPath, FilePath gitdirPath, Boolean isBare)
at Init(String path, Boolean isBare)
at Init(String path)
at GitSetup(String solutionDirectory) in Utilities.cs:393
at CreateNewDomainProject(String domainDirectory, IFileSystem fileSystem, DomainProject domainProject)
in NewDomainProjectCommand.cs:115
at Run(String buildSolutionDirectory, IFileSystem fileSystem) in NewExampleCommand.cs:41
Version of LibGit2Sharp (release number or SHA1)
Release: 0.26.2
Operating system(s) tested; .NET runtime tested
OS + .NET version
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.1
OS Platform: Darwin
RID: osx.12-arm64
Base Path: /usr/local/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
6.0.101 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
git version
❯ git --version
git version 2.34.1
- 主要言語
- 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
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
sillsdev/languageforge-lexbox#2665 ·
-
C: Syntax
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug documentation frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
azurenoops/spin_agent#975 ·
-
: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 件 ·