Skip to content

feat: migrate DuckDB driver to duckdb-go/v2 (DuckDB 1.5.4)#390

Merged
wesm merged 1 commit into
kenn-io:mainfrom
sweenzor:migrate-duckdb-go-v2
Jun 18, 2026
Merged

feat: migrate DuckDB driver to duckdb-go/v2 (DuckDB 1.5.4)#390
wesm merged 1 commit into
kenn-io:mainfrom
sweenzor:migrate-duckdb-go-v2

Conversation

@sweenzor

@sweenzor sweenzor commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Swaps the DuckDB database/sql driver from the deprecated github.com/marcboeker/go-duckdb to its canonical successor github.com/duckdb/duckdb-go/v2.

Why — Homebrew distribution

The goal is to make msgvault installable via brew install from homebrew-core. homebrew-core won't accept a formula that ships a vendored, precompiled library — the formula must build from source and link the system DuckDB (depends_on "duckdb"). With the old marcboeker/go-duckdb, that was impossible for two reasons:

  1. Version gap. It bundled DuckDB 1.1.3, while Homebrew's duckdb formula is on 1.5.4 — four minors apart, and a moving target.
  2. Link failure. Linking against a system libduckdb failed on Arrow C-Data-Interface symbols, because that driver pulled the Arrow bridge in unconditionally.

Moving to duckdb/duckdb-go/v2 resolves both: it bundles DuckDB 1.5.4 (matching the Homebrew formula), and Arrow is now opt-in behind the duckdb_arrow build tag — which this codebase doesn't use — so a system-libduckdb build (-tags duckdb_use_lib) links cleanly. marcboeker/go-duckdb is also deprecated in favor of duckdb/duckdb-go, so this is the maintained path regardless.

This PR is only the prerequisite in this repo. The Homebrew formula itself lives in a separate repo and is downstream of a release that includes this change.

What changed

  • Bundled DuckDB 1.1.3 → 1.5.4; arrow-go 18.1.0 → 18.5.1.
  • The new module still registers the duckdb driver name, so every sql.Open("duckdb", …) call site is unchanged — a module-path bump across the blank imports plus go.mod/go.sum and the Nix vendorHash.

🤖 Generated with Claude Code

Replaces github.com/marcboeker/go-duckdb v1.8.5 with the canonical successor
github.com/duckdb/duckdb-go/v2 v2.10504.0, which bundles DuckDB 1.5.4 — an exact
match for Homebrew's duckdb formula (was 1.1.3, four minors behind).

msgvault uses go-duckdb purely as a database/sql driver (blank imports only),
and the new module still registers under the "duckdb" driver name, so this is a
module-path change across the 9 blank imports plus go.mod/go.sum — no call-site
changes. Also pulls arrow-go v18.1.0 -> v18.5.1, whose refactored Arrow
integration is the prerequisite for ever linking a system libduckdb instead of
the vendored static blob.

marcboeker/go-duckdb is deprecated and tops out at DuckDB 1.4.1; duckdb-go is
the org-owned continuation that tracks DuckDB releases (the 2.10504.0 tag
encodes DuckDB 1.5.4).

Updates nix/package.nix vendorHash for the new module graph.

Verified in a Linux/arm64 container: make build, full make test (47 packages,
0 failures), go vet, and a runtime SELECT version() returning v1.5.4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sweenzor sweenzor requested a review from wesm as a code owner June 18, 2026 14:52
@roborev-ci

roborev-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

roborev: Combined Review (23e238c)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 2m2s), codex_security (codex/security, done, 12s) | Total: 2m14s

@wesm

wesm commented Jun 18, 2026

Copy link
Copy Markdown
Member

LGTM, thank you

@wesm wesm merged commit 099871c into kenn-io:main Jun 18, 2026
8 checks passed
@sweenzor sweenzor deleted the migrate-duckdb-go-v2 branch June 18, 2026 15:58
@sweenzor

Copy link
Copy Markdown
Contributor Author

Thanks @wesm! Mind cutting a new release with this in it?

sweenzor added a commit to sweenzor/msgvault that referenced this pull request Jun 19, 2026
…DB 1.5.4

kenn-io#390 bumped the bundled DuckDB to 1.5.4, whose prebuilt libduckdb_static.a
is compiled with GCC 12+ and references libstdc++ symbols (e.g.
std::__throw_bad_array_new_length, exception_ptr::_M_release) absent from the
old release container's GCC 9 (ubuntu:20.04). The linux release build broke
with "undefined reference" link errors when tagging v0.16.0.

Move the build-linux container to ubuntu:22.04 (pinned by digest), which
provides GCC 12 from Ubuntu's own repos — no third-party PPA in the release
path. The GCC 12 libstdc++/libgcc are statically embedded so the binary keeps
no runtime GLIBCXX dependency; a guard fails the build if libstdc++ ever links
dynamically. Trade-off: the binary's glibc floor rises 2.31 -> 2.35 with the
newer base.

Verified in a matching ubuntu:22.04 arm64 container: gcc-12 from the official
repo, links cleanly, runs, no dynamic libstdc++.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sweenzor added a commit to sweenzor/msgvault that referenced this pull request Jun 19, 2026
…DB 1.5.4

kenn-io#390 bumped the bundled DuckDB to 1.5.4, whose prebuilt libduckdb_static.a
is compiled with GCC 12+ and references libstdc++ symbols (e.g.
std::__throw_bad_array_new_length, exception_ptr::_M_release) absent from the
old release container's GCC 9 (ubuntu:20.04). The linux release build broke
with "undefined reference" link errors when tagging v0.16.0.

Move the build-linux container to ubuntu:22.04 (pinned by digest), which
provides GCC 12 from Ubuntu's own repos — no third-party PPA in the release
path. The GCC 12 libstdc++/libgcc are statically embedded so the binary keeps
no runtime GLIBCXX dependency; a guard fails the build if libstdc++ ever links
dynamically. Trade-off: the binary's glibc floor rises 2.31 -> 2.35 with the
newer base.

Verified in a matching ubuntu:22.04 arm64 container: gcc-12 from the official
repo, links cleanly, runs, no dynamic libstdc++.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants