Repository navigation
Conversation
The EXIT trap ran after install_brew returned, when the local variable was gone, so set -u failed the step after a successful install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run setup-macos-homebrew.sh with a local fake installer and its own checksum, selected by test-only overrides that need SETUP_MACOS_HOMEBREW_TEST=1. The test fails with "installer: unbound variable" when the exit-trap fix is removed, and checks that a wrong checksum stops the installer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project d-inference with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Threat model review — advisoryReviewed head Reviewers: anthropic/claude-opus-5.5: completed; openai/gpt-6-astra: completed No actionable findings in the reviewed text. This is not a security approval. Coverage: 4 changed file(s), complete before/after text, and a cross-file threat-model review. Models: anthropic/claude-opus-5.5, openai/gpt-6-astra. Findings require human validation; this review never requests changes or blocks merging. |
Assert installer cleanup directly after the wrong-checksum run, write the fake installed brew with one sed redirect, and spell the bad digest as printf '%064d' 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project eigen-homepages-darkbloom with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
|
Deployment failed for project d-inference-landing with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
|
Deployment failed for project d-inference-console-ui-dev with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Summary
Since #1288, Integration Tests on master fail in the "Set up Homebrew" step. Homebrew installs, but the script then fails at exit. This PR fixes the exit trap in
scripts/setup-macos-homebrew.shand adds an offline test of the install path through to script exit.Linked issue
None. Follow-up to #1288.
The failure
Master run 36799584075 (Integration Tests on 5544167), step "Set up Homebrew":
Cause
install_brewdeclaredinstalleraslocaland settrap 'rm -f "$installer"' EXIT. The trap runs when the script exits, afterinstall_brewhas returned. At that time the local variable is gone, soset -ustops the script with exit code 1. The #1288 test covered only the path wherebrewis already installed, so it did not run the trap.Fix
installeris now a global variable, so the trap can still read it at exit.brewlocations. It reads them only whenSETUP_MACOS_HOMEBREW_TEST=1. No workflow sets that variable, so CI always uses the pinned values.New test
scripts/test-setup-macos-homebrew.shnow also tests the install path:PATHholds only system tools and a stubuname, so the script finds nobrewand runs the install path on Linux too.file://URL, with its own SHA-256) creates a fakebrew. The script runs it through to exit.NONINTERACTIVE=1 HOMEBREW_NO_ANALYTICS=1, that$GITHUB_ENVand$GITHUB_PATHhold the new prefix, and that the exit trap deleted the installer.The "Release Integrity" job already runs this test.
Diagrams
Before
After
Blue: unchanged. Red: the failing path. Green: the fixed path and the new test.
Test plan
./scripts/test-setup-macos-homebrew.shpasses with the fix.local installer, the test fails in the same way as master run 36799584075:shellcheckis clean on both scripts.actionlintis clean onintegration.yml,benchmarks.ymlandci.yml, and no workflow changed.make docs-impact-check BASE=origin/master,make docs-check(withlibs/mlx-swift-lmchecked out shallow): passComponents touched
Protocol / interface changes
Documentation impact
docs/developer/test.md,CHANGELOG.md)Notes for reviewers
🤖 Generated with Claude Code
Refactor Pass
A dedicated refactor subagent reviewed the diff against the
AGENTS.mdstructure, clean-code and refactor rules. Outcome: one test-only cleanup commit, f54164d. The production script is unchanged.test-setup-macos-homebrew.shnow checks thatRUNNER_TEMPis empty after the wrong-checksum run as well. Before, only the success run checked the failure path.sedredirect instead ofsed -i.bak, and the wrong digest usesprintf '%064d' 0.local installermakes the test fail withunbound variable, and removing the EXIT trap makes the new failure-path check fail.Validation on the final tree:
shellcheckon both scripts, the script test (ok),git diff --check,make docs-impact-check BASE=origin/master, andmake docs-check(326 OK) all pass.Probably redundant: master already has the core fix. Commit b1c14ed, folded into #1287, puts the installer path into the trap string with
printf %q, and its test stubscurl,shasumanduname. That fix is also why this branch conflicts with master. This PR still adds three things master lacks: a full run of the real install path with afile://URL, a wrong-checksum test, and a test-onlySETUP_MACOS_HOMEBREW_TESToverride in the production script. The newAGENTS.mddiscourages that kind of override. If the extra tests are still wanted, move them onto master's stub approach. Otherwise, close this PR.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.