Skip to content

api: fix every formula having a post install defined#22378

Merged
MikeMcQuaid merged 1 commit into
mainfrom
formula-api-post-install-defined-fix
May 22, 2026
Merged

api: fix every formula having a post install defined#22378
MikeMcQuaid merged 1 commit into
mainfrom
formula-api-post-install-defined-fix

Conversation

@Bo98

@Bo98 Bo98 commented May 22, 2026

Copy link
Copy Markdown
Member

We compact_blank the hash so false is omitted and never overrides the default of true.

I'm surprised nobody noticed the slowdown.


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts Homebrew::API::FormulaStruct so post_install_defined correctly defaults when the key is omitted from API hashes due to compact_blank/deep_compact_blank, avoiding treating every formula as having post_install defined (and the associated slowdown).

Changes:

  • Change post_install_defined default from true to false in Homebrew::API::FormulaStruct.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/api/formula_struct.rb
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 03684f7 May 22, 2026
41 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the formula-api-post-install-defined-fix branch May 22, 2026 08:00
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.

3 participants