Skip to content

fix(cli): Install Homebrew completions from the formula - #1555

Merged
BYK merged 1 commit into
mainfrom
fix/cli-homebrew-completions-skills
Oct 21, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/cli-homebrew-completions-skills

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #1545.

Homebrew runs post_install under a temporary HOME and deletes it afterwards. So the formula's sentry cli setup --method brew --no-modify-path wrote completions, agent skills, and install metadata into a directory that was thrown away.

Changes to the formula template in .craft.yml:

  • Completions: generated during install with generate_completions_from_executable(bin/"sentry", "cli", "completion"), which writes them to Homebrew's own bash/zsh/fish completion dirs. These persist, and brew uninstall removes them.
  • post_install removed: it never left anything behind. Removing it also gets rid of Homebrew's post_install deprecation warning.
  • Caveats added: they tell users to run sentry cli setup --no-modify-path --no-completions to install the agent skill, and to run it again after brew upgrade. sentry cli upgrade already reruns setup by itself.

The install-method record doesn't need a replacement: the CLI already detects Homebrew from the Cellar realpath before it reads stored info.

The docs (getting-started.mdx, agentic-usage.md, plugins/README.md) no longer say Homebrew installs agent skills automatically, and they now show the manual step.

This only reaches users with the next CLI release, when craft regenerates getsentry/homebrew-tools/Formula/sentry.rb.

Still a draft: the formula hasn't been tested with a real brew install on macOS.

via byk.

--

View Junior Session in Sentry

Homebrew runs post_install under a throwaway HOME, so the
`sentry cli setup` call there wrote completions, agent skills, and
install metadata into a temp dir that was deleted right after.

Generate completions into Homebrew's own completion dirs during
install, drop the no-op post_install, and add caveats telling users
to run `sentry cli setup` for agent skills. Update docs that claimed
Homebrew installs skills automatically.

Fixes #1545

Co-Authored-By: byk <[email protected]>
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Oct 20, 2026 3:51pm UTC

Request Review

@sentry-junior sentry-junior Bot added the CLI Sentry CLI and CLI documentation label Oct 20, 2026
@BYK
BYK marked this pull request as ready for review October 20, 2026 16:39
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 20, 2026
@BYK
BYK merged commit 36d7aa5 into main Oct 21, 2026
35 checks passed
@BYK
BYK deleted the fix/cli-homebrew-completions-skills branch October 21, 2026 16:56
BYK added a commit that referenced this pull request Nov 7, 2026
…etions (#2077)

Fixes #2048.

`brew upgrade sentry` to 0.48.0 fails with `exec failed (EACCES)` in
`generate_completions_from_executable`, and the upgrade rolls back.

The binary isn't executable when `install` runs. The release assets are
bare `.gz` files, and gzip stores no file mode. Homebrew's `Gzip` unpack
strategy copies the downloaded file and runs `gunzip`, so `sentry` comes
out as `0644`. Homebrew's `Cleaner` sets the exec bit on Mach-O and ELF
files, but only after `install` finishes. Before #1555 the formula first
ran the binary in `post_install`, which runs after the cleaner, so
nobody hit this.

The fix adds `chmod 0755, bin/"sentry"` right after `bin.install` in the
`.craft.yml` formula template.

### Verification

I ran a real `brew install` on Linux x86_64, using a Homebrew checkout
and a local tap:

- **0.48.0 formula as published:** fails with the same error as the
issue: `brew: exec failed (EACCES): .../Cellar/sentry/0.48.0/bin/sentry`
… `sentry cli completion bash exited with 1`.
- **Same formula with the `chmod` line:** installs. `bin/sentry` ends up
`-r-xr-xr-x`, bash, zsh, and fish completions are written to the keg,
and `brew test` passes.

I didn't test on macOS. The cause and the code paths are the same on
both platforms: the macOS cleaner checks for Mach-O and the Linux
cleaner checks for ELF.

### Note

Users only get this fix when the next CLI release regenerates
`getsentry/homebrew-tools/Formula/sentry.rb`. Until then, `brew upgrade`
to 0.48.0 keeps failing unless that formula is patched by hand too.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A974df5db8f58bc138575c36a -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A974df5db8f58bc138575c36a/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — d435b1db Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Sentry CLI and CLI documentation risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): Homebrew post-install writes setup into a throwaway HOME, so completions and agent skills are never installed

1 participant