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 fails on linux (debian) #1203

Closed
mabead opened this issue Apr 13, 2017 · 5 comments
Closed

GitVersion fails on linux (debian) #1203

mabead opened this issue Apr 13, 2017 · 5 comments

Comments

@mabead
Copy link

mabead commented Apr 13, 2017

I start from a clean docker image of debian that contains mono:

docker run --name test -it --rm mono /bin/bash

Then, inside the container, I run these commands to get GitVersion.exe and run it:

apt-get update
apt-get install unzip
cd /tmp
curl -L https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.11/GitVersion_4.0.0-beta0011.zip -o GitVersion.zip
unzip GitVersion.zip -d GitVersion
cd GitVersion
mono GitVersion.exe

This fails with the following error:

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00006] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
  at LibGit2Sharp.Core.NativeMethods..cctor () [0x00058] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
   --- End of inner exception stack trace ---
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject.Finalize () [0x00000] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00006] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
  at LibGit2Sharp.Core.NativeMethods..cctor () [0x00058] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
   --- End of inner exception stack trace ---
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject.Finalize () [0x00000] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0

I then try to execute apt-get install libcurl3 as suggested on the GitVersion web site and it still fails this way:

root@aa9f70e08233:/tmp/GitVersion# apt-get install libcurl3
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcurl3 is already the newest version.
libcurl3 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@aa9f70e08233:/tmp/GitVersion# mono GitVersion.exe

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00006] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
  at LibGit2Sharp.Core.NativeMethods..cctor () [0x00058] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
   --- End of inner exception stack trace ---
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject.Finalize () [0x00000] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00006] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
  at LibGit2Sharp.Core.NativeMethods..cctor () [0x00058] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0
   --- End of inner exception stack trace ---
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject.Finalize () [0x00000] in <1a5aafd5a5444cd6a1420741ccbb6f8a>:0

Any idea of what I am missing?

@mabead mabead changed the title GitVersion fails on debian GitVersion fails on linux (debian) Apr 13, 2017
@asbjornu
Copy link
Member

Seems related to #1097 and #1125, which are both still unresolved. Not sure we can advance this in any way unless someone can take a lead on getting it fixed. I don't use Linux, so I'm not really in a good position to figure this out.

@mabead
Copy link
Author

mabead commented Apr 19, 2017

Good, I will try later to see if the workaround described in #1125 works for me.

@asbjornu
Copy link
Member

@mabead: Please have a look at #1097 (comment) and report back if that also works for you.

@JakeGinnivan
Copy link
Contributor

JakeGinnivan commented May 14, 2017

This issue is because the libgit2 config has a relative path, I am going to submit a PR later today with a docker build which will be released as part of GitVersions release. But you can grab a working image from gittools/gitversion right now. In this image I make the libgit2 reference absolute

Going to close this

@mabead
Copy link
Author

mabead commented May 15, 2017

@JakeGinnivan Thanks!

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

3 participants