libgit2 / libgit2/libgit2sharp
Running from Native AOT app fails to build signature
未关闭
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
This is a clean repro:
#:package LibGit2Sharp@0.*
#:package Spectre.Console@0.*
using System;
using LibGit2Sharp;
using Spectre.Console;
using var repo = new Repository(Environment.CurrentDirectory);
var signature = repo.Config.BuildSignature(DateTimeOffset.Now);
if (signature == null)
{
AnsiConsole.MarkupLine("[red] Unexpected error: Git user.name and/or user.email are not configured.[/]");
return 1;
}
else
{
AnsiConsole.MarkupLine($"[lime]{signature}[/]");
return 0;
}
When running this script from a git repo dir with dotnet run --file repro.cs, you get the proper signature built from the found config.
Doing dotnet publish repro.cs and then running it from artifacts\repro\repro.exe will result in the error path consistently.
The PR #2188 fixes it and can be verified by changing the above repro script to use my CI feed:
#:package LibGit2Sharp@0.31.1
#:package Spectre.Console@0.*
#:property RestoreSources=https://api.nuget.org/v3/index.json;https://pkg.kzu.app/index.json
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从提供的 repro.cs 脚本开始,将 dotnet run --file repro.cs 与 dotnet publish repro.cs 进行比较,然后运行 artifacts\repro\repro.exe。查看 PR #2188,并验证已发布的 Native AOT 应用会根据配置构建预期的 Git 签名,而不是走错误路径。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- build-system
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 35/100