141 Commits
Author SHA1 Message Date
Mike McQuaid 8b3a119e78 Allow cask runs to access the network
Structured cask install steps run in a sandbox that denies network
access. This breaks casks whose upstream setup commands must retrieve
installation-time dependencies, including `gcloud-cli` virtualenv
creation.

- Add a serialised `network_access:` option to `run` steps.
- Omit the option from API data when it retains the default denial.
- Enable network access only when an explicit run requests it.
- Preserve network denial for existing steps and generated completions.
- Document the opt-in and cover both sandbox policies in tests.

This avoids disabling network restrictions for all cask operations while
giving affected casks an explicit, auditable escape hatch.

See #23495.
2026-08-11 12:02:16 +01:00
Bevan Kay 6af7582df0 install_steps: add must_succeed to run 2026-08-10 11:56:06 +10:00
Mike McQuaid 601472bfda Enforce structured install step authoring
- reject mixing formula install hooks in every tap
- autocorrect legacy step methods and keywords
- retain stable serialised API values for compatibility
- document canonical Formula and Cask step authoring
- remove the resolved Cask sandbox deprecation reminder
2026-08-08 15:06:51 +01:00
Mike McQuaid f8fcbd88e0 Sandbox structured cask operations
- Run each complete cask step block in one isolated subprocess and all
  generated completions in another phase-scoped sandbox.
- Share sandbox selection, fork fallback, install-hook rules and child
  error reporting with formula build, post-install and test processes.
- Restrict home, network and filesystem access while preserving `brew`
  and supporting explicit command write paths.
- Keep JSON payloads compact and independent of cask Ruby files.
- Remove the completed official-tap migration plan.
2026-08-07 08:37:09 +01:00
Mike McQuaidandGitHub 4798afc8f1 Merge pull request #23447 from AlternateRT/fix-appimage-cask-dsl
Fix AppImage's stanza name in cask DSL
2026-08-05 15:16:59 +00:00
AltCode 497536f560 Fix AppImage's stanza name in cask DSL 2026-08-05 12:46:45 +02:00
Mike McQuaid 9f3bf077be Reject official legacy install hooks
- block legacy hooks in Homebrew-owned taps
- retain safe autocorrection and third-party compatibility
- reject `brew ruby` steps that enable developer mode
- prepare runtime call sites for next-release deprecation
- verify internal API and runtime DSL coverage
2026-08-04 18:36:46 +01:00
Mike McQuaid 6decfd55f2 Enforce complete Cask stanza ordering
Once homebrew/cask is migrated, the style cops can enforce the intended
order for platform blocks and generated artifact DSLs.

- register platform blocks, system variables and generated artifacts
- keep system variables after versions so interpolation remains valid
- remove the temporary completion-grouping migration allowance
- update affected fixtures, documentation and regression coverage
2026-08-04 12:11:22 +01:00
Mike McQuaid 7e3b7b186f Document canonical install steps
Formula and cask authors need one current reference while released
aliases remain an implementation-only compatibility bridge.

- document shared names, defaults, guards, tokens and command behaviour
- remove compatibility-only methods and values from the cookbooks
- explain ordered coexistence with legacy hooks during tap migration
2026-07-31 17:01:53 +01:00
Mike McQuaid 04ca847a41 Add explicit dylib ID helpers
- Add a generic Formula helper and serialised install step for changing
  one Mach-O dynamic library ID.
- Require complete source and ID paths while allowing callers to resolve
  a source symlink explicitly.
- Preserve file permissions and codesign modified libraries on Apple
  Silicon.
- Document and audit both public interfaces.
2026-07-30 21:46:43 +01:00
Mike McQuaid 095b9cef75 Document install step interpolation
- Distinguish Ruby interpolation from install-time tokens that survive
  JSON serialisation.
- Keep token-producing compatibility helpers valid while rejecting
  arbitrary interpolation.
- Emit explicit install-time tokens from formula autocorrections.
2026-07-29 17:59:20 +01:00
AltCode bcf3453b4b docs: Format artifacts stanza table 2026-07-28 20:58:59 +02:00
AltCode 45bde7e52d docs: Add on_<system> stanzas to stanza order
Also adds missing info for conditional statements section
2026-07-28 20:55:34 +02:00
Mike McQuaid 0ac0cf43cb Prepare complete DSL stanza ordering
Recent formula and cask DSLs need consistent ordering registrations, but
Cask ordering cannot be enforced until the tap has been migrated.

- register new Cask artifact and conditional stanzas in their intended order
- allow both completion layouts while retaining group boundaries
- leave formula component ordering to `ComponentsOrder`
- document the intended Cask stanza order before enforcing it
2026-07-28 14:34:06 +01:00
hyuraku 51c13f17a3 docs/Cask-Cookbook: fix links to renamed casks
The `r` and `wireshark` casks were renamed to `r-app` and
`wireshark-app` in Homebrew/homebrew-cask d20f5f8baba
("Differentiate lesser used casks from formulae"), so the
`on_<system>` example links in this section now 404.
2026-07-27 18:24:04 +09:00
Mike McQuaidandGitHub f7c846c323 Merge pull request #23186 from Homebrew/install-step-09-commands
Add constrained install commands (9/24)
2026-07-26 16:05:44 +00:00
Mike McQuaidandGitHub 0f9e1bd695 Merge pull request #23308 from Homebrew/declare-cask-command-wrapper-names
Declare cask command wrapper names
2026-07-26 15:33:17 +00:00
Mike McQuaid 2c2089fc74 Add process termination steps
Flight hooks repeatedly stop applications or helpers before mutating
their installed state.

