Repository navigation
scripts: build rbgo every run instead of reusing a /tmp binary - #968
Merged
Merged
Conversation
Five harnesses defaulted RBGO to a fixed /tmp path and reused whatever was already there: rubyspec/run.sh (/tmp/rbgo-rubyspec), rspec/run.sh, apps/run.sh and oracle.sh (/tmp/rbgo, which rspec/run.sh writes from any checkout), and bench/modules/run.sh (/tmp/rbgo, never built at all). On a machine with several checkouts, a sweep could measure another commit's interpreter and print the same line as a fresh build. With RBGO unset, each now builds ./cmd/rbgo from its own checkout into a mktemp -d directory and removes it on EXIT. An explicit RBGO is still honoured. rubyspec/run.sh and rspec/run.sh print the binary's vcs.revision/vcs.modified, read from the binary itself. rubyspec/run.sh also leaked files on every run. Its second trap replaced the first without naming the rbgo directory, and the final `exec` of the judge skipped EXIT traps altogether. The judge now runs as a child process followed by `exit $?`, and one trap removes RESULTS, the ratchet directory and the rbgo directory. The README's cmd/phantom recipe pointed -rbgo at /tmp/rbgo-rubyspec, which no longer exists after a run. It now builds its own binary. Closes #964 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
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.
Summary
Closes #964.
When
RBGOwas unset, five harnesses used a fixed/tmpbinary and reused whatever was already there.scripts/conformance/rubyspec/run.sh/tmp/rbgo-rubyspec, built only if absentscripts/conformance/rspec/run.sh/tmp/rbgo, built only if absentscripts/conformance/apps/run.sh/tmp/rbgo, else/tmp/rbgo-appsscripts/oracle.sh/tmp/rbgo, else/tmp/rbgo-oraclebench/modules/run.sh/tmp/rbgo, never builtOn a machine with several checkouts, a sweep or a benchmark could run another commit's interpreter. The output looked the same as after a fresh build.
Each script now builds
./cmd/rbgofrom its own checkout into amktemp -ddirectory and removes that directory on exit. An explicitRBGOis still used as given.rubyspec/run.shandrspec/run.shalso print the binary'svcs.revisionandvcs.modified, read withgo version -m.A cleanup leak in
rubyspec/run.shrubyspec/run.shleft files behind on every run, for two reasons:trapreplaced the first and did not name the rbgo directory.exec "$RATCHET"replaced the shell, so no EXIT trap ran.The judge now runs as a child process followed by
exit $?. Its exit codes reach the caller unchanged: 0 ok, 1 regression, 2 unreadable input. A single trap now removes the results file, the ratchet directory and the rbgo directory.Docs
The
cmd/phantomrecipe inscripts/conformance/rubyspec/README.mdpointed-rbgoat/tmp/rbgo-rubyspec, which no longer exists after a run. The recipe now builds its own binary first.Test plan
gotest -count=1 . -run "TestASpecCannotDictateItsOwnRecordedPassCount|TestAHandRunStillGetsItsTallyOnStdout|TestShellCodeHasSeesCodeAndNotComments|TestTheRatchetReadsTheTallyFromItsOwnFile": all four ran and passed (27 s).bash -n/sh -non all five scripts: clean.scripts/oracle.sh -e 'p [1, 2, 3].sum'withRBGOunset: it built its own binary, and rbgo, MRI, JRuby and TruffleRuby all printed6(agree).rubyspeclane).🤖 Generated with Claude Code