-
Notifications
You must be signed in to change notification settings - Fork 651
[Question] Support for Mono #264
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
Comments
The issue is libgit2 and libgit2sharp. It would have to ship different versions of the native library to work on different operating systems afaik. I seem to remember there being a thread about this. @nulltoken can probably tell you more |
Ah, good point. I have never built anything targeted at Mono, so wouldn't know where to start conditionally compiling the included DLL's depending on the target. Doesn't seem like it should be outwith the realm of possibility though. |
@gep13 Well, LibGit2Sharp actually runs on Mono. But, currently, this requires the user to build his/her own version of libgit2 (See https://github.com/libgit2/libgit2sharp/blob/vNext/build.libgit2sharp.sh). @Therzok is maintaining a repo for Windows and Mac versions of libgit2 at https://github.com/mono/libgit-binary However, I'm not sure how many versions of the compiled binaries we should maintain for other *nix plaforms (@carlosmn @ethomson Thoughts?) |
I think it's worth mentioning that my versions of the binaries support SSH. |
@nulltoken before you think I don't want to push the changes, it's because I haven't modeled a proper API for credentials. I've written some stubs which work. :P |
@nulltoken regarding how I build libgit2sharp inside MD. For Windows and Mac I build libgit2sharp and copy the binaries to the output directory. |
So, as a noob to this sort of thing, let's say I wanted to run GitVersion, using Mono, on an Ubuntu machine. What would be the process for getting this done?
Is that about right? Or am I completely off? |
Make sure the libgit2 native livrary binaries are side-by-side with the libgit2sharp DLLs so you don't have to mess with library resolver path settings. Otherwise, it lgtm. |
@Therzok is this same-directory loading a mono extension? The documentation suggests that it simply delegates to @nulltoken the binaries shouldn't be in kept in the repo, and there's too many variations to reasonably keep them in a single place. The way to distribute binary libraries on unix is to make use of the package manager for a particular OS of family which can depend on the zlib, openssl, libssh2 and http-parser packages. Otherwise you're either going to have to ship a very limited version of libgit2 or field that kind of support requests. |
@carlosmn the way I implemented it in MD is without adding the libgit2 path to LD_LIBRARY_PATH. I have used |
otool -L libgit2-69db893.dylib
|
The sequence of commands I've used in this was: |
@carlosmn but on Linux it should justwork™. Linux user reported it worked without any extra effort if the libgit2 binaries are side-by-side with the libgit2sharp dlls. |
That shows how you can ship the dependencies of libgit2, but not how mono/ |
Simply setting -id to the filename works. |
No, no .dll.config. those are all the changes implied. Same directory files, those linker changes. That is all. |
@carlosmn Here's a script I wrote which takes binaries you ship in a directory called 'mac' and makes dylibs loadable from the same directory as a managed dll. https://github.com/mono/sharpsvn-binary/blob/master/fix_links.sh |
So, I must have sounded like I know more than I do, because you two have successfully lost me :-) Would it be possible for either of you to break down each of the steps that I listed into actual implementation steps? i.e. how are each of them done? I get the premise of how to do each one, but how I would actually build the native DLL's I wouldn't know where to start. Venturing into the unknown here, I am Windows through and through just now :-) |
@gep13 to build libgit2sharp and the libgit2 which works with it, you run |
Thanks for the information! I am not planning on shipping anything just now, this is really just an investigation I am doing to see what is possible :-) |
So it turns out the looking in the current path is the behaviour for Mach's |
Just as a reference (for search and such), I ran into this problem just now on OS X 10.9.5 with Mono 3.10.0, while running
It would be nice if GitVersion could conditionally bundle up the right version of LibGit2Sharp on the different platforms, somehow. Could this be solved through NuGet by having different package references on different platforms (if LibGit2Sharp even exists pre-built for other platforms than Windows)? |
It would be great to have mono support and make GitVersion cross platform. It needs a champion to make this feature happen, if anyone wants to take it on feel free! |
Quick heads up. Check @bording's libgit2/libgit2sharp#984. It should help running LibGit2Sharp on non-Windows platform by embedding the Win/Mac OS X/Linux compiled binaries in a separate NuGet package. |
That is awesome news @nulltoken. When this drops it would be good to try and get GitVersion running on mac/linux :D |
@JakeGinnivan That was the plan 😉 I'll keep you updated when it's ready for battlefield testing |
@JakeGinnivan Latest prerelease package ( |
Any progress? |
Nope, still up for grabs if anyone wants to have a crack at it |
👍 would love to see this happen, esp to get Xamarin builds on OSX for iOS working the same as the Windows agents |
I have made an attempt to upgrade to the latest prerelease of LibGit2Sharp to fix this for GitVersionTask, as it broke the build of one of my projects on mono. Due to a problem with how mono searches for dlls, I had to place them in libNativeBinaries instead of NativeBinaries. There is a discussion about this here: libgit2/libgit2sharp#1170 This has received limited testing, but it works for compiling a medium sized project with mono 4.0.3 on Ubuntu 15.04. |
What about switching to ngit? As it is fully managed library? @Therzok |
@hazzik NGit is unmaintained, and we switched away from it in MonoDevelop because of various issues that arose when using it. Updating it is not an easy task either. |
It seems by the comments on #638 that mono now works on x86/amd64 for Linux. Mono on OSX remains unresolved. https://gist.github.com/ghuntley/f7f9a120ab40a69f56e9 using
|
Does GitVersion support running under Mono?
If not, are there any plans to support?
The text was updated successfully, but these errors were encountered: