libgit2 / libgit2/libgit2sharp

Enable static linking of libgit2 (NativeLibrary / DirectPInvoke) for NativeAOT builds

Offen
#2,160 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C#
Sterne
3.5k
Forks
925
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Overview
Publishing with dotnet publish -p:PublishAot=true (NativeAOT) currently leaves the libgit2 native DLL/so/dylib in the output folder, preventing a true single-file distribution. If LibGit2Sharp exposed NativeLibrary / DirectPInvoke metadata to let the linker embed a static libgit2, NativeAOT users could ship just one executable.

Problems

  • NativeAOT disables the single-file bundler, so IncludeNativeLibrariesForSelfExtract is ignored and the native library is always emitted next to the .exe.
  • Distributors must ship extra files, and there is no self-extract logic at runtime.

Request
Please add official support for statically linking libgit2 when LibGit2Sharp is used with NativeAOT (for example, by publishing a package that injects the required NativeLibrary metadata).

Reference

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Szenario dotnet publish -p:PublishAot=true und der verknüpften Microsoft-Docs-Referenz zur Native-AOT-Interop. Ermittle, wie LibGit2Sharp NativeLibrary/DirectPInvoke-Metadaten offenlegen und sie für statisches libgit2-Linking paketieren kann. Als abgeschlossen gilt, wenn ein NativeAOT-Publish eine einzelne ausführbare Datei ohne separate libgit2-DLL, .so oder .dylib erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, git
Bereich
build-system, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.