Allow staged install step conversion#22960
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Homebrew’s staged install-step “bridge” behavior so formula post_install_steps can run before a remaining legacy post_install, enabling incremental tap conversions without blocking on unrelated Ruby hook work. It also adjusts RuboCop and DSL ordering rules (formula + cask) to reflect the intended runtime/transition order, and documents the deprecation target and verification workflow.
Changes:
- Run formula
post_install_steps(if defined) and then run legacypost_install(if defined), instead of treating them as mutually exclusive. - Add/adjust RuboCop rules + tests to allow temporary coexistence while enforcing ordering (
*_stepsmust appear before the matching legacy hook/stanza). - Update documentation/planning notes to reflect the conversion bridge, ordering expectations, and deprecation goals.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/test/rubocops/install_steps_spec.rb | Updates cop expectations to allow coexistence and adds an ordering offense test. |
| Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb | Adds a test asserting *_steps stanzas should be ordered before legacy *flight stanzas. |
| Library/Homebrew/test/formula_spec.rb | Reworks formula expectations to track coexistence via “defined?” predicates rather than conflict. |
| Library/Homebrew/test/cmd/postinstall_spec.rb | Adds a regression test ensuring brew postinstall runs steps before legacy post_install. |
| Library/Homebrew/rubocops/install_steps.rb | Disables the conflict offense (temporarily) and adds an ordering offense for formula hooks. |
| Library/Homebrew/rubocops/cask/constants/stanza.rb | Reorders stanza groups so *_steps come before matching legacy *flight stanzas. |
| Library/Homebrew/json_api_postinstall_preflight_postflight_plan.md | Updates the plan to describe the temporary bridge, ordering rules, and end-state deprecation goals. |
| Library/Homebrew/formula.rb | Removes conflict/warning helpers now that coexistence is supported. |
| Library/Homebrew/formula_installer.rb | Changes install finishing to run post_install_steps and then post_install when both are defined. |
| Library/Homebrew/cmd/postinstall.rb | Updates brew postinstall to run steps first and only warn when neither legacy hook nor steps exist. |
| docs/Formula-Cookbook.md | Documents that coexistence is allowed during incremental conversions and clarifies runtime order. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Let formula steps run before a remaining `post_install` so tap migrations can move repeated statements without blocking on unrelated Ruby work. - Cover the main installer finish path so steps continue to run before `post_install` outside the explicit `brew postinstall` command. - Keep the legacy conflict check as a TODO because side-by-side use is only a temporary conversion bridge. - Make formula and cask DSL ordering reflect runtime order while the bridge exists. - Record the final deprecation target and local tap verification workflow so follow-up tap PRs have a concrete success condition.
5560914 to
c20acf4
Compare
p-linnane
approved these changes
Jul 5, 2026
p-linnane
left a comment
Member
There was a problem hiding this comment.
I think this is a solid way of handling the transition.
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.
post_installso tap migrations can move repeated statements without blocking on unrelated Ruby work.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review and testing.