build(deps): bump libgit2 1.3 → 1.5.0 and git2go v33 → v34 - #9028
Open
DoDiODev wants to merge 3 commits into
Open
build(deps): bump libgit2 1.3 → 1.5.0 and git2go v33 → v34#9028DoDiODev wants to merge 3 commits into
DoDiODev wants to merge 3 commits into
Conversation
Bump git2go binding to v34.0.0 (highest importable module; the v35.0.0 tag has a broken go.mod module path) paired with libgit2 1.5.0 across install sites. git2go Go API is unchanged between v33 and v34, so no gitextractor code changes are needed. Signed-off-by: DoDiODev <DoDiDev@proton.me>
The libgit2 cross-build stage was based on `golang:1.26-bullseye`, a tag that was never published (Go dropped bullseye variants), so the image build failed with "docker.io/library/golang:1.26-bullseye: not found". The stage does not use Go at all, so it is now plain `debian:bullseye` with wget/ca-certificates added explicitly.
The libgit2 cross-build failed at the cmake step with "Could not find a python interpreter, which is needed to build the tests". The upstream golang base image happened to ship python; the plain debian:bullseye base does not, and we never build the libgit2 tests anyway. Pass -DBUILD_TESTS=OFF.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps the Go binding
libgit2/git2gofrom v33.0.6 to v34.0.0 and thenative libgit2 library from 1.3.x to 1.5.0 at every install site.
git2gomajors are bound to exactly one libgit2 minor via the C ABI — there isno supported version range. The pair must therefore be pinned in lockstep
everywhere, which is what this PR does.
Current pinning (before this PR) is 3.5 years old: libgit2 1.3.0 was released in
Sep 2021, 1.5.0 in Jul 2022 and carries bug/security fixes of the 1.4 and 1.5
series (including several
CVE-relevant fixes in the smart-transport/packfilecode paths).
Why v34 / 1.5.0 and not something newer?
github.com/libgit2/git2go/v34github.com/libgit2/git2go/v33v35go.modstill declares the module path.../git2go/v34→ notgo get-able1.6–1.9So
v34.0.0+ libgit21.5.0is the ceiling that the canonical, upstreamlibgit2/git2gomodule allows today (verified again on 2026-08-03: the tag listis unchanged,
v35.0.0still points at the same broken commit asv34.0.0).No Go code changes are required: the git2go Go API is identical between
v33.0.6 and v34.0.0 for every call used by
gitextractor(
DiffOptions.NotifyCallback,Odb.ForEach,NewBranchIterator,Branch.*,Reference.Target,DiffLine.Origin,DefaultDiffOptions). The major bump onlyreflects the C ABI/libgit2 version.
What changed
backend/go.mod/backend/go.sumgit2go/v33 v33.0.6→git2go/v34 v34.0.0(go mod tidy)backend/plugins/gitextractor/parser/repo_libgit2.go/v33→/v34backend/plugins/gitextractor/models/diffline.go/v33→/v34backend/Dockerfilev1.3.0→v1.5.0(both cross-build arches)backend/Dockerfile.localv1.3.0→v1.5.0devops/docker/lake-builder/Dockerfilev1.3.2→v1.5.0; plus two build fixes, see below.devcontainer/Dockerfilegit clone -b v1.3.0→-b v1.5.0backend/plugins/gitextractor/README.mdOut of scope on purpose:
devops/docker/alpine-dbt/Dockerfile(apk add libgit2-dev) feeds the dbt image, not the CGOgitextractorbuild.mericodev/lake-builderAll Go CI jobs (
test.yml,golangci-lint.yml,test-e2e.yml,migration-script-lint.yml) run inside the prebuilt containermericodev/lake-builder:latest. That image currently ships libgit2 1.3.2(and Go 1.20.4), so git2go v34 cannot compile in it:
This PR's CI will therefore be red until the image is rebuilt — the image is
only published by
build-builder.yml, which triggers on abuilder-*tag andneeds Docker Hub credentials, i.e. only maintainers can do it.
Two extra commits are included so that the image can actually be rebuilt —
devops/docker/lake-builder/Dockerfileis currently unbuildable onmain,independently of this change:
golang:1.26-bullseye(introduced by chore: upgrade go to 1.26 #8875) was never published — Go droppedthe bullseye variants. The stage does not use Go at all, so it now uses plain
debian:bullseyewithwget/ca-certificatesinstalled explicitly.which is needed to build the tests" on that base →
-DBUILD_TESTS=OFF(libgit2's own test suite was never built here anyway).
Suggested merge order: merge this PR, then push a
builder-*tag somericodev/lake-builder:latestis rebuilt with libgit2 1.5.0. Happy to splitthe two Dockerfile fixes into a separate, earlier PR if that is preferred.
Validation
CI equivalent (all green): since the published builder image cannot be used,
the identical job matrix was run in a fork workflow that builds
devops/docker/lake-builder/Dockerfileitself and runs every Go job inside it —run 30828741519,
8/8 jobs successful: builder image, lint (go), unit-test, e2e (mysql),
migration-script-lint, config-ui, ASF license header, grafana dashboards.
Additionally, locally on macOS (arm64) against a self-built libgit2 1.5.0 prefix:
go build ./plugins/gitextractor/...— compiles and links against libgit2 1.5.0make mock, plugin build (gitextractor.sobuilds as a Go plugin)make unit-test— no failuresdocker build -f backend/Dockerfile.local— greendocker build -f backend/Dockerfile(multi-arch cross build) fails locallywith and without this change — the identical failure reproduces on
unmodified
mainwith libgit2 1.3.0, i.e. it is a pre-existing limitation ofthe local (Rancher Desktop/emulated) environment, not a regression of this PR.
Left to CI to verify.
.devcontainer/Dockerfilecannot be built locally either: its base imagemcr.microsoft.com/devcontainers/go:1-1.26-bookwormdoes not exist (pre-existing,unrelated to this change).
Note for contributors (post-merge)
Anyone building
gitextractorlocally must rebuild/reinstall libgit2 1.5.0 —an existing 1.3.x prefix is ABI-incompatible with git2go v34 and will fail at link
or, worse, at runtime. Devcontainer users need a "Rebuild Container".
Question to the maintainers
libgit2/git2gohas been inactive since Oct 2022; its highest importablemodule is
v34(libgit2 1.5), and thev35.0.0tag is broken. That meansapache/devlakeis permanently cut off from libgit2 ≥ 1.6 security and bug fixesas long as the canonical module is used.
There is an actively maintained fork,
coveord/git2go(last commit2025-11-25), which publishes correctly tagged majors:
v35→ libgit2 1.6,v36→ libgit2 1.7. It keeps the canonical module path, so using it requires aGo
replacedirective (or vendoring) — it is not a drop-in.Would the maintainers be open to switching to
coveord/git2goin a follow-upPR? This PR deliberately stays on the canonical module (
v34/ libgit2 1.5.0)and does not introduce the fork.
Rollback
Revert to the status quo
git2go v33.0.6+ libgit2 1.3.x — same Dockerfilestructure, only the version numbers differ.