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/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0: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.

docs/packaging.md +7−1

@@ -12,6 +12,11 @@ dnf install ./vole-0.2.0-1.x86_64.rpm # Fedora, RHEL, Rocky
12 12 There is no apt or dnf repository and no signature on these files yet. Each release
13 13 page also carries `SHA256SUMS`; compare it before installing.
14 14
15 Both packages depend on `git` and the system SQLite library: `libsqlite3-0` on
16 Debian and Ubuntu, `sqlite-libs` on Fedora, RHEL, and Rocky. Vole links SQLite
17 dynamically, so the library must be present where the binary runs; the package
18 manager installs it with the package.
19
15 20 ## What the package installs
16 21
17 22 | Path | What it is |
@@ -96,7 +101,8 @@ Two requirements on the runner:
96 101 - **Network.** `go build` fetches modules, and the packaging step fetches a pinned
97 102 `nfpm`, and a job container has none unless the runner was started with
98 103 `--container-network bridge`. The image build already needs the network; it
99 installs `git` (see `.vole/images/release.yaml`).
104 installs `git`, the C toolchain, and both architectures' SQLite development
105 files (see `.vole/images/release.yaml`).
100 106 - **Nothing else.** The binaries are cross-compiled, so any runner that can start a
101 107 Linux container produces the same four packages.
102 108