LibGit2 v1.7 Support #960

Open
opened 2024-07-09 04:44:09 -05:00 by fulopattila122 · 2 comments
fulopattila122 commented 2024-07-09 04:44:09 -05:00 (Migrated from github.com)

I have an Ubuntu 24.04 box, that ships with libgit2 v1.7

apt show libgit2-1.7

Package: libgit2-1.7
Version: 1.7.2+ds-1ubuntu3

I was trying to install Splitsh Lite but ran into this error:

../../go/pkg/mod/github.com/libgit2/git2go/v34@v34.0.0/Build_system_dynamic.go:12:3: error: #error "Invalid libgit2 version; this git2go supports libgit2 between v1.5.0 and v1.5.0"
   12 | # error "Invalid libgit2 version; this git2go supports libgit2 between v1.5.0 and v1.5.0"
      |   ^~~~~

Since neither libgit2 1.6 nor 1.7 is present in the table in the README, I tried to use v35 (based on a pure guess) during the build, but that apparently doesn't exist:

go: downloading github.com/libgit2/git2go/v35 v35.0.0
go: github.com/splitsh/lite/splitter imports
	github.com/libgit2/git2go/v35: go.mod has non-.../v35 module path "github.com/libgit2/git2go/v34" (and .../v35/go.mod does not exist) at revision v35.0.0

Is there any way to build on a system that has libgit2 v1.7?

Thank you

I have an Ubuntu 24.04 box, that ships with libgit2 v1.7 > `apt show libgit2-1.7` > > Package: libgit2-1.7 > Version: 1.7.2+ds-1ubuntu3 I was trying to install [Splitsh Lite](https://github.com/splitsh/lite?tab=readme-ov-file#manual-installation) but ran into this error: ``` ../../go/pkg/mod/github.com/libgit2/git2go/v34@v34.0.0/Build_system_dynamic.go:12:3: error: #error "Invalid libgit2 version; this git2go supports libgit2 between v1.5.0 and v1.5.0" 12 | # error "Invalid libgit2 version; this git2go supports libgit2 between v1.5.0 and v1.5.0" | ^~~~~ ``` Since neither libgit2 1.6 nor 1.7 is present in the [table in the README](https://github.com/libgit2/git2go#which-go-version-to-use), I tried to use v35 (based on a pure guess) during the build, but that apparently doesn't exist: ``` go: downloading github.com/libgit2/git2go/v35 v35.0.0 go: github.com/splitsh/lite/splitter imports github.com/libgit2/git2go/v35: go.mod has non-.../v35 module path "github.com/libgit2/git2go/v34" (and .../v35/go.mod does not exist) at revision v35.0.0 ``` Is there any way to build on a system that has libgit2 v1.7? Thank you
ReillyBrogan commented 2024-07-10 17:32:12 -05:00 (Migrated from github.com)

Your only real option is to build libgit2 yourself and statically link it to library/application. There are some instructions on the readme, but I don't know how current they still are (I'm not a developer, just answering your question). If you are building a third-party library/application you should ask the developers how to best do this.

Your only real option is to build libgit2 yourself and statically link it to library/application. There are some instructions on the readme, but I don't know how current they still are (I'm not a developer, just answering your question). If you are building a third-party library/application you should ask the developers how to best do this.
rcontreras-te commented 2024-10-01 12:11:27 -05:00 (Migrated from github.com)

Note, I found two other forks that seem to have added support for libgit2 1.7 already.

https://github.com/coveord/git2go
https://github.com/jeffWelling/git2go

It's just a shame they aren't under the "official" libgit2.

Note, I found two other forks that seem to have added support for `libgit2` `1.7` already. https://github.com/coveord/git2go https://github.com/jeffWelling/git2go It's just a shame they aren't under the "official" `libgit2`.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#960
No description provided.