Skip to content

fix(conformance): detect a corrupted cached clone instead of trusting the directory - #27

Merged
blakebauman merged 1 commit into
mainfrom
fix/conformance-cache-guard
Aug 10, 2026
Merged

blakebauman merged 1 commit into
mainfrom
fix/conformance-cache-guard

Conversation

@blakebauman

Copy link
Copy Markdown
Member

The failure

scripts/conformance.sh caches its clone of the conformance repo in a temp directory, and the OS is free to reap that. macOS deletes untouched files under /var/folders, and a partial sweep leaves a conformance/ directory whose .git has lost HEAD, config, and refs. The guard tested for the directory:

if [[ ! -d "$work/conformance" ]]; then
  git clone --quiet "$CONFORMANCE_REPO" "$work/conformance"
fi
git -C "$work/conformance" fetch ...   # fatal: not a git repository

So it called that a cache hit and handed git a shell of a repo — failing every local run from then on, until someone knew to delete the directory by hand.

This is how it presented while gating the v1.8.0 release: a red conformance step with nothing wrong in the repo. Easy to misread as a real conformance failure on the day you least want ambiguity.

The fix

Ask git whether it is a repository rather than asking the filesystem whether a directory exists, and re-clone when the answer is no.

CI never sees this — a fresh RUNNER_TEMP per run means the cache is always cold — which is both why it had to be caught locally and why this changes nothing about what CI verifies.

Verification

Against the real failure, not a clean tree:

  1. Deleted HEAD, config, and refs from the cached clone, reproducing the reaper's damage.
  2. Confirmed git -C … rev-parse --git-dir reported fatal: not a git repository.
  3. Ran make conformance → the script re-cloned and the suite passed 40/40.

CONFORMANCE_COMMIT (81eb1c3edaed…) and CONFORMANCE_PKG (@0.1.16) are untouched, so that is the same suite at the same pin — no goalpost moved. bash -n clean.

🤖 Generated with Claude Code

… the directory

The script caches its clone of the conformance repo in a temp directory, and
the OS is free to reap that: macOS deletes untouched files under /var/folders,
and a partial sweep leaves a conformance/ directory whose .git has lost HEAD,
config, and refs. The guard tested for the directory, called that a cache hit,
and handed git a shell of a repo — "fatal: not a git repository", on every
local run from then on, until someone knew to delete the directory by hand.
That is exactly how it presented while gating the v1.8.0 release: a red
conformance step with nothing wrong in the repo.

Ask git whether it is a repository rather than asking the filesystem whether a
directory exists, and re-clone when the answer is no.

CI never sees this — a fresh RUNNER_TEMP per run means the cache is always
cold — which is the reason it had to be caught locally and the reason this
does not change what CI verifies.

Verified against the real failure rather than a clean tree: deleted HEAD,
config, and refs from the cached clone, confirmed git reported "not a git
repository", then ran make conformance — the script re-cloned and the suite
passed 40/40. CONFORMANCE_COMMIT and CONFORMANCE_PKG are untouched, so that is
the same suite at the same pin.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman merged commit 94c2eb0 into main Aug 10, 2026
6 checks passed
@blakebauman
blakebauman deleted the fix/conformance-cache-guard branch August 11, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant