[fabrica] Release pin (QC round 2): verifiers build the tagged commit (flake rev and docs); the commit the pin names is kept for the record, must hold the recorded source tree when present, and is published unchecked when absent
This commit is contained in:
+9
-6
@@ -3,7 +3,7 @@
|
||||
Every Ianitor release on Gitea (`vX.Y.Z`) carries `SHA256SUMS` and `SHA256SUMS.minisig`, signed through Custos by
|
||||
the `domi-release` key, and among the files that `SHA256SUMS` lists, `ianitor-nix.json`: the commit the build was
|
||||
made from and the NAR hash of every Nix output (`.#ianitor`, the two binaries; `.#ianitor-web`, the built UI).
|
||||
Ianitor ships no binary download: you build that commit yourself (or your server does, through the NixOS module)
|
||||
Ianitor ships no binary download: you build the tagged commit yourself (or your server does, through the NixOS module)
|
||||
and check that you got exactly the bytes the release vouches for.
|
||||
|
||||
What is checked, and what is not yet: `scripts/nix-pin.sh` builds each output, then rebuilds the output derivation itself once more (`nix build --rebuild`) and refuses to pin it if the two differ; the dependencies come from the binary cache and are not rebuilt. The `verify-nix` pipeline does the same on the NixOS
|
||||
@@ -32,8 +32,11 @@ sha256sum -c --ignore-missing SHA256SUMS # every downloaded file: OK
|
||||
|
||||
## 2. The build
|
||||
|
||||
`ianitor-nix.json` names the commit the hashes were built from (`commit`; the tag's own commit, `taggedCommit`,
|
||||
differs from it at most by the pin file), the nixpkgs revision of its flake.lock, and the hashes:
|
||||
`ianitor-nix.json` names the commit to build, `taggedCommit` (also in `flake`), the nixpkgs revision of its
|
||||
flake.lock, and the hashes. `commit` is where `nix-pin.sh` ran, for the record: the release checks that the tagged
|
||||
commit holds the same source (they differ at most by the pin file, which no package's source contains), and that
|
||||
`commit` does too when it is present (`commitChecked`); a pin naming a commit that no longer exists is published
|
||||
with `commitChecked: false`, and that is fine, because you build `taggedCommit`:
|
||||
|
||||
```json
|
||||
{ "version": "1.0.0", "commit": "<40 hex>", "taggedCommit": "<40 hex>", "nixpkgs": "<40 hex>", "system": "x86_64-linux",
|
||||
@@ -43,7 +46,7 @@ differs from it at most by the pin file), the nixpkgs revision of its flake.lock
|
||||
Build that commit and compare (Linux with Nix and flakes; nothing from Ianitor's own caches is needed):
|
||||
|
||||
```sh
|
||||
c=$(jq -r .commit ianitor-nix.json)
|
||||
c=$(jq -r .taggedCommit ianitor-nix.json)
|
||||
for a in ianitor ianitor-web; do
|
||||
p=$(nix build "git+https://gitea.marek-novak.cz/mnovak/Ianitor.git?rev=$c#$a" --no-link --print-out-paths)
|
||||
got=$(nix path-info --json "$p" | jq -r 'if type == "array" then .[0].narHash else .[].narHash end')
|
||||
@@ -57,13 +60,13 @@ hash is the content. `nix build --rebuild` builds once more locally and fails if
|
||||
|
||||
On a server that uses the NixOS module, the running build is `services.ianitor.package`, normally
|
||||
`ianitor.packages.x86_64-linux.ianitor` from the flake input pinned in the server's `flake.lock`: if that input's
|
||||
`rev` is the release's commit, `nix path-info --json $(readlink -f /run/current-system/sw/bin/ianitor-edge | sed 's#/bin/.*##')`
|
||||
`rev` is the release's `taggedCommit`, `nix path-info --json $(readlink -f /run/current-system/sw/bin/ianitor-edge | sed 's#/bin/.*##')`
|
||||
gives the same NAR hash.
|
||||
|
||||
## What this does and does not prove
|
||||
|
||||
- **Proves:** the release's notes, screenshots and pin are the ones Mark approved and Custos signed; the code at the
|
||||
pinned commit builds to exactly the pinned bytes, on any machine with the same nixpkgs (the flake.lock is part of
|
||||
tagged commit builds to exactly the pinned bytes, on any machine with the same nixpkgs (the flake.lock is part of
|
||||
the commit).
|
||||
- **Does not prove:** that the code is good (that is the five test layers' job, ROADMAP §5), nor anything about the
|
||||
Nix binary cache you build with: a substituted dependency is trusted as Nix trusts it. `nix build --rebuild` and
|
||||
|
||||
Reference in New Issue
Block a user