Skip to content

fix(brew): Rename postflight to postflight_steps for puremac cask - #166

Closed
quirico wants to merge 1 commit into
momenbasel:mainfrom
quirico:patch-1
Closed

quirico wants to merge 1 commit into
momenbasel:mainfrom
quirico:patch-1

Conversation

@quirico

@quirico quirico commented Sep 7, 2026 •

Copy link
Copy Markdown

postflight is deprecated. Changed to postflight_steps to suppress brew warning while updating:

Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead.
Please report this issue to the momenbasel/homebrew-tap tap (not Homebrew/* repositories), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/momenbasel/homebrew-tap/Casks/puremac.rb:16

What does this PR do?

Replace deprecated postflight with postflight_steps in homebrew script

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • UI/UX enhancement
  • Documentation
  • Other (describe)

Testing

  • Tested on macOS Ventura (13.x)
  • Tested on macOS Sonoma (14.x)
  • Tested on macOS Sequoia (15.x)

Screenshots

`postflight` is deprecated. Changed to `postflight_steps`.
@quirico quirico changed the title fix(brew): Rename postflight to postflight_steps fix(brew): Rename postflight to postflight_steps for puremac cask Sep 9, 2026
momenbasel added a commit that referenced this pull request Oct 8, 2026
Homebrew 7 deprecates the postflight block (cask/dsl.rb calls odeprecated
for every ARTIFACT_BLOCK_CLASSES key). The steps DSL has no appdir method,
so the block is rewritten with `run` and the `{{appdir}}` template token
that install_steps.rb expands inside args. Loads through
Cask::CaskLoader::FromPathLoader as App,PostflightSteps,Zap with no warning.

Supersedes #166 by @quirico: the stanza rename there was right, but the unchanged
`#{appdir}` interpolation raises NameError inside the steps DSL and makes
the cask unreadable.
@momenbasel

Copy link
Copy Markdown
Owner

Thanks, the diagnosis is right: Homebrew 7 deprecates the postflight block and postflight_steps is the replacement. The rename alone breaks the cask, though. The steps block is evaluated by Homebrew::InstallSteps::DSL, which has no appdir, so loading this version fails with undefined local variable or method 'appdir' for an instance of Homebrew::InstallSteps::DSL and every brew install puremac would report the cask as unreadable. The steps DSL wants run with the {{appdir}} template token, which install_steps.rb expands inside args.

#182 carries that form, verified through Cask::CaskLoader::FromPathLoader (loads as App, PostflightSteps, Zap with no warning), and names you for the report. The tap gets the same stanza with the next release bump, since the release workflow only rewrites version and sha. Closing in favour of #182.

@momenbasel momenbasel closed this Oct 8, 2026
momenbasel added a commit that referenced this pull request Oct 8, 2026
…182)

Homebrew 7 deprecates the postflight block (cask/dsl.rb calls odeprecated
for every ARTIFACT_BLOCK_CLASSES key). The steps DSL has no appdir method,
so the block is rewritten with `run` and the `{{appdir}}` template token
that install_steps.rb expands inside args. Loads through
Cask::CaskLoader::FromPathLoader as App,PostflightSteps,Zap with no warning.

Supersedes #166 by @quirico: the stanza rename there was right, but the unchanged
`#{appdir}` interpolation raises NameError inside the steps DSL and makes
the cask unreadable.
@quirico

quirico commented Oct 9, 2026 •

Copy link
Copy Markdown
Author

Thank you @momenbasel for the clarification. And the mention, too! 😊

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.

2 participants