Skip to content

Homebrew cask hook emits the deprecated postflight stanza (馃憠馃徎 requires Goreleaser v2.19)聽#821

Open

Description

@pszypowicz

What happens

Homebrew prints this warning on every brew command that loads the tfswitch cask:

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

The stanza comes from the hooks.post.install setting in .goreleaser.yml. GoReleaser copies that Ruby block into the cask as postflight do ... end.

Why the tap fix does not last

I opened warrensbox/homebrew-tap#11 to replace the block with postflight_steps in the tap. GoReleaser regenerates Casks/tfswitch.rb on every release, and the current version (v2.18.1) still writes the legacy postflight block from the install hook. The next release will overwrite the tap file and bring the warning back.

What is coming in GoReleaser

goreleaser/goreleaser#6870 tracks this. goreleaser/goreleaser#6873 adds a new hooks.post.install_steps option that writes postflight_steps, and the maintainer targets v2.19. The old install option keeps its current output, so this repository needs a config change after that release.

Proposed change

After GoReleaser v2.19 ships, replace the install hook in .goreleaser.yml:

    hooks:
      post:
        install_steps: |
          on_macos do
            run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ .StagedPath }}/tfswitch"]
          end

{{ .StagedPath }} is a new template field from the same PR. GoReleaser uses the same delimiters as Homebrew tokens, so a plain {{staged_path}} does not survive templating. The release workflow runs GoReleaser with version: latest, so no version bump is needed.

I can open a PR for this once v2.19 is available, if you want.

Activity

  1. yermulnik commented on Sep 9, 2026

    @yermulnik
    Collaborator

    Thanks for noticing. Do you fancy keeping an eye on Goreleaser v2.19 release and creating a PR here to implement the change once they release new version? Appreciate your time.

    The warrensbox/homebrew-tap#11 makes no sense as of automation as you mentioned in the issue description here.
    @warrensbox might want to apply it there though with the already highlighted caveat that the change will be overwritten once we release any new version of tfswitch.

  2. changed the title [-]Homebrew cask hook emits the deprecated `postflight` stanza[/-] [+]Homebrew cask hook emits the deprecated `postflight` stanza (馃憠馃徎 requires Goreleaser v2.19)[/+] on Sep 9, 2026
  3. pszypowicz commented on Sep 9, 2026

    @pszypowicz
    ContributorAuthor

    @yermulnik Sure, in the meantime i prepared the draft PR once it lands: #822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreAdditions and changes to CI

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions