Repository navigation
Update Homebrew postflight DSL - #84
Conversation
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>
|
@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>
There was a problem hiding this comment.
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
postflightwithpostflight_steps. - Migrates
xattrcleanup to structuredrunsyntax.
| 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.
| postflight_steps do | ||
| run "/usr/bin/xattr", args: ["-cr", "{{appdir}}/ClickLight.app"] |
There was a problem hiding this comment.
postflight was deprecated see: https://brew.sh/2026/09/13/homebrew-7.0.0/
There was a problem hiding this comment.
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:
postflight_stepshas norunstep. The 7.0.0 notes are explicit that the*_stepsDSL 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 raisesNoMethodErrorandbrew install --cask clicklightfails outright.{{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.
There was a problem hiding this comment.
This is supported in Homebrew 7.0.0. I verified against the 7.0.0 tag itself:
Homebrew::InstallSteps::DSL#runis defined inLibrary/Homebrew/install_steps.rb(line 715).appdiris listed inABSOLUTE_TEMPLATE_TOKENS(line 65) andCONTENT_PATH_TOKENS(line 906).- Serialized
runarguments are expanded viaexpand_template_tokens(line 1246). - Homebrew's own 7.0.0 tests execute
run "/usr/bin/true"insidepostflight_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.
There was a problem hiding this comment.
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 atLibrary/Homebrew/install_steps.rb:715and serializes as a"run"step, executed byrun_serialised_command(line 1244) via@command.run(...).appdiris in bothABSOLUTE_TEMPLATE_TOKENS(line 65) andCONTENT_PATH_TOKENS(line 906), and{{appdir}}is expanded throughexpand_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. 🙏
|
Great tool @aurorascharff ⭐ Any chance we can have this merged so we can get rid of warnings when using brew? 🙏 |
|
thanks for the nudge! @sklakegg yep! |
Summary
postflightstanza withpostflight_stepsxattrinvocation to Homebrew's structuredruninstall-step DSLzapValidation
ruby -c Casks/clicklight.rbbrew style --cask aurorascharff/clicklight/clicklightbrew audit --cask aurorascharff/clicklight/clicklight