Repository navigation
test(regression): #812 pin suite TMPDIR under a space-free scratch anchor - #864
Merged
Merged
Conversation
…chor The #820 space-free THIS_SH pin closed the ${THIS_SH} face, but the errors-family machine dependence had a second live input the CI lane could never see: the runner forwards ambient TEMP/TMP, the engine self-injects a Windows TMPDIR default from that process temp dir (executor/init.rs, the /tmp mapping fixture), and the upstream assets expand $TMPDIR UNQUOTED for real faces in three slices: - heredoc.tests:115-124: cat > ${TMPDIR}/bash-zzz-$$ heredoc round-trip - quote.tests:136-141: printf ... > $TMPDIR/quote-$$, re-sourced via ${THIS_SH} $TMPDIR/... - redir.tests:35-119: the $TMPDIR file battery incl. the testf/'oops -- $1 not found' branch Verified on master HEAD (45f537e): with TEMP='D:\temp-812\rub temp' the snapshot lane diverges from the committed bytes in exactly those three slices (heredoc 1483 -> 1463 bytes; quote drops the 'escape\' line; redir prints 'oops -- /d/temp-812/rub not found') while a space-free TEMP stays green — machine-dependent bytes across Windows hosts, invisible to CI, the same degenerate shape as the THIS_SH face one layer over (a space in a machine-absolute path met by unquoted upstream expansion). Same contractual move as #820 and as true-baseline.sh's GNU side (TMPDIR="$w/tmp" in scripts/true-baseline.sh): the lane now 1. anchors the per-suite scratch at a space-free root (ambient temp when it is space-free, else %SystemRoot%\Temp; neither -> loud panic), so HOME/.thissh/TMPDIR share one machine-independent shape, 2. exports TMPDIR=<scratch>/tmp to the suite child, created eagerly (the assets redirect into $TMPDIR with no mkdir). No re-record: $TMPDIR's value never prints on a success face in any of the 13 slices (file targets and PATH assignments only), so bytes on a space-free host are unchanged — the committed snapshots diff clean; a spaced-TEMP host converges onto them. Bonus: the spaced-host junk side effect is gone (errors10.sub's unquoted 'mkdir $TDIR' used to create a word-split directory OUTSIDE the scratch and 'rm -rf' it afterwards). Verification, both at HEAD: - space-free host: snapshot lane green 13/13, snapshots byte-identical; - spaced TEMP: pre-fix 3 slices diverged (reproduced above), post-fix green 13/13 byte-identical, no scratch leftovers, no junk dirs; - cargo test --test regression -- --test-threads=1: 76 passed / 0 failed; - cargo fmt --check clean; cargo check --tests: no warning touches tests/regression.rs.
Member
Author
Independent code review — verdict: APPROVE-WITH-NITSReviewed independently from a fresh detached worktree at b287e5a with a separate detached baseline tree at 45f537e (own builds, own scratch under Verified (all re-executed, not taken from the description)
Nits (non-blocking)
Merging is safe from my side: the lane is machine-independent in both verified host shapes, fails loudly on a third, and the committed bytes are provably the fixed point of both. |
1 task done
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.
Closes #812 (residual face; the ${THIS_SH} half landed in #820).
What was still live on master
#820 pinned ${THIS_SH} to a space-free engine copy, but the errors-family snapshot machine dependence had a second machine-absolute input the CI lane could never see: the runner forwards ambient
TEMP/TMP(the machine-infrastructure whitelist), the engine self-injects a WindowsTMPDIRdefault from that process temp dir (executor/init.rs, the /tmp mapping fixture), and the upstream assets expand/c/Users/cmx/AppData/Local/TempUNQUOTED for real faces in three slices:cat > ${TMPDIR}/bash-zzz-$$ << EOFheredoc round-trip (abc/def ghi/jkl mno)printf 'echo escape\' > $TMPDIR/quote-$$re-sourced through${THIS_SH} $TMPDIR/quote-$$> $TMPDIR/null-redir-a+testf'soops -- $1 not foundbranchUnder a spaced ambient TEMP every one of those paths word-splits: the faces go silent or fall to the oops branch. Verified on master HEAD (45f537e) with
TEMP='D:\temp-812\rub temp':escape\line;oops -- /d/temp-812/rub not found(the spaced path, split);while a space-free TEMP stays green — CI (
windows-latestsystemprofile TEMP) can never reproduce it. Same degenerate shape as the THIS_SH face, one layer over: a space in a machine-absolute path met by unquoted upstream expansion.Fix — the #820/true-baseline contractual move
Same direction as the THIS_SH pin and as the GNU side's own contract (
TMPDIR="$w/tmp"in scripts/true-baseline.sh):space_free_temp_root()anchors the per-suite scratch at a space-free root — ambient temp when it is space-free, else%SystemRoot%\Temp, neither -> loud panic. HOME, the.thisshpin and TMPDIR then share one machine-independent shape on every host.TMPDIR=<scratch>/tmpto the suite child, created eagerly (the assets redirect into $TMPDIR with no mkdir).No re-record. $TMPDIR's value never prints on a success face in any of the 13 slices (file targets and
PATH=$TMPDIRassignments only), so bytes on a space-free host are unchanged; a spaced-TEMP host converges onto the committed bytes. Being under the scratch, even a hypothetical leak renders as the normalized<T>shape. Bonus: the spaced-host junk side effect is gone — errors10.sub's unquotedmkdir $TDIRused to create a word-split directory outside the scratch andrm -rfit afterwards.No GNU source touched; runner-side determinism only, normalizer untouched.
Verification
escape\; rediroopslines); space-free host green 13/13.cargo test --test regression -- --test-threads=1-> 76 passed / 0 failed.cargo fmt --checkclean repo-wide. Warnings:cargo check --tests— zero warnings touchtests/regression.rs(pre-existing warnings elsewhere untouched).