Replaces the pure-Go SQLite translation with the cgo driver linked against the
system libsqlite3, so the release binaries and packages get smaller and the
database work gets faster.
Measured with the release flags (-trimpath -ldflags "-s -w -buildid=",
linux/amd64, go1.27.3):
| Artifact | Before | After |
|---|---|---|
vole-linux-amd64 |
23,085,180 B | 19,336,944 B (−16.2%) |
vole-linux-arm64 |
— | 17,882,840 B |
vole_0.0.0-1_amd64.deb |
18,108,946 B | 8,043,712 B |
vole-0.0.0-1.x86_64.rpm |
18,531,697 B | 8,406,400 B |
The trade: the binary now needs libsqlite3.so.0 where it runs. Both packages
declare it (libsqlite3-0 for deb, sqlite-libs for rpm), and building from
source needs a C compiler and the SQLite headers (libsqlite3-dev,
sqlite-devel). README and Getting started say so.
What changed:
modernc.org/sqlite→github.com/mattn/go-sqlite3, with the-tags libsqlite3build tag so the driver links the system library instead of compiling its bundled copy.- The six DSNs: modernc-only
_pragma=busy_timeout(5000)/_pragma=journal_mode(WAL)/_pragma=foreign_keys(1)became_busy_timeout=5000/_journal_mode=WAL/_foreign_keys=1; the driver name becamesqlite3. The busy timeout, WAL, immediate write transactions, and foreign keys are the same as before. - Verify and release images set
CGO_ENABLED=1andGOFLAGS=-tags=libsqlite3, and install the SQLite development headers, so CI tests against the same library the packages depend on. - The release image adds the arm64 architecture and
gcc-aarch64-linux-gnu, so both architectures are still built in one job. Both binaries still rebuild byte for byte from the same tag; I checked by building each twice. packaging/nfpm.yamldeclares the per-format runtime dependency through nfpm’soverrides.- The release image also defines the
ciuser that the verify image already has. Without it,vole workflow run releasefails its test step when the container runs as the host’s uid, because the ssh tests callgetpwuid().
Verified locally: vole workflow run verify passes end to end (format, vet,
build, govulncheck, packages, links, go test -race), and
vole workflow run release against a throwaway local tag passes too, producing
both architectures. readelf shows libsqlite3.so.0 and libc.so.6 in
NEEDED for both, and dpkg -I / rpm -qpR show the new dependencies in both
formats.
If keeping one self-contained file matters more than the last 1.2 MB, dropping
-tags libsqlite3 compiles the driver’s bundled SQLite into the binary and
removes the runtime dependency; the packages would then not need libsqlite3.
Say the word and I will switch it.
Closes #91.