- select processes by exact name or full command line
- serialise attempts, privilege and required-success policies
- preserve fixed user notices and final failure warnings
2026-07-26 14:24:22 +01:00
Mike McQuaid cf5bc21c6b Add constrained install commands
Many remaining hooks invoke one packaged or system executable and do not
need a Ruby block or shell command string.

- serialise literal arguments, environments, streams and directories
- resolve path bases, templates and guards through shared contexts
- make privilege, output and required-success policies explicit
- migrate GIO callers while retaining the shipped compatibility DSL
2026-07-26 14:23:59 +01:00
Mike McQuaid c33846e9da Declare cask command wrapper names
Command wrapper callers should declare the command users receive rather
than an implementation-specific staged script filename.

- treat the positional argument as the linked command name
- keep generated wrapper paths internal to the artifact
- reject names containing path components
- document command wrappers as the shim-script replacement
2026-07-26 13:24:58 +01:00
Mike McQuaid bff3871202 Add homepage browser check DSL
- Avoid false homepage audits when sites block automated requests
- Resume automated checks one year after a human browser check
- Do not suppress audits for future browser-check dates
- Reject browser-check metadata without a homepage URL
- Document the marker in the formula and cask cookbooks
2026-07-26 13:04:23 +01:00
Mike McQuaid 033640ab69 Simplify cask command wrappers
Most command wrappers only execute one binary with optional fixed
arguments or environment variables. Repeating their complete shell
content makes casks harder to audit and maintain.

- generate wrappers from `executable`, `args` and `env` options
- infer the linked target by removing the `.wrapper.sh` suffix
- retain `content` for wrappers which need custom shell logic
2026-07-25 11:18:27 +01:00
Mike McQuaid a3fc881347 Remove cask verified parameter
- stop auditing and documenting the ineffective parameter
- retain it as an optional no-op for existing casks

Fixes #23250
2026-07-23 14:51:31 +01:00
Mike McQuaid eeaae4a0dc Add generated cask scripts
Some cask flight hooks only materialise a fixed helper before another
artifact or install step consumes it.

- write literal executable content as a serialisable cask artifact
- restrict generated paths to the staged cask and reject traversal
- order generated scripts before dependent installer artifacts
2026-07-21 14:03:53 +01:00
Mike McQuaid fe832ecb9b Add cask command wrappers
Many cask flight hooks only write a fixed launcher and link it into the
configured binary directory.

- generate executable wrapper content as a first-class cask artifact
- reuse binary linking, collision and uninstall behaviour
- serialise the stanza so cask JSON preserves its definition
2026-07-21 14:03:49 +01:00
Patrick Linnane d4700a3469 Add appimage to cask stanza order
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-07-20 14:06:34 -07:00
Mike McQuaid 390c74bd49 Add install step inreplace
Several tap hooks only substitute install-time paths in generated files
and do not need arbitrary Ruby execution.

- expose the familiar `inreplace` name and option defaults
- serialise literal substitutions, regular expressions and their flags
- accept regexp literals in formula and cask step validators
- expand only fixed install-time template tokens
- share validation and execution between formulae and casks
2026-07-20 15:22:20 +01:00
Patrick Linnane 469f451100 docs/Cask-Cookbook: apply maintainer review feedback
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-07-19 16:59:18 -07:00
Patrick Linnane d3de4bc7b5 docs: correct the Cask Cookbook and cask terminology
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-07-19 13:45:43 -07:00
Mike McQuaidandGitHub 41b5372eca Merge pull request #23174 from Homebrew/docs-package-acceptance-policy
docs: add a shared package acceptance policy
2026-07-19 18:55:31 +00:00
Patrick Linnane 86787bedd8 docs: add a shared package acceptance policy
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-07-19 09:10:44 -07:00
Mike McQuaid af66235c7e Add install step removals
Tap migrations need declarative removal without giving JSON consumers an
arbitrary shell escape.

- serialise guarded path arrays with automatic glob expansion
- restrict removals by symlink target or owned file content
- route elevated cask removals through the existing permission helper
2026-07-19 15:55:16 +01:00
Mike McQuaid f98b955d42 Add install step copies
Tap hooks need a serialisable copy operation before they can move to
literal step blocks.

