Commit2824779fRecorded30 Jul 2026Repositorycore-channel

Fix demo/env.sgl and the cross-checkout gate for the lock/consume split

Message

Three independent defects in one documented onboarding command, which together mean nobody has walked the README's first-run path in some time:

1. (pkg "hello" version: "2.12.2") -- pkg refuses a version argument; versions are metadata and selection is by binding. Exit 70. 2. sigil env shell -f demo/env.sgl -- env shell consumes an env.lock, never environment source. The lock step is separate and comes first. Exit 64, and this is the one the gate hit. 3. No SIGILREGISTRYMETADATA -- the gate never set it, so lock authoring refuses with "SIGILREGISTRYMETADATA is not configured" before it can verify the catalogue. Now required via :? like SIGIL_BIN already was, so the gate states its dependency instead of failing obscurely.

The missing core/hello binding fixed in the previous commit is the fourth, and only becomes visible once these three are out of the way.

Consumption deliberately runs without SIGILREGISTRYMETADATA and without SIGIL_CHANNEL, so the gate also holds the lock-only consumption boundary honest.

Changed
 README.md                     |  9 ++++++++-
 demo/env.sgl                  |  3 +--
 scripts/gate-crosscheckout.sh | 18 +++++++++++++++---
 3 files changed, 24 insertions(+), 6 deletions(-)
Diff
README.mdmodified
@@ -13,9 +13,16 @@ On x86_64 Linux, a checkout becomes a working `--channel` directory with:
13
14
```sh
15
./bootstrap
16
SIGIL_CHANNEL="$PWD" sigil env shell -f demo/env.sgl -- hello
+16
export SIGIL_REGISTRY_METADATA=/path/to/root-signed/registry.json
+17
SIGIL_CHANNEL="$PWD" sigil env lock -f demo/env.sgl --lock-file env.lock
+18
sigil env shell -f env.lock -- hello
19
```
20
+21
`sigil env shell` consumes an `env.lock`, never environment source, so the lock
+22
step is separate and comes first. Only the lock step needs the channel and the
+23
registry metadata; consumption deliberately needs neither. Requires sigil
+24
0.18.0 or newer, which is the first release with `env`.
+25
26
`bootstrap` downloads the seed and Zig archives from their manifest URLs,
27
verifies their SHA-256 hashes before installation, and refuses altered or
28
unexpected content. It requires `sh`, `sha256sum`, `tar`, and either `curl` or
demo/env.sglmodified
@@ -1,2 +1 @@
1
(environment packages: (list (pkg "hello" version: "2.12.2")))
2
+1
(environment packages: (list (pkg "hello")))
scripts/gate-crosscheckout.shmodified
@@ -2,7 +2,8 @@
2
set -eu
3
4
repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
5
sigil_bin=${SIGIL_BIN:?set SIGIL_BIN to a sigil binary with env support}
+5
sigil_bin=${SIGIL_BIN:?set SIGIL_BIN to a sigil binary with env support (0.18.0+)}
+6
registry=${SIGIL_REGISTRY_METADATA:?set SIGIL_REGISTRY_METADATA to root-signed registry metadata this binary accepts}
7
scratch=$(mktemp -d /tmp/sigil-channel-clone.XXXXXX)
8
trap 'rm -rf "$scratch"' EXIT HUP INT TERM
9
git clone --quiet --no-hardlinks "$repo" "$scratch/core-channel"
@@ -11,7 +12,18 @@ SIGIL_BOOTSTRAP_SEED_URL="${SIGIL_BOOTSTRAP_SEED_URL:-}" \
12
SIGIL_BOOTSTRAP_ZIG_URL="${SIGIL_BOOTSTRAP_ZIG_URL:-}" \
13
"$scratch/core-channel/bootstrap"
14
+15
# Authoring: resolve demo/env.sgl against the clone's signed catalogue and
+16
# realize it. `env shell` consumes an env.lock, never environment source, so
+17
# the lock step is separate and comes first.
+18
SIGIL_REGISTRY_METADATA="$registry" \
19
HOME="$scratch/home" SIGIL_CHANNEL="$scratch/core-channel" \
+20
"$sigil_bin" env --store "$scratch/store" lock \
+21
-f "$scratch/core-channel/demo/env.sgl" --lock-file "$scratch/env.lock"
+22
+23
# Consumption: deliberately WITHOUT SIGIL_REGISTRY_METADATA and without
+24
# SIGIL_CHANNEL, which also holds the lock-only consumption boundary honest.
+25
HOME="$scratch/home" \
26
"$sigil_bin" env --store "$scratch/store" shell \
16
-f "$scratch/core-channel/demo/env.sgl" -- hello
17
echo "cross-checkout gate: fresh clone, bootstrap, and sigil env shell green"
+27
-f "$scratch/env.lock" -- hello
+28
+29
echo "cross-checkout gate: fresh clone bootstrapped, locked, and ran hello from the lock"