GitVersion
GitVersion copied to clipboard
Run Gitversion on Red Hat
I know that this topic was mentioned before but I stills not understand why I have errors so before close please read to end :)
I also want to mention that I know solution using docker image but... it is little pain because when using on build agent main benefit of gitversion was automatic set of environment variables and with docker it is not working.
My error is the classic "The type initialize for 'LibGit2Sharp.Core.NativeMethods' threw an exception" when I tried to run gitversion.tool (version 5.10.1) on my Red Hat Enterprise Linux release 8.5. I checked in .nuget folder and see native version /.nuget/packages/gitversion.tool/5.10.1/tools/netcoreapp3.1/any/runtimes/linux-x64/native/libgit2-b7bad55.so
I prepared some test project to use LibGit2Sharp manually in hope to see more detailed error
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182" />
with simple code
using (var repo = new Repository(path))
{
var commits = repo.Commits.Count();
Console.WriteLine($"Commits:{commits}");
}
I checked that this version also uses libgit2-b7bad55.so but when I run my program.... it is working. I also checked Nerdbank.GitVersioning that is using LibGit2Sharp and it is working also ;(
So my question is - why it is not working and are there any steps I can do to investigate problem or maybe there is a workaround?
That is interesting, we are testing the artifacts in several distros in docker, and no issues - including centos that has similar code as red hat. Unfortunately I have no way to test this issue on a real red hat environment, maybe it makes sense to add a docker test with a base image for red hat, but for now I would suggest you clone the repository on the redhat environment, checkout the support/5.x branch and try to debug the issue.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions