fix(duckdb): gate driver linkage off on windows/arm64#656
Conversation
duckdb-go-bindings ships prebuilt static DuckDB libraries only for
darwin/{amd64,arm64}, linux/{amd64,arm64}, and windows/amd64. Linking
cmd/agentsview for windows/arm64 fails with undefined duckdb_* symbols,
which would break the release workflow's native windows/arm64 job added
after v0.32.1.
Route driver registration through an openDuckDB shim: supported
platforms blank-import github.com/duckdb/duckdb-go/v2 as before, while
windows/arm64 builds get a stub that returns a clear unsupported-platform
error from Open and NewQuackStore. The rest of the duckdb package is
plain database/sql and still compiles everywhere.
roborev: Combined Review (
|
go test for windows/arm64 still failed to link: smoke_test.go blank-imported the DuckDB driver directly, and the store, schema, sync, and contract tests open real DuckDB databases that the stubbed driver cannot provide. Gate those test files with !(windows && arm64), drop smoke_test.go's redundant driver import now that the package registers the driver on supported platforms, and tighten the duckdbtest-tagged suites with the same platform constraint. Pure-logic tests (connect URL validation) and the unsupported-platform stub tests remain in the windows/arm64 build. Verified by cross-linking the internal/duckdb and cmd/agentsview test binaries for windows/arm64 with llvm-mingw; the full native test suite still runs unchanged.
|
Addressed in 238f15e: the driver-dependent test files (smoke, store, schema, sync, contract) are now gated with |
roborev: Combined Review (
|
Summary
duckdb-go-bindings ships prebuilt static DuckDB libraries only for darwin/{amd64,arm64}, linux/{amd64,arm64}, and windows/amd64. Since #609 the DuckDB driver links into every binary unconditionally, and since #598 the release workflow builds a native windows/arm64 binary — a combination that has never run together: linking
cmd/agentsviewfor windows/arm64 fails with undefinedduckdb_*symbols, which would fail thebuildmatrix and block the entire next release (thereleaseandpypijobs need every leg, andbuild_wheels.py --require-allexpects a windows_arm64 archive).Driver registration now goes through an
openDuckDBshim:internal/duckdb/driver.go(!(windows && arm64)) blank-importsgithub.com/duckdb/duckdb-go/v2and opens connections as before.internal/duckdb/driver_windows_arm64.goreturns a clear unsupported-platform error fromOpenandNewQuackStoreinstead of linking the driver. The rest of theinternal/duckdbpackage is plaindatabase/sqland still compiles everywhere, so the SQLite-backed app is unaffected on windows/arm64 — only theduckdbsubcommands report the platform limitation at runtime.Verified by cross-linking windows/arm64 with llvm-mingw (fails on main with undefined
duckdb_*symbols, links with this change) and by a full dry-run of the release workflow on a throwaway repo (https://github.com/wesm/agentsview-release-test/releases/tag/v0.99.0): all six build legs passed, including the manylinux glibc-2.28 guard and the macOS minos check; wheels built and smoke-tested for all platforms. Release archives grow from ~8MB to ~24–30MB compressed because the DuckDB static library now ships in every supported binary.🤖 Generated with Claude Code