forge
Explore
Log in

Don't you dare go Hollow

preflight: the tracked column is committed provenance, not host state

Browse files at this commit

c95980785a3ed6e40d95b13eb4551be0ed59b337Ahmet Kaan GümüşParent: e6d595d
A runner host has no .git, so a regeneration there recomputed every committed
pin's tracked column as 'no-git' and the drift check reported 37 differing rows
on a host whose library was fine. The column is normalised to '-' on both sides
when the tree is not a git tree; the tracked invariant already falls back to the
committed value there, and says so in its own message.
scripts/verify-fixture-library.shmodified+10 -1
@@ -321,7 +321,16 @@ if ! "$ROOT/scripts/gen-fixture-library.sh" "$regen" >/dev/null 2>&1; then
321 echo "FAIL: scripts/gen-fixture-library.sh did not run" >&2321 echo "FAIL: scripts/gen-fixture-library.sh did not run" >&2
322 exit 1322 exit 1
323 fi323 fi
324-if ! diff -u <(grep -v '^#' "$MANIFEST") <(grep -v '^#' "$regen") >"$patch" 2>&1; then324+# The `tracked` column is COMMITTED provenance: it is computed in a git tree.
325+# A runner host has no .git, so a regeneration there cannot recompute it and
326+# would emit 'no-git' for every committed pin -- a drift on all 37 pin rows that
327+# says nothing about the host's library. Off-git the column is normalised on both
328+# sides, and the tracked invariant falls back to the committed value (as its own
329+# message already says).
330+drift_norm() { grep -v '^#' "$1" | awk -F'\t' -v OFS='\t' 'BEGIN{off=1} $1 ~ /^crates\/.*\/fixtures\//{if(off && $6!="-") $6="-"} {print}'; }
331+OFFGIT=0
332+[ -e "$ROOT/.git" ] || OFFGIT=1
333+if ! diff -u <(drift_norm "$MANIFEST") <(drift_norm "$regen") >"$patch" 2>&1; then
325 if [ "$REQUIRE" != 0 ]; then334 if [ "$REQUIRE" != 0 ]; then
326 echo "FAIL: this tree's library does not match what the code reaches" >&2335 echo "FAIL: this tree's library does not match what the code reaches" >&2
327 echo " (DRIFT: the committed manifest's rows differ from a regeneration" >&2336 echo " (DRIFT: the committed manifest's rows differ from a regeneration" >&2