Skip to content

[Question] Support for Mono #264

Closed

Description

@gep13

Does GitVersion support running under Mono?

If not, are there any plans to support?

Activity

  1. JakeGinnivan commented on Oct 1, 2014

    @JakeGinnivan
    Contributor

    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

  2. gep13 commented on Oct 1, 2014

    @gep13
    MemberAuthor

    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.

  3. nulltoken commented on Oct 2, 2014

    @nulltoken
    Contributor

    @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?)

  4. Therzok commented on Oct 2, 2014

    @Therzok

    I think it's worth mentioning that my versions of the binaries support SSH.

  5. Therzok commented on Oct 2, 2014

    @Therzok

    @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

  6. Therzok commented on Oct 2, 2014

    @Therzok

    @nulltoken regarding how I build libgit2sharp inside MD.

    For Windows and Mac I build libgit2sharp and copy the binaries to the output directory.
    For Linux, I run a slightly modified version of the build.libgit2sharp.sh file to enable ssh. Grab the native binaries output directory and copy paste them.

  7. gep13 commented on Oct 2, 2014

    @gep13
    MemberAuthor

    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?

    • Ensure that everything in GitVersion itself is Mono Compliant
    • Build LibGit2 on an Ubuntu Distro
    • Take the compiled DLL's and build LibGit2Sharp
    • Take both DLL's and reference them in GitVersion
    • Run the resulting exe on Ubuntu using mono

    Is that about right? Or am I completely off?

  8. Therzok commented on Oct 2, 2014

    @Therzok

    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.

  9. carlosmn commented on Oct 2, 2014

    @carlosmn

    @Therzok is this same-directory loading a mono extension? The documentation suggests that it simply delegates to dlopen(3) which won't do that unless you have '.' in LD_LIBRARY_PATH or the rpath option is given to the linker, which won't happen by default.

    @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.

  10. Therzok commented on Oct 2, 2014

    @Therzok

    @carlosmn the way I implemented it in MD is without adding the libgit2 path to LD_LIBRARY_PATH. I have used install_name_tool on the native binaries to use @loader_path, maybe that's why it works. :P

  11. Therzok commented on Oct 2, 2014

    @Therzok

    otool -L libgit2-69db893.dylib

    libgit2-69db893.dylib:
        libgit2-69db893.dylib (compatibility version 21.0.0, current version 0.21.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
        /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 50.0.0)
        /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 50.0.0)
        @loader_path/libssh2.dylib (compatibility version 2.0.0, current version 2.1.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    
  12. Therzok commented on Oct 2, 2014

    @Therzok

    The sequence of commands I've used in this was:
    install_name_tool -id libgit2-69db893.dylib libgit2-69db893.dylib
    install_name_tool -change <absolute_path_to_libssh2> @loader_path/libssh2.dylib

  13. Therzok commented on Oct 2, 2014

    @Therzok

    @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.

  14. carlosmn commented on Oct 2, 2014

    @carlosmn

    That shows how you can ship the dependencies of libgit2, but not how mono/LibGit2Sharp.dll knows to load libgit2-abcd.so from the current directory, since doing this should precisely not work unless you take extra steps. Do you have a LibGit2Sharp.dll.config file that lets you do that?

  15. Therzok commented on Oct 2, 2014

    @Therzok

    Simply setting -id to the filename works.

  16. 10 remaining items

  17. JakeGinnivan commented on Feb 15, 2015

    @JakeGinnivan
    Contributor

    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!

  18. nulltoken commented on May 25, 2015

    @nulltoken
    Contributor

    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.

  19. JakeGinnivan commented on May 28, 2015

    @JakeGinnivan
    Contributor

    That is awesome news @nulltoken. When this drops it would be good to try and get GitVersion running on mac/linux :D

  20. nulltoken commented on May 28, 2015

    @nulltoken
    Contributor

    @JakeGinnivan That was the plan 😉 I'll keep you updated when it's ready for battlefield testing

  21. nulltoken commented on May 29, 2015

    @nulltoken
    Contributor

    @JakeGinnivan Latest prerelease package (0.22.0-pre20150529055949) is waiting for you, Sir!

  22. therosco commented on Jul 1, 2015

    @therosco

    Any progress?

  23. JakeGinnivan commented on Jul 1, 2015

    @JakeGinnivan
    Contributor

    Nope, still up for grabs if anyone wants to have a crack at it

  24. clairernovotny commented on Sep 9, 2015

    @clairernovotny

    👍 would love to see this happen, esp to get Xamarin builds on OSX for iOS working the same as the Windows agents

  25. BeeWarloc commented on Sep 10, 2015

    @BeeWarloc

    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.

    #638

    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.

  26. hazzik commented on Nov 25, 2015

    @hazzik

    What about switching to ngit? As it is fully managed library? @Therzok

  27. Therzok commented on Nov 25, 2015

    @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.

  28. ghuntley commented on Feb 15, 2016

    @ghuntley
    Contributor

    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

    <title>GitVersion.CommandLine</title>
    <version>3.4.1</version>
    
    $ mono --version
    Mono JIT compiler version 4.2.2 (explicit/996df3c Wed Jan 20 00:19:48 EST 2016)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug
    LLVM:          yes(3.6.0svn-mono-(detached/a173357)
    GC:            sgen
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions