libgit2 / libgit2/libgit2sharp
Running from Native AOT app fails to build signature
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided repro.cs script and compare dotnet run --file repro.cs with dotnet publish repro.cs followed by running artifacts\repro\repro.exe. Review PR #2188 and verify that the published Native AOT app builds the expected Git signature from configuration instead of taking the error path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100