make build-bin: on Linux, build with bun's pinned release build (closes #240)
nix's bun loads through a glibc in the nix store, and bun build --compile copied that loader into bin/quak, so nix-collect-garbage could break the cron backup. The build moves into script/build-bin. On Linux it downloads bun 1.3.13's release archive for the machine from GitHub: x86-64 (baseline) or arm64, glibc or musl. It checks the archive's SHA-256 before running it, and compiles with that bun, so the binary loads through the system loader. macOS still runs bun through nix-shell. Model: opus-5-5
This commit is contained in:
1 parent
37cdbc6b9a
commit
674fdeb482
3 files changed
+91
-11
No files matched your search
@@ -154,10 +154,16 @@ requests. The "Library reference" below covers both.
|
||||
## Running the backup from cron
|
||||
|
||||
`quak backup` never prompts, so cron can run it. `make install` builds quak as
|
||||
one binary and copies it to `~/bin/quak`. Besides what Getting Started needs,
|
||||
`make install` needs `make` and [nix](https://nixos.org/download). It uses bun,
|
||||
a JavaScript runtime, to bundle the built `dist/` into one executable. It runs
|
||||
bun through `nix-shell -p bun`.
|
||||
one binary and copies it to `~/bin/quak`. It uses bun, a JavaScript runtime, to
|
||||
bundle the built `dist/` into one executable. Besides what Getting Started
|
||||
needs, `make install` needs `make`. On Linux it downloads bun from GitHub with
|
||||
`curl` and unpacks it with `unzip`. It checks the download against a SHA-256
|
||||
hash in the repo. On macOS it runs bun through `nix-shell -p bun`, so it needs
|
||||
[nix](https://nixos.org/download).
|
||||
|
||||
On Linux systems that use the musl C library, such as Alpine, `make install`
|
||||
downloads bun's musl build. On Alpine, both that bun and `~/bin/quak` need the
|
||||
`libstdc++` and `libgcc` packages.
|
||||
|
||||
Log in once with `~/bin/quak`, as the user the cron job will run as:
|
||||
|
||||
@@ -1793,6 +1799,8 @@ standard. The others are additions to it.
|
||||
`package.json` declares (`main`, `types`, `bin`) were written, and make the
|
||||
command line executable.
|
||||
- `script/version`: print the version `script/build` stamps (see "Version").
|
||||
- `script/build-bin`: run `script/build`, then bundle the built `dist/` into one
|
||||
binary, `bin/quak`, with bun (see "Running the backup from cron").
|
||||
- `script/test`: run the test suite, by building the `test` phase of the
|
||||
`Dockerfile`. Requires Docker.
|
||||
- `script/lint`: run eslint and a prettier check, by building the `lint` phase
|
||||
@@ -1821,8 +1829,7 @@ The Makefile targets are:
|
||||
- `make build`: runs `script/build`.
|
||||
- `make docker`: runs `script/docker`.
|
||||
- `make hooks`: runs `script/install-precommit`.
|
||||
- `make build-bin`: bundles the built `dist/` into one binary, `bin/quak`. It
|
||||
runs bun through `nix-shell -p bun`.
|
||||
- `make build-bin`: runs `script/build-bin`.
|
||||
- `make install`: runs `make build-bin` and copies the binary to `~/bin/quak`.
|
||||
- `make dev`: runs the TypeScript compiler in watch mode.
|
||||
- `make clean`: removes `dist/`, `coverage/`, `.vitest-cache/` and the
|
||||
@@ -1930,9 +1937,11 @@ These apply to people and to coding agents alike.
|
||||
- container images by digest;
|
||||
- the nvm archive `script/bootstrap` downloads, and the Python packages
|
||||
`bin/clip-keyword-vectors` installs, by SHA-256 hash;
|
||||
- bun's glibc and musl builds, which `script/build-bin` downloads on Linux,
|
||||
by SHA-256 hash;
|
||||
- Node and yarn, when `script/bootstrap` installs them, by version.
|
||||
- Not pinned:
|
||||
- bun, which `make build-bin` takes from `nix-shell -p bun`;
|
||||
- bun on macOS, which `script/build-bin` takes from `nix-shell -p bun`;
|
||||
- `make` and `git`, which `script/bootstrap` installs from the system
|
||||
package manager when they are missing, as every `Dockerfile` stage does;
|
||||
- `bash` and `curl`, which `script/bootstrap` installs the same way when it
|
||||
|
||||
Reference in new issue
Block a user