Skip to content

fix(duckdb): gate driver linkage off on windows/arm64#656

Merged
wesm merged 2 commits into
mainfrom
fix/duckdb-windows-arm64
Jun 12, 2026
Merged

fix(duckdb): gate driver linkage off on windows/arm64#656
wesm merged 2 commits into
mainfrom
fix/duckdb-windows-arm64

Conversation

@wesm

@wesm wesm commented Jun 12, 2026

Copy link
Copy Markdown
Member

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/agentsview for windows/arm64 fails with undefined duckdb_* symbols, which would fail the build matrix and block the entire next release (the release and pypi jobs need every leg, and build_wheels.py --require-all expects a windows_arm64 archive).

Driver registration now goes through an openDuckDB shim:

  • internal/duckdb/driver.go (!(windows && arm64)) blank-imports github.com/duckdb/duckdb-go/v2 and opens connections as before.
  • internal/duckdb/driver_windows_arm64.go returns a clear unsupported-platform error from Open and NewQuackStore instead of linking the driver. The rest of the internal/duckdb package is plain database/sql and still compiles everywhere, so the SQLite-backed app is unaffected on windows/arm64 — only the duckdb subcommands 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

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-ci

roborev-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

roborev: Combined Review (376158a)

Changes need one medium issue fixed before merge.

Medium

  • internal/duckdb/smoke_test.go:9: Windows/ARM64 test builds still include DuckDB-dependent tests, including the direct blank import of github.com/duckdb/duckdb-go/v2. With the new stub, go test on Windows/ARM64 may still link the unsupported driver or fail existing DuckDB tests before the unsupported-platform assertions are useful.
    • Fix: Exclude DuckDB-dependent tests from windows && arm64 with build tags or a shared skip helper, leaving only unsupported-platform tests enabled there.

Panel: ci_default_security | Synthesis: codex, 9s | Members: codex_default (codex/default, done, 1m36s), codex_security (codex/security, done, 26s) | Total: 2m11s

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.
@wesm

wesm commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Addressed in 238f15e: the driver-dependent test files (smoke, store, schema, sync, contract) are now gated with !(windows && arm64), smoke_test.go's direct driver import is removed, and the duckdbtest-tagged suites carry the same platform constraint. Verified by cross-linking the internal/duckdb and cmd/agentsview test binaries for windows/arm64 with llvm-mingw (failed to link before, links now); the full native suite still runs unchanged (466 tests).

@roborev-ci

roborev-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

roborev: Combined Review (238f15e)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 1m40s), codex_security (codex/security, done, 11s) | Total: 1m51s

@wesm wesm merged commit 3d1b594 into main Jun 12, 2026
15 checks passed
@wesm wesm deleted the fix/duckdb-windows-arm64 branch June 12, 2026 17:26
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.

1 participant