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
docs/install.md +43−22
| @@ -1,15 +1,17 @@ | |||
| 1 | 1 | # Install | |
| 2 | 2 | ||
| 3 | Install the current stable Vole release on Linux with your package manager. | ||
| 4 | Packages and standalone binaries are available for `amd64` and `arm64`. | ||
| 3 | Install the current stable Vole release on Linux with your package manager, or | ||
| 4 | on macOS from a standalone binary. Packages and binaries are available for | ||
| 5 | `amd64` and `arm64`. | ||
| 5 | 6 | ||
| 6 | 7 | | Method | Best for | Requirements | | |
| 7 | 8 | |---|---|---| | |
| 8 | 9 | | [Install script](#install-with-the-install-script) | Most installations; one command, then upgrades through the package manager | `curl` or `wget` and `sudo` | | |
| 9 | 10 | | [Package repository by hand](#add-the-repository-by-hand) | Inspecting each change to the package manager | `sudo` access | | |
| 10 | 11 | | [Package file](#install-a-package-file) | Installing without adding a repository | `sudo` access | | |
| 11 | | [Release binary](#install-a-release-binary) | A user-local installation | Git and SQLite with FTS5 | | ||
| 12 | | [Build from source](#build-from-source) | Developing Vole or using an unsupported platform | Go, a C compiler, and Git | | ||
| 12 | | [Release binary](#install-a-release-binary) | A user-local installation on Linux | Git | | ||
| 13 | | [Install on macOS](#install-on-macos) | A Mac client, or a laptop forge | Git | | ||
| 14 | | [Build from source](#build-from-source) | Developing Vole or using an unsupported platform | Go and Git | | ||
| 13 | 15 | ||
| 14 | 16 | ## Install with the install script | |
| 15 | 17 | ||
| @@ -62,7 +64,7 @@ vole version | |||
| 62 | 64 | 0.2.0 | |
| 63 | 65 | ``` | |
| 64 | 66 | ||
| 65 | The package installs Git and SQLite, the `vole` command, systemd units, and | ||
| 67 | The package installs Git, the `vole` command, systemd units, and | ||
| 66 | 68 | `/etc/vole/vole.toml`. It does not create an instance admin or start the forge. | |
| 67 | 69 | See [Packages and upgrades](packaging.md) for installed paths, upgrades, and | |
| 68 | 70 | version pinning. | |
| @@ -143,8 +145,9 @@ Then confirm the installation with `vole version`. | |||
| 143 | 145 | ||
| 144 | 146 | ## Install a release binary | |
| 145 | 147 | ||
| 146 | Install Git and SQLite first: `libsqlite3-0` on Debian or Ubuntu, `sqlite-libs` | ||
| 147 | on Fedora, RHEL, or Rocky, or `sqlite` on Arch. SQLite must include FTS5. | ||
| 148 | Install Git first. The binary is static and compiles SQLite in, so it has no | ||
| 149 | runtime library dependencies; that is also why a release binary works on any | ||
| 150 | Linux distribution, including one without a built package. | ||
| 148 | 151 | ||
| 149 | 152 | These commands download the current stable `amd64` binary and install it in | |
| 150 | 153 | `~/.local/bin`. To verify the binary before installing it, follow | |
| @@ -159,20 +162,39 @@ vole version | |||
| 159 | 162 | On ARM, replace `vole-linux-amd64` with `vole-linux-arm64`. Make sure | |
| 160 | 163 | `~/.local/bin` is on your `PATH`. | |
| 161 | 164 | ||
| 162 | ## Build from source | ||
| 165 | ## Install on macOS | ||
| 166 | |||
| 167 | macOS binaries are cross-compiled on Linux and attached to each release. There | ||
| 168 | is no Homebrew formula yet, so install the binary into `~/.local/bin`: | ||
| 169 | |||
| 170 | ```sh | ||
| 171 | curl -fLO https://rodent.software/vole/channels/stable/vole-darwin-arm64 | ||
| 172 | install -D -m 0755 vole-darwin-arm64 ~/.local/bin/vole | ||
| 173 | vole version | ||
| 174 | ``` | ||
| 175 | |||
| 176 | On an Intel Mac, replace `vole-darwin-arm64` with `vole-darwin-amd64`. macOS 13 | ||
| 177 | or later is required, which is the floor the Go toolchain sets. The binary | ||
| 178 | carries an ad-hoc signature, which is what Apple Silicon requires in order to | ||
| 179 | execute it; neither `curl` nor a package manager adds the quarantine attribute, | ||
| 180 | so Gatekeeper does not prompt. To verify the download first, follow | ||
| 181 | [Verify a direct download](packaging.md#verify-a-direct-download). | ||
| 163 | 182 | ||
| 164 | Use this path when you want to change Vole. You need Git, a C compiler, and Go | ||
| 165 | with toolchain management. `go.mod` selects Go 1.27.4 and downloads that | ||
| 166 | toolchain when needed. | ||
| 183 | The same binary is the server, so a laptop instance works from a directory with | ||
| 184 | `vole admin init --dir .` and `vole serve`; see the | ||
| 185 | [Quickstart](quickstart.md). The Linux packages' systemd units and paths do not | ||
| 186 | apply, and this release does not ship a `launchd` unit. | ||
| 187 | |||
| 188 | ## Build from source | ||
| 167 | 189 | ||
| 168 | For a binary that matches the release build, also install the SQLite development | ||
| 169 | headers: `libsqlite3-dev` on Debian or Ubuntu, or `sqlite-devel` on Fedora or | ||
| 170 | RHEL. Then install it from a checkout: | ||
| 190 | Use this path when you want to change Vole. You need Git and Go with toolchain | ||
| 191 | management. `go.mod` selects Go 1.27.4 and downloads that toolchain when needed. | ||
| 192 | There is no C compiler to install: SQLite is compiled in by a pure-Go driver. | ||
| 171 | 193 | ||
| 172 | 194 | ```sh | |
| 173 | 195 | git clone https://rodent.software/vole.git | |
| 174 | 196 | cd vole | |
| 175 | go install -tags libsqlite3,sqlite_fts5 ./cmd/vole | ||
| 197 | go install ./cmd/vole | ||
| 176 | 198 | vole version | |
| 177 | 199 | ``` | |
| 178 | 200 | ||
| @@ -184,17 +206,16 @@ a package or release build reports only its tag: | |||
| 184 | 206 | 0.2.0-devel+4f8a3da | |
| 185 | 207 | ``` | |
| 186 | 208 | ||
| 187 | The `libsqlite3` tag links the system SQLite library, and `sqlite_fts5` enables | ||
| 188 | full-text search. For a local build without SQLite development headers, omit | ||
| 189 | `libsqlite3`; the resulting binary uses the driver's bundled SQLite: | ||
| 209 | The same source cross-compiles for the release targets, because no cgo is | ||
| 210 | involved: | ||
| 190 | 211 | ||
| 191 | 212 | ```sh | |
| 192 | go install -tags sqlite_fts5 ./cmd/vole | ||
| 213 | CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build ./cmd/vole | ||
| 214 | CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./cmd/vole | ||
| 193 | 215 | ``` | |
| 194 | 216 | ||
| 195 | SQLite requires cgo, so do not set `CGO_ENABLED=0`. See | ||
| 196 | the source repository's `DEVELOPMENT.md` for tests and a throwaway development | ||
| 197 | instance. | ||
| 217 | See the source repository's `DEVELOPMENT.md` for tests and a throwaway | ||
| 218 | development instance. | ||
| 198 | 219 | ||
| 199 | 220 | ## Next | |
| 200 | 221 | ||