libgit2 / libgit2/libgit2sharp
Enable static linking of libgit2 (NativeLibrary / DirectPInvoke) for NativeAOT builds
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 dotnet publish -p:PublishAot=true 场景以及链接的 Microsoft Docs Native AOT 互操作参考开始。确定 LibGit2Sharp 如何公开 NativeLibrary/DirectPInvoke 元数据,并将其打包用于静态 libgit2 链接。完成的标准是,NativeAOT publish 生成一个可执行文件,而不需要单独的 libgit2 DLL、.so 或 .dylib。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- build-system, tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100