Skip to content

Update Homebrew postflight DSL - #84

Merged
aurorascharff merged 2 commits into
aurorascharff:mainfrom
jamesmontemagno:update-homebrew
Oct 5, 2026
Merged

aurorascharff merged 2 commits into
aurorascharff:mainfrom
jamesmontemagno:update-homebrew

Conversation

@jamesmontemagno

@jamesmontemagno jamesmontemagno commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • replace the deprecated postflight stanza with postflight_steps
  • migrate the xattr invocation to Homebrew's structured run install-step DSL
  • apply Homebrew's canonical stanza ordering and grouping
  • declare the macOS dependency, use a platform-neutral description, and simplify the single-item zap

Validation

  • ruby -c Casks/clicklight.rb
  • brew style --cask aurorascharff/clicklight/clicklight
  • brew audit --cask aurorascharff/clicklight/clicklight

Replace the deprecated postflight stanza and raw system call with Homebrew's structured postflight_steps run DSL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 13, 2026 15:15
@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

@jamesmontemagno is attempting to deploy a commit to the Aurora Scharff's projects Team on Vercel.

A member of the Team first needs to authorize it.

Apply canonical stanza ordering, declare the macOS dependency, use a platform-neutral description, and simplify the zap stanza.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review tier: Lite
Findings: None

What changed in this PR

Updates the ClickLight Homebrew cask to use the current install-step DSL.

Changes:

  • Replaces deprecated postflight with postflight_steps.
  • Migrates xattr cleanup to structured run syntax.
File Summary
Casks/​clicklight.rb Migrates the post-install command to supported Homebrew syntax.

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

Comment thread Casks/clicklight.rb
Comment on lines +15 to +16
postflight_steps do
run "/usr/bin/xattr", args: ["-cr", "{{appdir}}/ClickLight.app"]

@vercel vercel Bot Sep 13, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The postflight_steps block uses a non-existent run install step and an invalid template, breaking brew install --cask clicklight.

Fix on Vercel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

postflight was deprecated see: https://brew.sh/2026/09/13/homebrew-7.0.0/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're right that postflight is deprecated in Homebrew 7.0.0 (removal scheduled 2027-12-11) — but that doesn't make this migration valid. Two problems remain:

  1. postflight_steps has no run step. The 7.0.0 notes are explicit that the *_steps DSL provides "structured file operations and configuration writes ... without arbitrary Ruby" — i.e. mkdir/touch/mv/ln_s/etc. with literal args, not command execution. run "/usr/bin/xattr", ... isn't a supported step, so evaluating the block raises NoMethodError and brew install --cask clicklight fails outright.
  2. {{appdir}} isn't a valid template in the steps DSL (the original used Ruby interpolation #{appdir}).

The key point: clearing the quarantine attribute (xattr -cr) is command execution, which the steps DSL cannot express at all — so there's no postflight_steps equivalent for this cask.

Net effect: deprecated postflight still works until Dec 2027, whereas the current code is broken today. Recommended paths: keep the (deprecated but functional) postflight block for now, or drop the xattr step entirely if the notarized download doesn't actually need de-quarantining. It just can't be moved into postflight_steps as written.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is supported in Homebrew 7.0.0. I verified against the 7.0.0 tag itself:

  • Homebrew::InstallSteps::DSL#run is defined in Library/Homebrew/install_steps.rb (line 715).
  • appdir is listed in ABSOLUTE_TEMPLATE_TOKENS (line 65) and CONTENT_PATH_TOKENS (line 906).
  • Serialized run arguments are expanded via expand_template_tokens (line 1246).
  • Homebrew's own 7.0.0 tests execute run "/usr/bin/true" inside postflight_steps.

I also evaluated this exact DSL locally on Homebrew 7, which serializes successfully as a run step, and ran brew style, brew audit, and brew install --cask --dry-run; all pass. The constrained run action is not arbitrary Ruby, and {{appdir}} is the documented deferred template form, so no code change is needed.

Note

Auto-replied by the GitHub Copilot app.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're right, and I was wrong — thanks for the precise pointers. I verified against the 7.0.0 tag directly:

  • Homebrew::InstallSteps::DSL#run(command, args: [], …) is defined at Library/Homebrew/install_steps.rb:715 and serializes as a "run" step, executed by run_serialised_command (line 1244) via @command.run(...).
  • appdir is in both ABSOLUTE_TEMPLATE_TOKENS (line 65) and CONTENT_PATH_TOKENS (line 906), and {{appdir}} is expanded through expand_template_tokens (line 1246).

My earlier analysis was based on the initial cask-install-steps PR (#22373), which predated the run step landing — it wasn't in that iteration, so I incorrectly concluded no command execution was possible. The shipped 7.0.0 added it. Your migration is valid; dismissing the suggestion. 🙏

@sklakegg

sklakegg commented Oct 5, 2026

Copy link
Copy Markdown

Great tool @aurorascharff ⭐

Any chance we can have this merged so we can get rid of warnings when using brew? 🙏

@aurorascharff

Copy link
Copy Markdown
Owner

thanks for the nudge! @sklakegg yep!

@aurorascharff
aurorascharff merged commit 7aea312 into aurorascharff:main Oct 5, 2026
3 of 4 checks passed
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.

4 participants