Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JeremyCade opened this issue Oct 21, 2018 · 14 comments

Comments

@JeremyCade
Copy link

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)$ 
@JeremyCade JeremyCade changed the title GitVersion.CommandLine.DotNetCore 4.0.0 Borks on Ubuntu 18.04 with DLLNotFoundException GitVersion.CommandLine.DotNetCore 4.0.0 Borks on Ubuntu 18.04 with DllNotFoundException Oct 21, 2018
@JeremyCade JeremyCade changed the title GitVersion.CommandLine.DotNetCore 4.0.0 Borks on Ubuntu 18.04 with DllNotFoundException GitVersion.CommandLine.DotNetCore 4.0.0 borks on Ubuntu 18.04 with DllNotFoundException Oct 21, 2018
@gep13
Copy link
Member

gep13 commented Oct 21, 2018

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

libgit2/libgit2sharp.nativebinaries#74

@LordMike
Copy link

LordMike commented Nov 9, 2018

@gep13 the PR mentioned has now merged.

@dazinator
Copy link
Member

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.

@mikesigs
Copy link

mikesigs commented Apr 9, 2019

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

@GeorgDangl
Copy link

Is there any update on this issue?

@PashCracken
Copy link

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

@dazinator
Copy link
Member

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

@PashCracken
Copy link

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

@GeorgDangl
Copy link

GeorgDangl commented Jun 3, 2019

I’m 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’t really use another GitVersion approach, e.g. the dotnet tool, since I’m 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.

@mikesigs
Copy link

mikesigs commented Jun 5, 2019

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)

@asbjornu
Copy link
Member

@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.

@PashCracken
Copy link

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

@arturcic
Copy link
Member

Thank you for the confirmation 👍

@JeremyCade
Copy link
Author

Can confirm this is fixed with 5.0.0-beta4-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants