Skip to content

Keep going when brew bundle fails, and run setup.sh in CI - #6

Merged
maximn merged 5 commits into
mainfrom
brew-bundle-keep-going
Oct 10, 2026
Merged

maximn merged 5 commits into
mainfrom
brew-bundle-keep-going

Conversation

@maximn

@maximn maximn commented Oct 10, 2026

Copy link
Copy Markdown
Owner

A failed cask used to stop setup.sh under set -e, so the shell, Ghostty, herdr, git and Docker steps were skipped even though none of them need Homebrew to have succeeded. The usual trigger is an app that's already installed by hand ("It seems there is already an App at /Applications/Google Chrome.app"), which is common on any Mac that isn't brand new.

  • setup.sh carries on when brew bundle fails, then lists the Brewfile entries that are still missing (brew bundle check --verbose) and exits non-zero.
  • The Brewfile sets cask_args adopt: true, so apps installed by hand are handed over to Homebrew instead of failing.
  • New CI job on macos-latest: runs ./setup.sh, snapshots the installed packages and the config files it touches, runs it a second time and diffs the snapshots, so any step that isn't idempotent fails the build. It then checks that an interactive zsh starts without printing anything.
  • The Brewfile check now reads brew info --json=v2 and fails on deprecated or disabled packages. Plain brew info succeeds for those, so a cask on its way out went unnoticed.

The new macOS job is the first time CI runs the script end to end, so it's also the proof the fix works: GitHub's runners ship with Chrome installed and hit the original bug straight away.

🤖 Generated with Claude Code

A failed cask used to stop setup.sh under set -e, skipping the shell, Ghostty,
herdr, git and Docker steps that don't depend on it. Now the script carries on,
lists the missing Brewfile entries at the end and exits non-zero.

The Brewfile sets cask_args adopt: true, so apps installed by hand (like Chrome)
are taken over instead of failing with "It seems there is already an App".

CI gains a macOS job that runs setup.sh twice, checks the second run changes
nothing and that an interactive zsh starts without errors. The Brewfile check
now also fails on deprecated or disabled packages, which brew info accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maximn and others added 4 commits October 10, 2026 20:47
zsh can't turn its line editor on without a terminal, so `zsh -i -c exit` in
CI printed "can't change option: zle" no matter what the config does. Run it
under a pty via script(1), and strip escape sequences so the prompt itself
doesn't count as output.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Under script(1) the pty echoes the EOF character when stdin closes, so the
check saw "^D^H^H" and failed. Strip control characters after the escape
sequences, leaving only text a human would read as a message.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The EOF that ends the script(1) session is echoed as printable caret notation
("^D"), not as the control character, so stripping control characters left it
behind. Drop lines made up of nothing but caret notation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous filter used a GNU-only character range, so BSD sed on the macOS
runner rejected it ("RE error: invalid character range") and the step failed on
its own regex rather than on anything zsh printed. Do the whole job in perl,
which behaves the same on both platforms: strip escape sequences, control
characters and the pty's caret-notation echo, and treat whatever is left as a
real message. Non-ASCII text in a message survives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@maximn
maximn merged commit 7e7c7c5 into main Oct 10, 2026
5 checks passed
@maximn
maximn deleted the brew-bundle-keep-going branch October 10, 2026 21:02
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