diff --git a/nix/lib.nix b/nix/lib.nix index 226eb912d..5a08a7a53 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -165,6 +165,17 @@ NEW_HASH=$(echo "$OUTPUT" | awk '/got:/ {print $2; exit}') if [ -z "$NEW_HASH" ]; then + # Magic-Nix-Cache occasionally returns HTTP 418 / cache-throttled + # mid-run; nix then prints "outputs … not valid, so checking is + # not possible" without a `got:` line. That's an infrastructure + # blip, not a stale lockfile — warn + skip rather than failing + # the lint. A real hash mismatch would still surface in the + # primary `.#$ATTR` build, which is a separate CI job. + if echo "$OUTPUT" | grep -qE "throttled|HTTP error 418|substituter .* is disabled|some outputs of .* are not valid"; then + echo " skipped (transient cache failure — see primary nix build for real status)" >&2 + echo "$OUTPUT" | tail -8 >&2 + continue + fi echo " build failed with no hash mismatch:" >&2 echo "$OUTPUT" | tail -40 >&2 exit 1