810. ripgrep is packaged in basalt and installed with jig
BUILT, 2026-10-19 (UTC). basalt builds ripgrep from a recipe that pins its sources by
SHA-256 and publishes one package per architecture on a GitHub Release, indexed at
basalt.nifeos.org. The recipe's [package_digest] records each package's SHA-256, every build
refuses a package that hashes to anything else, and basalt's packages workflow fails its
the two builds are byte-identical job unless two builds at different paths match (milestone 917).
The Release rolling-2026-10-19-b673abe serves the three digests the recipe at
nifeos/basalt@b673abe records. nife builds no rg. Its gates fetch that package by the recipe's
digest, and a booted nife runs jig install ripgrep and rg --version against it on all three
architectures under QEMU, on every pull request. The two "Built" sections below have the rest.
(From fork 4 of milestone 849 (a package declares what it needs at run time), pull request #1797; the title and slug are drafts.)
The purpose: a customer runs rg at the swish prompt after jig install ripgrep. ripgrep is a
customer-facing optional package that any customer installs from basalt's index. What is excluded
is baking it into the base image. calef, 2026-10-07 (UTC): "I don't know why ripgrep would be
restricted to test images. We want ripgrep usable by a customer."
calef ruled on 2026-10-07 (UTC) that packaging ripgrep and making it work are two milestones:
"Should we have a milestone for packaging ripgrep and a milestone for a functional ripgrep, which
seems like what the ripgrep milestone should be." then "Yes". Then where: "To be clear, we
should package ripgrep in basalt. That's what it is for." And how it arrives: "With a functional
jig, ripgrep should be installed via jig and not part of the base image. It isn't base."
This is the packaging half. Milestone 121 (ripgrep on nife) is the functional half, and it
depends on this one only for running rg at the swish prompt.
What exists, checked 2026-10-19 (UTC)
In nife:
- No build of
rg.cargo xtask basalt-fetchfetches basalt's published package for each architecture by the digest basalt's recipe records at the commitxtask/basalt-pinnames. xtaskpacks the package'srginto each architecture's initrd only when it was fetched, so a base image never carries it.system_tests/src/user/ripgrep_tests.rsandripgrep_threads_tests.rsrun it by hand-placed capabilities.script/swish-checkinstalls it withjigand runs it by name and by path.
In nifeos/basalt: pins.toml pins nife by full commit id. gate.yml runs the pinned commit's
own script/ci-build test. pin-bump.yml proposes a new pin daily, with the packages' new
digests. packages.yml builds recipes/ripgrep.toml at the pin twice and compares the two, proves
jig installs it, and on main publishes the packages to a Release and the index to Pages. The
README says "basalt has no toolchain of its own. It builds each component at the toolchain pin
that component's commit carries."
The work
- A recipe in
nifeos/basalt, not in this tree, naming the crate (ripgrep), the version (14.1.1) and a SHA-256 of the.cratefile. The build refuses a download that does not match. crates.io's index carries acksumper version, which the recipe can be checked against (unverified). The recipe format is basalt's to choose; nife'spackages/*.recipe.toml(§195 (a reviewed recipe vouches for a package)) is the shape to start from. - A build job in basalt. It checks out nife at the commit
pins.tomlnames, runscargo xtask std-srcthere for that commit'snife-devfarm, and buildsrgfor each target with the flags nife's in-treestdprograms link with. One build for all three architectures, per §19 (architectural parity). - The manifest note, written at build time:
runner = elf,runtime = Std,arg = Words(ReadOnly)andoutput = Bytes, in milestone 597 (a program carries its manifest in an ELF note)'s encoding, linked as an object (-Clink-arg=note.o, measured by #1319). Nothing writes a note for a foreign program yet, so the writer is part of this milestone. It belongs in a form basalt can call at the pinned commit, not a copy. - A package archive per architecture (§197 (a package is one archive file)), kind
optional, vouched by the recipe's digest line (§195). - Publication to basalt's package index at
basalt.nifeos.org(§250 (an image names its distribution's package index)), by a publish job in basalt. - Installation by
jig install ripgrep(milestone 809 (the package client becomes a program)), to where swish finds an installed program (§219 (how the shell names an installed program to the spawner)). It is vouched through the installed-programs table, so it gets its note's grants. - Stop packing
rginto the base image by accident:xtaskpacks it only where a test asks, with a comment citing this milestone. That is not a restriction to tests. In the interim before milestone 809 works, an image carryingrgis a test image and says so; after it, customers getrgfromjig install.
Built 2026-10-12 (UTC)
- The recipe is
nifeos/basalt'srecipes/ripgrep.toml: the crate at 14.1.1 and its SHA-256 (crates.io'scksum), andignore0.4.23 at its SHA-256 with basalt'spatches/ripgrep-ignore-walk.patch, refused unless its SHA-256 is the recipe's. A download that does not match is refused before anything is built (item 1). - The build is basalt's
helpers/packages.py: the pinned nife'scargo xtask std-srcandcargo xtask foreign-note, the shared link script's flags with symbols stripped, and the pinned nife'scargo xtask packageas the one producer (items 2 to 4). Packages measured 2026-10-12: 2,950,424 bytes on aarch64, 2,782,560 on riscv64, 2,934,096 on x86_64, underspawnproto::IMAGE_MAX_PAGES' 4 MiB. Unstripped they were 5.1, 11.7 and 4.4 MB. - The program is
rg, in a package namedripgrep. The installer took the member named after the package as the program, so a package namedripgrepcould only installripgrep. It now falls back to the one member namedbin/<program>(package_archive::PROGRAM_PREFIX), and basalt packsbin/rg. That is the question below. - The repository basalt writes is the layout
jigreads (rolling/metadata/stand-in-index,rolling/targets/). basalt'spublishjob puts the packages on a Release and the index on Pages atbasalt.nifeos.org(item 5). The first isrolling-2026-10-13-ad0b146. - The proof is basalt's
packagesworkflow: it runs this tree's swish-check rows withNIFE_BASALT_REPOSITORYnaming that repository, the test index host serves its lines beside the fixtures', and the second boot typesjig install ripgrepthenrg --version, which printsripgrep 14.1.1(item 6). Locally green on aarch64, riscv64 and x86_64. Fetching 2.8 MiB over software TLS under TCG took 21 s on aarch64, 29 s on riscv64 and 46 s on x86_64, so the two lines takerg's 90 s bound.
Built 2026-10-13 (UTC): nife's tests take basalt's package
Lane lane/ripgrep-from-basalt, with nifeos/basalt#15. DECISIONS §297 (software reaches a nife
system as a package jig installs from basalt) item 3 makes a helpers/build-*.sh scaffolding
until the program's package exists, and this one's does.
calef ruled on 2026-10-13 (UTC). Asked whether nife's ripgrep tests should (1) fetch basalt's
published rg package by digest and install it with jig in the test image, or (2) move to
basalt's packages workflow, he answered: "1 is preferable because that tests jig and basalt's
delivery mechanism as well."
cargo xtask basalt-fetch(xtask/src/basalt.rs) readsxtask/basalt-pin, a basalt commit and the Release it published. It fetches each package from that Release, and accepts it only throughpackage_index::accept, the installer's own decision, under the SHA-256 in the recipe's[package_digest]at that commit.- It writes them as a repository under
target/basalt/. The test index host serves its lines beside the fixtures', andscript/swish-check's second boot typesjig install ripgrepandrg --versionagainst them in nife's own CI (item 6). - The kernel harness's archive and the shell check's disk carry the package's
bin/rgmember, accepted the same way (item 7). The 138-line threaded walk, the needle lines and the walk ofcrates/run basalt's bytes, with their assertions unchanged. - The host's reference
rgis ripgrep's own 14.1.1 Release build for the host, pinned by SHA-256. NIFE_BASALT_REPOSITORYstill wins, so basalt'spackagesworkflow tests the repository it just built, and the fetch takes the programs from it.- Without a network a local run says what it could not fetch, and the
rglines and tests skip with that reason. In CI a failed fetch fails the row. - nife has no ripgrep build. The
ignorepatch is basalt's, byte for byte the same file.
Who bumps the pin. Nobody has to: basalt never prunes a Release, so the pinned URLs keep
serving. A lane that wants a newer build, or whose change the pinned build cannot run on, sets
xtask/basalt-pin to a basalt commit and its Release tag and lets CI judge it. No digest is copied. A ripgrep or recipe bump in basalt names the nife pull request that takes it.
The question for calef: how a package names a program that is not its own name
Debian's ripgrep installs /usr/bin/rg; nife's installer had no way to say that. Options:
- A
bin/<program>member (built, recommended): no format change, readable to anyone who has met/usr/bin, and it extends to a package with several programs later. The cost is a convention two producers must follow, written inpackage_archive. - A header field naming the program: explicit, but a format version bump for every reader.
- Name the package
rg: no change at all, and against "jig install ripgrep".
Reversible: only this tree and basalt's one recipe use it. If calef refuses (1), the recipe and the installer's fallback change together and nothing else moves.
Ruled 2026-10-12 (UTC). calef: "A package can contain many programs and they may be different from
the package name." That takes (1) and widens it: a package carries any number of bin/<program>
members, and no program need share the package's name. What is built is the one-program case, so
ripgrep's bin/rg already follows the ruling; a package with two bin/ members is still
refused (see BUGS).
Exit
On aarch64, riscv64 and x86_64: a nife at basalt's pinned commit runs jig install ripgrep against
basalt's index, the archive's digest matches the recipe, and rg --version at the swish prompt
prints ripgrep's version. A recipe whose checksum disagrees with the download fails basalt's build.
Searching with rg pattern dir is milestone 121's exit, not this one's.
Reuse: basalt's build runs the pinned nife's cargo xtask std-src, foreign-note and package
unchanged, and the package format is §197's. nife's fetch decides with package_index::accept, the
installer's own function, and fetches with curl. cargo install and cargo-binstall were considered for the fetch.
Neither builds against a custom target's patched std, and neither emits a §197 archive, so they
would replace only the download (unverified for cargo-binstall's custom-target support).
BUGS
- The guest never fetches from github.com in a gate. The test index host serves basalt's bytes, so
jig's listed location, its one redirect and the Sectigo root are exercised by no CI boot. - Only
swish-check'sjig install ripgreptakes the installer's path. The kernel harness and the by-path lines run the package's program member, accepted on the host. - A nife change the pinned
rgcannot run on cannot pass CI on its own. basalt builds against nife's mergedmain, so thergrows stay red until basalt builds at a commit that has the change. - A search may not fit a
stdprogram's heap. PR #1777 measuredrg --threads 1 --no-mmapover this tree at a 3.0 MiB peak on macOS, against about 1 MiB ofstdheap. That is milestone 121's to solve, butrg --versionpassing here says nothing about it. - basalt's gate is one job for three architectures (its README's BUGS), so a red riscv64 build can hide behind a red aarch64 one.
Follow-on
- Done. Publishing at
basalt.nifeos.org, checked 2026-10-13: the index serves, and the Releaserolling-2026-10-13-ad0b146holds the three packages. - Recorded. A route for a nife change the pinned
rgcannot run on, inBUGS: basalt building at an unmerged nife commit, published where nife's CI can fetch it by digest. Not needed by any change so far. - Done. Milestone 917 (basalt's packages build reproducibly, and the recipe records each package's digest).
- Milestone 919. Several programs in one package, as calef ruled: milestone 919 (a package
carries several programs, and
jiginstalls, finds and removes each one) holds the work and the question of two packages offering one program name. - Done. Item 7: nife packs no
rgit built, only the fetched package's, and only when a gate fetched it ("Built 2026-10-13").
Index row
The first third-party program nife ships the way every later one will. A recipe in the
distribution names its source by checksum, basalt builds it against a pinned nife, a manifest note
says what it may hold, and jig installs it from an index. ripgrep already builds and runs on all three
architectures, so what this proves is the path a customer takes, not the port. It is optional, not base.