Skip to content

lstk: use postflight_steps instead of deprecated postflight - #8

Merged
joe4dev merged 1 commit into
localstack:mainfrom
Dedsecproject:lstk-postflight-steps
Sep 22, 2026
Merged

joe4dev merged 1 commit into
localstack:mainfrom
Dedsecproject:lstk-postflight-steps

Conversation

@Dedsecproject

Copy link
Copy Markdown
Contributor

Summary

Fixes the Homebrew deprecation warning emitted by Casks/lstk.rb:

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

Changes

Replaces the legacy postflight block with the structured postflight_steps stanza required by Homebrew:

  • system_command ... + if OS.mac? \u2192 run step guarded by on_macos
  • Ruby interpolation #{staged_path} \u2192 {{staged_path}} template token (supported by the step runner)

Behavior is unchanged: /usr/bin/xattr -dr com.apple.quarantine is still executed against the staged binary after installation.

Verification

  • brew style: no offenses
  • Cask loads as Cask::Artifact::PostflightSteps with the serialized run step and on_macos guard, with no deprecation warning
  • Real brew install --cask localstack/tap/lstk on macOS (arm): installs successfully, quarantine attribute successfully removed by the post-install step

Note for maintainers

This tap appears to be generated by GoReleaser (the cask header says DO NOT EDIT). The upstream GoReleaser cask template still emits the legacy postflight stanza, so the next generated tap update may reintroduce it \u2014 a fix in GoReleaser itself may also be warranted for a permanent solution.

Replaces the legacy `postflight` block with the structured
`postflight_steps` stanza, which is now required by Homebrew:

- `system_command` + `if OS.mac?` \u2192 `run` step with an `on_macos` guard
- Ruby interpolation `#{staged_path}` \u2192 `{{staged_path}}` template token

This eliminates the deprecation warning:

  Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead.

All step calls (`run`, `on_macos`) and the `{{staged_path}}` token are
permitted in cask `*_steps` blocks. Behavior is unchanged: the
quarantine attribute is still removed during installation.
Copilot AI lite review requested due to automatic review settings September 10, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change cleanly migrates to the supported Homebrew Cask DSL (postflight_steps) without altering the intended post-install behavior.

Pull request overview

This PR updates the lstk cask to use Homebrew’s newer postflight_steps stanza to eliminate the deprecation warning emitted by the legacy postflight block, while keeping the post-install quarantine removal behavior intact.

Changes:

  • Replaced postflight do ... system_command ... end with postflight_steps do ... run ... end.
  • Added an on_macos guard inside postflight_steps so the xattr command only runs on macOS.
  • Switched the staged path reference to the step-runner template token ({{staged_path}}) for proper serialization/execution.
File summaries
File Description
Casks/lstk.rb Migrates the post-install step to postflight_steps to remove the Homebrew deprecation warning while preserving the macOS quarantine attribute removal.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@joe4dev joe4dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the quickfix @Dedsecproject

In general, we shouldn't edit lstk.rb manually as indicated by the comment # This file was generated by GoReleaser. DO NOT EDIT., but it won't hurt as it fixes the issue right away. It will be over-written with the next lstk release.

Mid-term, localstack/lstk#510 uses a custom block to generate a non-deprecated postflight_steps.

Long-term, we should adopt the out-of-the-box support of Golreleaser >=2.19, currently blocked by the open PR goreleaser/goreleaser#6873

@joe4dev
joe4dev merged commit 8bf4489 into localstack:main Sep 22, 2026
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