homebrew: fix brew style failure, sync formula to v5.5.0, preserve tap bottles#1626
Merged
Merged
Conversation
…e tap bottles
- Replace Formula["python@3.12"].opt_bin with formula_opt_bin("python@3.12"):
Homebrew's new FormulaPathMethods cop (brew 2026-06-22) fails brew style on
the old form, which broke Deploy Homebrew Tap and Homebrew Formula Test on
the v5.5.0 release.
- Bump the in-repo formula url/sha256 to v5.5.0 to match the tap, so the
push-triggered tap deploy does not downgrade the tap back to v5.2.0.
- Preserve the tap's existing bottle block in deploy-tap.yml when the release
URL is unchanged, so formula-only pushes to master no longer delete bottles
built for the current version.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Homebrew packaging and deployment workflow to keep the in-repo formula aligned with the v5.5.0 release and to prevent brew style failures and inadvertent bottle loss when syncing the formula into the MFlowCode/homebrew-mfc tap.
Changes:
- Updates the Homebrew formula to v5.5.0 (URL + sha256) and fixes the new
brew stylecop by switching toformula_opt_bin("python@3.12"). - Adjusts
deploy-tap.ymlto preserve the tap’s existingbottle doblock when the release URL is unchanged, avoiding bottle deletion on formula-only pushes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packaging/homebrew/mfc.rb | Bumps formula to v5.5.0 and updates Python path usage to satisfy new Homebrew style rules. |
| .github/workflows/deploy-tap.yml | Preserves existing tap bottles when syncing the formula on non-version-bump updates. |
| NEW_URL="$(grep -E '^ url ' packaging/homebrew/mfc.rb || true)" | ||
| OLD_URL="$(grep -E '^ url ' tap-repo/Formula/mfc.rb 2>/dev/null || true)" | ||
| if [[ -n "${NEW_URL}" && "${NEW_URL}" == "${OLD_URL}" ]] && grep -q '^ bottle do' tap-repo/Formula/mfc.rb; then | ||
| awk '/^ bottle do/,/^ end$/' tap-repo/Formula/mfc.rb > /tmp/bottle.block |
- Push-to-master deploys previously copied the in-repo formula verbatim into the tap. Since homebrew-release.yml bumps the tap directly on releases, the repo copy lags behind and such a push would downgrade the tap and delete its bottles. The copy step now adopts the tap's url/sha256 whenever the tap pins a newer release, and the tap commit message uses the deployed version. - Remove the 'create' (tag) trigger: homebrew-release.yml already owns tag releases, so both workflows raced to push the tap on every tag, and this one put a strict brew audit on the release critical path (the v5.5.0 failure). Tag handling is kept for manual dispatch from a tag ref.
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.
Description
The v5.5.0 release runs of Deploy Homebrew Tap and Homebrew Formula Test both failed on the same
brew styleoffense: Homebrew added a new RuboCop cop,Homebrew/FormulaPathMethods(Homebrew/brew, 2026-06-22), and both workflows install latest brew viasetup-homebrew@master. The formula itself hadn't changed since February. Note the release still shipped:homebrew-release.ymlsucceeded and the tap already serves v5.5.0 with bottles.Commit 1 — formula fixes
Formula["python@3.12"].opt_bin→formula_opt_bin("python@3.12")inpackaging/homebrew/mfc.rb. The helper is defined inUtils::Pathand included inFormula, so it is equivalent at install time.url/sha256to v5.5.0 (sha256 computed independently from the release tarball; matches the tap).Commit 2 — deploy-tap.yml hardening
homebrew-release.ymlbumps the tap directly on releases, the repo copy lags behind, and a formula-only push would have downgraded the tap and deleted its bottles. The copy step now adopts the tap'surl/sha256whenever the tap pins a newer release, and preserves the tap'sbottle doblock whenever the pinned release is unchanged. Genuine version bumps still drop the stale bottle block as before.create:(tag) trigger —homebrew-release.ymlalready owns tag releases, so both workflows raced to push the tap on every tag, and this one put a strictbrew auditon the release critical path (exactly what turned red for v5.5.0). Tag handling is kept for manualworkflow_dispatchfrom a tag ref.Type of change
Testing
brew style packaging/homebrew/mfc.rb(Homebrew 6.0.6, includes the new cop): old formula reproduces the CI failure, fixed formula passes.All merged outputs pass
brew styleandruby -c.deploy-tap.ymlparses as valid YAML; PR checks on this branch exercise both previously-failing workflows in audit mode.Checklist
brew style/merge-script scenario runs above; no test-suite surface for packaging CI)AI code reviews
Reviews are not retriggered automatically. To request a review, comment on the PR:
@claude full review— Claude full review (also triggers on PR open/reopen/ready)claude-full-review— Claude full review via label