Add structured link install steps#22987
Merged
Merged
Conversation
7 tasks
7 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Homebrew’s declarative, JSON-serializable install steps to support structured “public link” operations (needed for versioned PostgreSQL installs), including new DSL methods and runner behavior, plus RuboCop and documentation updates.
Changes:
- Add
link_dir(recursive) andlink_children(direct children) install-step types, with support for{{name}}/{{version.*}}template tokens. - Tighten and normalize serialized install-step payload typing and path-spec handling to avoid string-or-hash branching in the runner.
- Update RuboCop install-step validation + tests and document the new step DSL in the Formula Cookbook.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/install_steps.rb | Adds new step types (link_dir, link_children), template token support, and step normalization/type tightening. |
| Library/Homebrew/rubocops/shared/install_steps_helper.rb | Expands allowed DSL calls and permits limited template interpolation nodes. |
| Library/Homebrew/test/install_steps_spec.rb | Adds coverage for link steps running before initdb and .DS_Store skipping behavior. |
| Library/Homebrew/test/rubocops/install_steps_spec.rb | Updates RuboCop expectations for newly allowed DSL calls and template usage. |
| Library/Homebrew/test/formula_spec.rb | Simplifies ln_s usage now that defaults cover prior explicit bases. |
| Library/Homebrew/json_api_postinstall_preflight_postflight_plan.md | Updates planning doc to reflect new generic link steps for PostgreSQL. |
| docs/Formula-Cookbook.md | Documents link_dir and link_children DSL usage for formula authors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Let JSON API post-install data express PostgreSQL's versioned public links.
- Fix PostgreSQL post-install ordering by running link steps before initdb.
- Add `link_dir` for recursive links that keep real extension dirs, skip
`.DS_Store` and replace conflicting files or symlinks.
- Keep existing real target directories even when a source file or symlink
maps to the same path.
- Add `link_children` for versioned executable links with implicit target
paths and `HOMEBREW_PREFIX` as the link target default.
- Expand `#{name}`, `#{version}`, `#{version.major}` and
`#{version.major_minor}` tokens from serialised step data.
- Normalise `path`, `source` and `target` values into typed path specs so
runner methods do not need string-or-hash checks.
- Replace loose `T.untyped` install-step payloads with narrower aliases for
raw steps, path specs, system arguments and template values.
- Keep Formula and Cask source or target base defaults intact while giving
public link steps the prefix default needed by versioned formulae.
135982f to
6b0a4dd
Compare
p-linnane
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improved fix for Homebrew/homebrew-core#291532 and eliminates more post-install blocks.
link_dirfor recursive links that keep real extension dirs, skip.DS_Storeand replace conflicting files or symlinks.link_childrenfor versioned executable links with implicit target paths andHOMEBREW_PREFIXas the link target default.#{name},#{version},#{version.major}and#{version.major_minor}tokens from serialised step data.path,sourceandtargetvalues into typed path specs so runner methods do not need string-or-hash checks.T.untypedinstall-step payloads with narrower aliases for raw steps, path specs, system arguments and template values.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review and testing.