Sign in

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

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

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

A free and open-source forge that lives in your Git repo.

Link SQLite dynamically through cgo

95425af7072b041bff198499b9285ee2582283bc · Keenan Nemetz · 10d ago · parent 7defd797

Link SQLite dynamically through cgo

modernc.org/sqlite is a pure-Go translation of SQLite and the largest thing in
the binary: it is about 4 MB of the 23.1 MB the release flags produce, while the
cgo driver against the system library costs about 0.25 MB. With the same flags
the amd64 binary drops to 19.3 MB (16% smaller), the .deb from 18.1 MB to 8.0 MB,
and the cgo driver is also faster on database-heavy paths: the repository index,
sessions, and the CI run store.

The trade is that the binary is no longer self-contained. It needs
libsqlite3.so.0 at runtime, so the .deb depends on libsqlite3-0 and the .rpm on
sqlite-libs, and building needs a C compiler and the SQLite development headers.
arm64 is still cross-compiled on the amd64 release image, with
gcc-aarch64-linux-gnu and libsqlite3-dev:arm64 installed beside the amd64 ones;
both architectures still build byte for byte from the same tag.

The DSNs carried modernc-only pragma parameters. mattn/go-sqlite3 spells them
_busy_timeout, _journal_mode, and _foreign_keys, and the driver is sqlite3, so
the connections keep the busy timeout, WAL mode, immediate write transactions,
and foreign keys they had before. The release image also defines the ci user the
verify image already has, so the release test step runs ssh as the host's uid
when the workflow is reproduced locally.

go.mod +1−8

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