Description
When trying to run the libgit2sharp tests (freshly cloned repo) on my Apple Silicon Mac (arm64), using the arm64 version of the .NET 6 SDK, all tests fail with an exception. If I use the x64 SDK, it runs just fine.
Reproduction steps
Just clone the repo, add binaries NuGet package, try to run tests.
Expected behavior
Tests should pass.
Actual behavior
LibGit2Sharp.LibGit2SharpException
invalid config path selector 1874839136
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /Playground/libgit2sharp/LibGit2Sharp/Core/Ensure.cs:line 154
at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /Playground/libgit2sharp/LibGit2Sharp/Core/Ensure.cs:line 172
at LibGit2Sharp.Core.Proxy.git_libgit2_opts_set_search_path(ConfigurationLevel level, String path) in /Playground/libgit2sharp/LibGit2Sharp/Core/Proxy.cs:line 3436
at LibGit2Sharp.GlobalSettings.SetConfigSearchPaths(ConfigurationLevel level, String[] paths) in /Playground/libgit2sharp/LibGit2Sharp/GlobalSettings.cs:line 337
at LibGit2Sharp.Tests.TestHelpers.BaseFixture.BuildFakeConfigs(IPostTestDirectoryRemover dirRemover) in /Playground/libgit2sharp/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs:line 125
at LibGit2Sharp.Tests.TestHelpers.BaseFixture..ctor() in /Playground/libgit2sharp/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs:line 20
at LibGit2Sharp.Tests.ArchiveTarFixture..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
This is here:
public static void git_libgit2_opts_set_search_path(ConfigurationLevel level, string path)
{
var res = NativeMethods.git_libgit2_opts((int)LibGit2Option.SetSearchPath, (uint)level, path);
Ensure.ZeroResult(res);
}
level
is 4, but seems to get marshalled wrong to libgit2 (where it seems to arrive as 1874839136).
Version of LibGit2Sharp (release number or SHA1)
Operating system(s) tested; .NET runtime tested
MacOS Monterey 12.3, Apple Silicon, .NET 6 Arm64 SDK