libgit2 / libgit2/libgit2sharp

Support for MacCatalyst

Open
#2,059 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

Reproduction steps

Created a new .NET MAUI app and launched it with MacCatalyst. When making a call to Repository.IsValid(projectPath); it will throw the following. Looking at the output folder, the runtimes are not copied there. I have tried manipulating the output folder, but it doesn't seem to be able to resolve the native library properly.

{System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: git2-e632535
   at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() in **/_/LibGit2Sharp/Core/NativeMet…}**

Running the same command via a console application (.NET 7.0 CLI, not MacCatalyst) executes as expected.

Expected behavior

Native libraries should be copied to the output folder and made available, if possible, for the MacCatalyst platform.

Actual behavior

Native libraries are not copied over and cannot be referenced on MacCatalyst.

Version of LibGit2Sharp (release number or SHA1)

0.27.2

Operating system(s) tested; .NET runtime tested

.NET 7.0 via MacCatalyst-x64 (Mac M1).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing Repository.IsValid(projectPath) in a .NET 7 MacCatalyst-x64 app and inspect Core/NativeMethods along with the output folder. Compare the MacCatalyst output with the working console application's native runtime files; done means the required native library is copied and resolved on MacCatalyst.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.