cake-contrib / Cake_Git

Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp
https://cakebuild.net/extensions/cake-git
Other
39 stars 64 forks source link

Native DLL not found on Ubuntu #25

Closed Symbianx closed 7 years ago

Symbianx commented 7 years ago

Hello, I'm trying to run a build script that uses this addin, although it works on Windows, I'm not able to use it on Ubuntu, the error says:

'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: git2-381caf5

There is a file named libgit2-381caf5.so in the tools/Addins/Cake.Git/lib/linux/x86_64 folder, is this a naming inconsistency issue? Am I missing something?

Thank you

kuzyasun commented 7 years ago

I have the same issue on Mac Os(


System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundExcepti
on: git2-381caf5
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00006] in <09955a9a1ab74ea48369d47718fc9eb5>:0
  at LibGit2Sharp.Core.NativeMethods..cctor () [0x00058] in <09955a9a1ab74ea48369d47718fc9eb5>:0
   --- End of inner exception stack trace ---
  at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject.Finalize () [0x00000] in <09955a9a1ab74ea48369d47718fc9eb5>:0```
liddellj commented 7 years ago

I'm seeing the same thing on Ubuntu 16. Under tools/Addins/Cake.Git I have a file called LibGit2Sharp.dll, and under tools/Addins/Cake.Git/lib/linux/x86_64 I have libgit2-381caf5.so, as per @Symbianx mentioned above.

devlead commented 7 years ago

@Symbianx @liddellj Found issue for Linux, you likely need to install libcurl3. Run sudo get-get install libcurl3. @kuzyasun haven't had chance to check Mac yet. will push a new version with newer Libgit shortly though.

kuzyasun commented 7 years ago

I've solved my problem just copied file libgit2-381caf5.dylib from lib to tools\Addins\Cake.Git\libgit2-381caf5.dylib

devlead commented 7 years ago

@kuzyasun Interesting. Just pushed a new version ( https://www.nuget.org/packages/Cake.Git/0.12.0 ), it should be avail shortly. It uses a newer version of Libgit. Please see if that have the same issue if so we would just move up the dylib one level. New native version is libgit2-a5cf255.

devlead commented 7 years ago

@kuzyasun at least integration tests executed fine on Mac & Linux with latest version: https://travis-ci.org/WCOMAB/Cake_Git/jobs/190659823

Symbianx commented 7 years ago

@devlead I already had libcurl3 installed. Removing the tools folder to force the download of the new version you released worked. 🎉 🙌

devlead commented 7 years ago

@Symbianx excellent 👍