libgit2 / libgit2/libgit2sharp
Running from Native AOT app fails to build signature
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 3.5k
- Fork
- 925
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với script repro.cs được cung cấp và so sánh dotnet run --file repro.cs với dotnet publish repro.cs, sau đó chạy artifacts\repro\repro.exe. Xem xét PR #2188 và xác minh rằng ứng dụng Native AOT đã publish xây dựng chữ ký Git mong đợi từ cấu hình thay vì đi theo nhánh lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, git
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 35/100