Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Cross-compile macOS binaries with the pure-Go SQLite driver

629df77e31a37ae5f986f4019271bb654c7c4bfc · Keenan Nemetz · 12d ago · parent 8cdf2f6b

Cross-compile macOS binaries with the pure-Go SQLite driver

The release published only Linux binaries, and the tree did not compile for
GOOS=darwin: syscall.Statfs_t.Bsize is uint32 there and int64 on Linux. Even
with that fixed, the cgo SQLite driver made a Darwin binary impossible to
produce on a Linux runner without an Apple SDK.

Return to modernc.org/sqlite, the pure-Go driver this project used before the
size change in #91. The DSN shorthand is unchanged because modernc accepts the
same _busy_timeout, _journal_mode, _foreign_keys and _txlock keys mattn does, so
the stores only change their driver name and blank import. With CGO_ENABLED=0
the tree cross-compiles for linux/amd64, linux/arm64, darwin/amd64 and
darwin/arm64 from the pinned release image, and the Linux binaries are static.

The release workflow now builds both Darwin binaries before the checksum step,
so SHA256SUMS covers them and the channel serves them; verify builds them on
every push so a platform mistake fails on the push instead of the tag.

This also fixes two defects in what we shipped:

- The packaged binary needed GLIBC_2.34 while nfpm.yaml declared only git and
  libsqlite3-0, so Debian 11 and Ubuntu 20.04 installed a package that failed at
  exec. A static binary has no libc floor.
- -tags sqlite_fts5 was inert under -tags libsqlite3, because the amalgamation
  it configures is not compiled, so full-text search depended on how the user's
  distribution built libsqlite3.so.0. The engine is now compiled in.

The cost is the size growth measured in #91, reversed deliberately: 19.3 MB with
system SQLite, 23.4 MB with the engine compiled in on linux/amd64. SQLite
security updates now arrive with a Vole release rather than with apt upgrade;
the SBOM names the engine version, which is what makes that triage possible.

Closes: 01M7ZFNCCJDTS2V5RTYQS9QQ84

go.mod +8−1

@@ -7,17 +7,18 @@ toolchain go1.27.4
7 7 require (
8 8 github.com/BurntSushi/toml v1.6.0
9 9 github.com/go-webauthn/webauthn v0.18.2
10 github.com/mattn/go-sqlite3 v1.14.52
11 10 github.com/microcosm-cc/bluemonday v1.0.27
12 11 github.com/yuin/goldmark v1.8.6
13 12 golang.org/x/crypto v0.58.0
14 13 golang.org/x/net v0.61.0
15 14 golang.org/x/term v0.47.0
16 15 gopkg.in/yaml.v3 v3.0.1
16 modernc.org/sqlite v1.62.0
17 17 )
18 18
19 19 require (
20 20 github.com/aymerick/douceur v0.2.0 // indirect
21 github.com/dustin/go-humanize v1.1.0 // indirect
21 22 github.com/fxamacker/cbor/v2 v2.9.6 // indirect
22 23 github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
23 24 github.com/go-webauthn/x v0.3.1 // indirect
@@ -25,9 +26,15 @@ require (
25 26 github.com/google/go-tpm v0.9.8 // indirect
26 27 github.com/google/uuid v1.6.0 // indirect
27 28 github.com/gorilla/css v1.0.1 // indirect
29 github.com/mattn/go-isatty v0.0.24 // indirect
30 github.com/ncruces/go-strftime v1.1.0 // indirect
28 31 github.com/philhofer/fwd v1.2.1 // indirect
32 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
29 33 github.com/tinylib/msgp v1.6.5 // indirect
30 34 github.com/x448/float16 v0.8.4 // indirect
31 35 golang.org/x/sys v0.49.0 // indirect
32 36 golang.org/x/text v0.43.0 // indirect
37 modernc.org/libc v1.80.1 // indirect
38 modernc.org/mathutil v1.7.1 // indirect
39 modernc.org/memory v1.12.1 // indirect
33 40 )