libgit2 / libgit2/libgit2sharp
Enable static linking of libgit2 (NativeLibrary / DirectPInvoke) for NativeAOT builds
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
IncludeNativeLibrariesForSelfExtractis 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
- Microsoft Docs — “Native AOT interop”
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Ö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