-
Notifications
You must be signed in to change notification settings - Fork 654
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 on VSTS fails with hosted macOS and Linux agents #1497
Comments
can you have a look at this? https://github.com/GitTools/GitVersion/blob/master/src/Docker/linux/fullfx/Dockerfile#L5. Looks like you need you install that |
Hmm, I'm not sure if I can install it on the hosted build agents, will have to look into that. That being said, I'm not sure if it's something you would want. It doesn't make it necessarily easy to use. Would be an option to embed the library into the extension somehow? Does that make sense? |
Actually it is included, there is a lib folder there and it should use that one, but does not seem to work |
Ah, I see it is included in the VSIX indeed, including a version for each platform. But I guess that GitVersion.exe is unable to locate that library at runtime. That begs the question why it works on Windows though. Perhaps the Windows agents have this library installed on the system somewhere? The question is, can we make GitVersion.exe look inside the lib folder. |
I think it's not related to GitVersion but with the way libgit2sharp loads the native methods libgit2/libgit2sharp#1583 |
Okay, so it looks like we have 2 options: update libgit2sharp to it's latest version (it seems that GitVersion is using a preview version at the moment?), or move the native libraries next to GitVersion.exe, but then we would probably need to have a different folder structure inside of the build task entirely. |
Unfortunately GitVersion is extremely fragile due to LibGit2Sharp requiring native binaries for LibGit2 which in turn require correct versions of libssl and libcurl and vary from one distribution to the next. It might get better soon if the LibGit2Sharp developers proceed with this PR which will remove the libssl and libcurl requirements by implementing that functionality directly in managed .NET code rather than funneling it down to the native LibGit2 implementations. |
FYI, I created a PR for a .NET Core build task: |
Under macOS (10.14), I got the command line call running from Terminal by setting the environment variable DYLD_LIBRARY_PATH to the absolute path of _work/tasks/GitVersion*/4.0.3/lib/osx. As said earlier in this thread by others, I also suspect that GitVersion.exe is not able to find libgit2-*.dylib inside its own subdirectory. According to otool -L all dependencies of libgit2 are met, e.g. libcurl in /usr/lib. |
As a workaround you can use these libgit2/libgit2sharp#1583 (comment) |
This worked for me using - bash: |
shopt -s nullglob
function join_by { local IFS="$1"; shift; echo "$*"; }
lib_path=$(join_by ';' $(Agent.WorkFolder)/_tasks/GitVersion*/4.0.*/lib/linux/x86_64)
echo LD_LIBRARY_PATH: $lib_path
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$lib_path"
displayName: Update LD_LIBRARY_PATH for GitVersion |
Kind regards, you beautiful human being :) |
In case someone needs it for macOS: - bash: |
shopt -s nullglob
function join_by { local IFS="$1"; shift; echo "$*"; }
lib_path=$(join_by ';' $(Agent.WorkFolder)/_tasks/GitVersion*/4.0.*/lib/osx)
echo LD_LIBRARY_PATH: $lib_path
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$lib_path"
displayName: Update LD_LIBRARY_PATH for GitVersion |
This is awesome. Worked smooth like butter |
As LibGit2Sharp was upgraded to version 0.26 in #1713, I hope this problem is remedied. If it isn't, at least we have the workarounds provided by @beatcracker and @jeromelaban above. 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. |
Since version 4.0.0 of GitVersion it seems to be supported to use the GitVersion build task in VSTS on a macOS and/or Linux agent. I've been trying this, but I'm getting the following error:
On Windows this works just fine. I looks like there's a native assembly missing somewhere. Perhaps that's an issue with the bundling of the VSTS extension, or maybe something needs to be installed on the build machine, but I'm not sure.
The text was updated successfully, but these errors were encountered: