Repository navigation
Closed
Description
I have F# project created with Forge where I use Paket and FAKE to manage things. My problem is same as described in GitVersion.CommandLine does not work on OS X.
Using FAKE's build.sh produces following error:
Checking Paket version (downloading latest stable)...
Paket.exe 3.30.0 is up to date.
Paket version 3.30.0
0 seconds - ready.
mono "<path removed>/packages/GitVersion.CommandLine/tools/GitVersion.exe"
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: GitVersion.exe failed with exit code 255
at [email protected] (System.String message) [0x00001] in <58343e1dccf1c534a74503831d3e3458>:0
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5584aad2904cf4daa7450383d2aa8455>:0
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a) [0x00038] in <5584aad2904cf4daa7450383d2aa8455>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5584aad2904cf4daa7450383d2aa8455>:0
at Fake.GitVersionHelper.GitVersion (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] setParams) [0x00045] in <58343e1dccf1c534a74503831d3e3458>:0
at <StartupCode$FSI_0005>.$FSI_0005_Build$fsx.main@ () [0x00008] in <629f008c31ba4d198101e488c9c57117>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00053] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at [email protected] (Microsoft.FSharp.Core.Unit unitVar0) [0x0008d] in <58343e1dccf1c534a74503831d3e3458>:0
System.Exception: GitVersion.exe failed with exit code 255
at [email protected] (System.String message) [0x00001] in <58343e1dccf1c534a74503831d3e3458>:0
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5584aad2904cf4daa7450383d2aa8455>:0
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a) [0x00038] in <5584aad2904cf4daa7450383d2aa8455>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5584aad2904cf4daa7450383d2aa8455>:0
at Fake.GitVersionHelper.GitVersion (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] setParams) [0x00045] in <58343e1dccf1c534a74503831d3e3458>:0
at <StartupCode$FSI_0005>.$FSI_0005_Build$fsx.main@ () [0x00008] in <629f008c31ba4d198101e488c9c57117>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
Stopped due to error
Running GitVersion.CommandLine manually produces this:
mono packages/GitVersion.CommandLine/tools/GitVersion.exe
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-381caf5.so
at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00006] in <3ab13c1aa72c4390898e735d2abfa167>:0
at LibGit2Sharp.Core.NativeMethods..cctor () [0x00058] in <3ab13c1aa72c4390898e735d2abfa167>:0
--- End of inner exception stack trace ---
at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject.Finalize () [0x00000] in <3ab13c1aa72c4390898e735d2abfa167>:0
The library that the complaint is about is present in the file system under lib directory beside GitVersion.exe and LibGit2Sharp.dll
$ ll packages/GitVersion.CommandLine/tools/
drwxr-xr-x 5 mclang 4.0K 2016-11-24 12:19 lib/
-rw-r--r-- 1 mclang 381K 2016-09-03 02:06 GitVersion.exe
-rw-r--r-- 1 mclang 44K 2016-09-03 02:06 GitVersion.pdb
-rw-r--r-- 1 mclang 413K 2016-09-03 02:06 LibGit2Sharp.dll
-rw-r--r-- 1 mclang 252 2016-09-03 02:06 LibGit2Sharp.dll.config
-rw-r--r-- 1 mclang 1.2M 2016-09-03 02:06 LibGit2Sharp.pdb
$ ll packages/GitVersion.CommandLine/tools/lib/linux/x86_64/libgit2-381caf5.so
-rw-r--r-- 1 mclang 1.1M 2016-09-03 02:06 packages/GitVersion.CommandLine/tools/lib/linux/x86_64/libgit2-381caf5.so
I am using Arch Linux with Mono version 4.6.1, F# 4.1, Paket 3.30.0, FAKE 4.45.3, GitVersion.CommandLine 3.6.4.
Creating GitVersion.exe.config file does not help... Any idea why the library is not found and how to fix this?
Metadata
Metadata
Assignees
Labels
No labels
Activity
mclang commentedon Nov 24, 2016
Noticing that there is file called
LibGit2Sharp.dll.config, I tried to change it to include full path into the required library. Doesn't help, but the exception message does change:asbjornu commentedon Nov 26, 2016
@mclang: Can you please try installing
libcurlas per #1101 and see if that helps?mclang commentedon Nov 28, 2016
I have newest available curl, which is 7.51.0-1, installed but I don't know if it has the required
libcurl3files. I also tried installing libcurl-compat package but that didn't help.This time tough I got longer error message that I missed in my first post:
mclang commentedon Nov 28, 2016
Maybe this helps:
For me at least it seems that I need to install
libcurl3somehow... I can't find it from Arch repositories or from AUR :(mclang commentedon Nov 28, 2016
With both 64bit abd 32bit
curlandlibcurl-compatinstalled I have/usr/lib/libcurl.so.3though:mclang commentedon Nov 28, 2016
I found this LibGit2Sharp issue: Unable to load native DLL if path contains %2F
May not be related because my project path does not contain spaces, but linking it here so that maybe somebody gets an idea.
asbjornu commentedon Nov 28, 2016
@mclang:
%2fis/, not space. It is quite common to use/as a separator in Git Flow, forfeature/*,hotfix/*,support/*, and similar branches. What is the name of the branch you're having this problem with?mclang commentedon Nov 28, 2016
Oh, okay... Should have checked that character code before posting :|
My project path is like:
/home/mclang/Projects/<project-name>. I'm usingmasterbranch so no forward slashes there.I searched for that
version 'CURL_OPENSSL_3' not foundmessage and found out that in many cases the program or library in question was compiled against an older libcurl. Can this be the case here also?mclang commentedon Dec 7, 2016
Hello
Any idea what I should try next?
asbjornu commentedon Dec 7, 2016
As the problem seems to be within LibGit2Sharp, it is going to be hard finding someone with knowledge of the problem in the GitVersion repository. Perhaps you can try to file an issue with LibGit2Sharp and see how you fare there? Sorry that I can't be of more assistance. 😕
mclang commentedon Dec 8, 2016
I'l do that in the issue linked above.
asbjornu commentedon Dec 8, 2016
@mclang: Okay. Fingers crossed!
sandorfr commentedon Feb 14, 2017
@asbjornu @mclang have you found a solution to your issue?
asbjornu commentedon Feb 17, 2017
@sandorfr: It seems like libgit2/libgit2sharp#1409 should remedy the problem, so we might investigate whether that has also been released and if so update LibGit2Sharp and see whether that helps. Are you or @mclang up for the task?
mclang commentedon Mar 30, 2017
Well I tried, sort of.
Probably what I did is stupid, but anyway... I have this in my
paket.dependenciesfile:After
paket installI tried as before and got:Then I copied the new prelease LibGit2Sharp files over the ones that current GitVersion provides:
Well... something happened but still no joy with using GitVersion:
Digging more, I found that
git2-1196807is located under LibGit2Sharp.NativeBinaries and gives:I can test more, but I need instructions how to proceed. Newer done before, you know.
asbjornu commentedon Mar 30, 2017
@mclang: The only thing I can think of is going through #890 and see if anything written there gives you ideas on how to move forward with this. @eatdrinksleepcode did some work related to this, so he might have some valuable input.
mclang commentedon Mar 30, 2017
I will check that out, thanks
mclang commentedon Apr 25, 2017
Could'n get GitVersion working yet, so I will follow @mabead's issue for now.
Too bad I don't currently have enough time to dig deeper...
mclang commentedon Apr 25, 2017
Whoa, this was unexpected :O
I got it working that is... What I did was:
LibGit2Sharp.dll.configaccordingly:Note that only the
targetneeds to be changed, leavedll="git2-baa87df"part as it is.I hope this workaround helps someone until LibGit2Sharp.NativeBinaries gets fixed.
mclang commentedon Apr 25, 2017
Even easier method that works at least on Antergos - use
libgit2.soprovided by the system:asbjornu commentedon Apr 25, 2017
@mclang: Thanks for the valuable information! Any idea how we can permanently fix this in GitVersion?
mclang commentedon Apr 26, 2017
Tough question because my case may be some kind of corner case.
Only thing that I can think of is if you can either change the
targetto point to the library installed on the system, or make a symbolic link to it.Workaround for GitVersion
Workaround for GitVersion
Workaround for GitVersion
Workaround for GitVersion