torture: use sqlite3.SQLiteDriver instead of cgo-only ErrNo#123
Merged
brianmcgee merged 1 commit intomainfrom Apr 16, 2026
Merged
torture: use sqlite3.SQLiteDriver instead of cgo-only ErrNo#123brianmcgee merged 1 commit intomainfrom
brianmcgee merged 1 commit intomainfrom
Conversation
mattn/go-sqlite3's `//go:build !cgo` stub doesn't define ErrNo, so the
torture fixture has never compiled with CGO_ENABLED=0 — which is what
bench-incremental's `nix-*-nocgo` tools and the bazel comparison need.
SQLiteDriver{} is in both the cgo and nocgo builds (it's the type
init() registers).
Also updates the testgen template so a regen doesn't reintroduce it.
:house: Remote-Dev: homespace
Benchmark Regression Check
Baseline: |
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
The torture fixture's
internal/{conflict-a,conflict-b,db}usesqlite3.ErrNo(0)to force themattn/go-sqlite3import.ErrNoonly exists in the cgo build — the package's//go:build !cgostub definesSQLiteDriver/SQLiteConnbut not the error types. Sobench-incremental --fixture torture --tools nix-*-nocgo(and anyCGO_ENABLED=0build of the fixture) fails at compile.SQLiteDriver{}is defined in both builds; swap to that. Also updates the testgen template.Test plan
CGO_ENABLED=0 go build ./internal/conflict-a— wasundefined: sqlite3.ErrNo, now OKCGO_ENABLED=1 go build ./internal/conflict-a— still OK