filhodanuvem / gitql

💊 A git query language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static binary release

jsixface opened this issue · comments

To eliminate the dynamic dependency on libgit2 / git2go and do a static binary build on all three platforms - Linux/Mac/Windows.

I looked into the possibility of making a static build, but that is kind of impossible since libigt2 has dependencies.

Note that even if libgit2 is included in the resulting binary, its dependencies will not be.

https://github.com/libgit2/git2go#master-branch-or-static-linking

The best I can think of is, to setup go module, include a versioned branch of git2go in go dependency and have libgit2, openSSL and LibSSH2 as separately installed dependency.

Thanks for the research @jsixface . That's something that I don't know exactly how to solve keeping libgit2 as dependecny 😿.
If you if find anything else please send it for us here.

Hey @navigaid , first of all thanks a lot for the effort.
When gitql was cretead we didn't have go modules so the best way to make sure that git2go would not break the compiling was to fork it and point to cloudson/git2go. If you think that we need to upgrade cloudson/git2go, we can do that.

Can you make a pull request with your gitql changes and the git2go upgrade?

The problem of use github.com/libgit2/git2go without go modules is that they can upgrade the
lib breaking compatibility (it already happened before). That's why I'm in favor to keep cloudson/git2go until go modules support.

So, for me, we could merge your changes of gitql + static compilation pointing to an upgraded cloudson/git2go.
After that we can move to go modules and remove cloudson/git2go. The intent is to have baby steps and smaller changes. What do you think?

If breaking changes in upstream is a problem, we can go with a versioned branch in go module dependency.

[[constraint]]
  branch = "v27"
  name = "gopkg.in/libgit2/git2go.v27"

I have a version that works with go module. But it is little lagging behind.
https://github.com/jsixface/gitql/tree/git2go

@jsixface we have now static binaries for windows and linux so I'm going to close this. For macos it something that we need to improve but we also need to track if most of the users use mac and require this.

What is the issue with static binary for MacOS. I can give it a try.