GitVersion.CommandLine.DotNetCore 4.0.0 borks on Ubuntu 18.04 with DllNotFoundException

Created on 21 Oct 2018  路  14Comments  路  Source: GitTools/GitVersion

jeremy@loki:subete.dttlo (develop *)$ dotnet tools/GitVersion.CommandLine.DotNetCore.4.0.0/tools/GitVersion.dll
INFO [10/21/18 16:59:12:08] Working directory: /home/jeremy/src/subete/subete.dttlo
INFO [10/21/18 16:59:12:09] IsDynamicGitRepository: False
ERROR [10/21/18 16:59:12:13] An unexpected error occurred:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'git2-15e1193': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)
   at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
   at LibGit2Sharp.Core.NativeMethods.LoadNativeLibrary()
   at LibGit2Sharp.Core.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf)
   at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
   at LibGit2Sharp.Repository.Discover(String startingPath)
   at GitVersion.GitPreparer.GetDotGitDirectory() in C:\projects\gitversion\src\GitVersionCore\GitPreparer.cs:line 163
   at GitVersion.GitPreparer.GetProjectRootDirectory() in C:\projects\gitversion\src\GitVersionCore\GitPreparer.cs:line 177
   at GitVersion.ConfigurationProvider.Verify(GitPreparer gitPreparer, IFileSystem fileSystem) in C:\projects\gitversion\src\GitVersionCore\Configuration\ConfigurationProvider.cs:line 268
   at GitVersion.Program.VerifyArgumentsAndRun()
INFO [10/21/18 16:59:12:13] 
INFO [10/21/18 16:59:12:13] Attempting to show the current git graph (please include in issue): 
INFO [10/21/18 16:59:12:13] Showing max of 100 commits
Segmentation fault (core dumped)

DotNet Core Runtimes / SDKs

jeremy@loki:~ (master)$ dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
jeremy@loki:~ (master)$ dotnet --list-sdks
2.1.105 [/usr/share/dotnet/sdk]
2.1.200 [/usr/share/dotnet/sdk]
2.1.403 [/usr/share/dotnet/sdk]
jeremy@loki:~ (master)$ 

All 14 comments

Currently, LibGit2Sharp doesn鈥檛 work/support Ubuntu 18.04. There is an open PR for it though:

https://github.com/libgit2/libgit2sharp.nativebinaries/pull/74

@gep13 the PR mentioned has now merged.

I think this is waiting on pr #1422 to be merged, If you want to test it sooner you could try a build of that PR.

It looks like the fix for this is included in LibGit2Sharp v0.26.0. Can we pretty please get this updated in GitVersion v4? We are using AWS CodeBuild and it uses Ubuntu 18.04 and we're completely dead in the water because of this silly libcurl4 issue.

Thanks!

https://github.com/libgit2/libgit2sharp/blob/a709ab84d4/CHANGES.md#v026---diff

The underlying native library (libgit2) now no longer relies on libcurl

Is there any update on this issue?

Any progress on this? Would really like to see it fixed

Have you tried the 5.0.0 beta release? https://www.nuget.org/packages/GitVersion.CommandLine.DotNetCore/5.0.0-beta3-4

There is also a dotnet cli global tool now you might be interested in: https://www.nuget.org/packages/GitVersion.Tool/5.0.0-beta3-4

I tried to use the latest 5.0.0 beta global tool on Ubuntu 18.04. It still fails with the same error

I鈥檓 actually using the beta release. Both beta3-4 and the latest one (3-27 I think) have this issue. As far as I understand it, it requires an update of the LibGit2 dependency to be resolved.

I can鈥檛 really use another GitVersion approach, e.g. the dotnet tool, since I鈥檓 just consuming it via the NUKE build project (cc FYI @matkoch)

My CI workaround is to serialize the GitVersion Information in a Windows node and then use that on a Linux node.

If docker is an option for you, that was the best solution we found to overcome this problem.
There is an "official" image out there for running GitVersion inside a container, where it has all the requirements it needs built in. gittools/gitversion-dotnetcore

Here's an example usage:

GITVERSION_INFO=$(docker run --rm -v "$(pwd):/repo" gittools/gitversion-dotnetcore:linux-4.0.0 /repo)
export INFORMATIONAL_VERSION=$(echo $GITVERSION_INFO | jq -r .InformationalVersion)

@JeremyCade, as LibGit2Sharp was upgraded to version 0.26 in #1713, we hope this problem should be gone now. Can you please try [the latest buildhttps://www.nuget.org/packages/GitVersionCore/5.0.0-beta4-1) and let us know how that works for you? Please reopen if you still have issues.

I can confirm that version 5.0.0-beta4-1 works great on my Ubuntu WSL. Great job on the fix :-)

Thank you for the confirmation 馃憤

Can confirm this is fixed with 5.0.0-beta4-1

Was this page helpful?
0 / 5 - 0 ratings