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

Dll not found while trying to get git version of a repo #55

Open
patriksvensson opened this issue Nov 1, 2017 · 6 comments
Open

Dll not found while trying to get git version of a repo #55

patriksvensson opened this issue Nov 1, 2017 · 6 comments

Comments

@patriksvensson
Copy link
Member

patriksvensson commented Nov 1, 2017

Moved from cake-build/cake#1906
Originally asked by @johnnyasantoss

What You Are Seeing?

I'm having problems to get the git version of a repo using Cake.Git.
I think that the problem has something to do with the relative path for the .so file.

What is Expected?

Get the latest tag of the repo.

What version of Cake are you using?

  • 0.22.1

Are you running on a 32 or 64 bit system?

  • 64

What environment are you running on? Windows? Linux? Mac?

I'm using a docker image to build my project (or trying to).
Image: johnnyasantoss/dotnet-mono-docker:dotnet2.0-mono5.2-sdk

How Did You Get This To Happen? (Steps to Reproduce)

I tried to run a task and after compiling I got this error message.

Output Log

Gist: https://gist.github.com/anonymous/592a7073ba70b570b1090c92a39545df

@johnnyasantoss
Copy link

@johnkors
Copy link

I have the same issue, @patriksvensson .

Repro non-working Cake.Git on Linux: https://travis-ci.org/johnkors/cakegit/jobs/351972745#L2503

@johnkors
Copy link

A workaround/fix from @devlead on gitter.im: Using a Ubuntu base image instead of say Debian based ( microsoft/sdk-2.1 is Debian based when on Linux containers).

Example of working Ubuntu image: FROM devlead/bitbucket-pipelines-dotnet.

@devlead
Copy link
Member

devlead commented Mar 19, 2018

Seems to be related to
libgit2/libgit2sharp#1533

@davidvedvick
Copy link

I'm getting this issue as well. I've tried the posted workaround, and it had no effect :( here's the error I'm getting (note this is gitversion throwing the error):

========================================
GetVersion
========================================

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
An error occurred when executing task 'GetVersion'.
Error: One or more errors occurred.
        GitVersion: Process returned an error (exit code 255).

@johnkors
Copy link

johnkors commented Aug 3, 2018

The solution given here helped me out.

#68 (comment)

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

5 participants