mergestat / mergestat-lite

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊
https://mergestat.com/
MIT License
3.47k stars 105 forks source link

Build fails with any libgit2 version other than v1.0 #81

Closed kevin-cantwell closed 3 years ago

kevin-cantwell commented 3 years ago

I'm running OSX Catalina with libgit2 v1.1.0:

$ brew info --installed --json | jq '.[] | select(.name == "libgit2") | .versions'
{
  "stable": "1.1.0",
  "head": "HEAD",
  "bottle": true
}

I cannot build askgit due to a git2go version incompatibility with my libgit2 version:

$ make build
go build -v -tags="sqlite_vtable,static,system_libgit2" askgit.go
github.com/augmentable-dev/askgit/pkg/gitlog
github.com/libgit2/git2go/v30
# github.com/libgit2/git2go/v30
../../../../go/pkg/mod/github.com/libgit2/git2go/v30@v30.2.2/git_system_static.go:11:3: error: "Invalid libgit2 version; this git2go supports libgit2 v1.0"
# error "Invalid libgit2 version; this git2go supports libgit2 v1.0"
  ^
1 error generated.
make: *** [build] Error 1

The git2go module has very strict libgit2 version dependencies: https://github.com/libgit2/git2go#which-go-version-to-use

I was able to successfully build askgit by replacing github.com/libgit2/git2go/v30 with github.com/libgit2/git2go/v31, but I imagine this would break things for those with older libgit2 versions.

patrickdevivo commented 3 years ago

hi @kevin-cantwell thanks for pointing this out! Looks like we should upgrade to github.com/libgit2/git2go/v31 which will then require a 1.1 libgit2 to build.