GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

Run Gitversion on Red Hat

Open dominikjeske opened this issue 3 years ago • 1 comments

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?

dominikjeske avatar May 27 '22 10:05 dominikjeske

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.

arturcic avatar May 31 '22 16:05 arturcic

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.

github-actions[bot] avatar Mar 04 '23 13:03 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions

github-actions[bot] avatar Apr 04 '23 11:04 github-actions[bot]