- add file and recursive directory copies to formula and cask steps
- resolve sources, destinations and globs through shared path handling
- include copies in JSON round trips and literal-block validation
2026-07-19 15:55:14 +01:00
5fe0f9156a cask-cookbook: minor change
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-18 19:13:56 +08:00
Bevan Kay f10ed1bfb7 cask-cookbook: fix dev cmd paths 2026-07-18 21:05:44 +10:00
Mike McQuaid 4880cf92db Serialise cask language variations
- store deterministic language deltas in public and internal API data
- select URLs, checksums and artifacts without loading cask Ruby
- retain source fallback for older API data and legacy flight blocks
2026-07-17 15:36:14 +01:00
Mike McQuaid 3aa4eb5f4a Add cask permission steps
- `set_permissions` and `set_ownership` cover common cask flights
- JSON API casks can keep these operations in structured data
- Ownership keeps the existing App Management and sudo guardrails
- Tests cover restrictive umask and App Management denial paths
- The plan now requires tap conversion checks before finishing
2026-07-10 19:38:48 +01:00
Mike McQuaid 29861c0c03 Add install step keychain cleanup
- Let cask uninstall steps remove keychain certificates without loading
  Ruby flight blocks from API installs.
- Keep the JSON payload to a certificate common name, with optional
  `matching_certificate` fingerprint narrowing for shared names.
- Document formula certificate symlinks as structured `ln_sf` steps and
  leave one-off trust store generation in legacy Ruby.
2026-07-09 16:28:22 +01:00
Michael Cho f9f596c730 docs: escape braces to avoid Liquid tag handling
Also remove test error doc from old Linuxbrew. This information is
better to find elsewhere and the Ubuntu wiki is being decommissioned
2026-07-09 01:05:15 -04:00
72d5c03c8a Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-22 14:33:26 +08:00
Bevan Kay ed98b19c8f Cask Cookbook: document generate_completions_from_executable stanza 2026-06-22 16:28:28 +10:00
Mike McQuaid d29b54329c Add install step config writes
- add a shared `write` install step so formulae and casks can ship
  default configuration or data files through structured JSON API data
- skip existing files unless `overwrite: true` so user edits survive
  upgrades; the DSL signature requires string content and the runner
  raises on blank content so malformed API data fails loudly
- append a trailing newline to `write` content unless it already ends
  with one, so written files end in a newline as POSIX expects
- accept non-interpolated heredocs (`dstr`) as step arguments so `write`
  content can use heredocs; interpolated content stays rejected
- expand a fixed `{{...}}` token allow-list in `write` content at install
  time so paths and versions are not baked into the JSON API; any other
  `{{...}}` is left verbatim and dynamic interpolation stays legacy Ruby
- allow `write` in formula and cask step blocks so taps can adopt it
  ahead of the enforcing RuboCops, per the per-DSL PR workflow
2026-06-17 09:40:35 +01:00
Mike McQuaid 7c38a5da3b docs: drop advice to disable security or lower support tier
- remove the FAQ section explaining how to bypass Gatekeeper for
  apps from unidentified developers, plus its screenshots
- remove the `pkg allow_untrusted` Cask DSL docs and mark the
  `allow_untrusted` definitions `# odeprecated` as they disable
  certificate verification
- remove "untar anywhere" and "multiple installations" install
  instructions that push users to a non-default prefix and source
  builds, dropping them below Tier 1
2026-06-15 16:41:01 +01:00
Mike McQuaid 1618f7c9a3 Add install step rebuild actions
- avoid Ruby-only `post_install` for common desktop cache rebuilds
- keep API steps structured instead of serialising raw commands
- document the stable runtime surface before lint conversions
2026-06-02 17:51:46 +01:00
Mike McQuaid 6f0b2e25c4 Add cask install steps
- Expose structured steps for cask flight phases and API data.
- Prefer steps over matching Ruby flight blocks with warnings.
- Document cask usage and keep conversion audits separate.
2026-05-24 16:53:10 +01:00
Mike McQuaid bc6d9cb494 Sandbox cask completions
- Avoid unsandboxed upstream code when generating cask completions.
- Keep installer scripts on `SystemCommand` because most run installers.
- Document why cask installers and packages are not sandboxed.
- Note that flight blocks are expected to be sandboxed later.
- Keep `HOMEBREW_NO_SANDBOX_CASK` as a temporary escape hatch.
- Preserve completion output by discarding stderr unless requested.
2026-05-24 14:47:47 +01:00
Bevan Kay eecc77f878 cask/upgrade: don't skip quit stanzas by default 2026-05-16 11:27:07 +10:00
Mike McQuaid 842c55d5fc Add maximum macOS cask deps
- Support `depends_on maximum_macos:` in casks.
- Treat maximum macOS requirements as macOS-only.
- Reject non-upper-bound cask maximum macOS values.
- Document matching formula and cask OS semantics.
2026-05-10 13:15:52 +01:00
Mike McQuaid 7472e3191c Add Linux OS dependencies
- Support `depends_on :linux` for casks and formulae.
- Fast-path support checks for Linux-only software.
- Document the Linux-only dependency semantics.
- Cover Linux-only and conflicting OS guard paths.
2026-05-10 09:25:52 +01:00
Mike McQuaid 64e09b3e03 Track macOS support explicitly
- Treat top-level macOS requirements as macOS-only.
- Preserve existing `:macos` plus `macos:` formulae for release safety.
- Defer style migration to a later release-aware change.
2026-05-08 19:12:36 +01:00