Repository navigation
fix(conformance): detect a corrupted cached clone instead of trusting the directory - #27
Merged
Merged
Conversation
… 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The failure
scripts/conformance.shcaches 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 aconformance/directory whose.githas lostHEAD,config, andrefs. The guard tested for the directory: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_TEMPper 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:
HEAD,config, andrefsfrom the cached clone, reproducing the reaper's damage.git -C … rev-parse --git-dirreportedfatal: not a git repository.make conformance→ the script re-cloned and the suite passed 40/40.CONFORMANCE_COMMIT(81eb1c3edaed…) andCONFORMANCE_PKG(@0.1.16) are untouched, so that is the same suite at the same pin — no goalpost moved.bash -nclean.🤖 Generated with Claude Code