Skip to content

Add structured link install steps#22987

Merged
MikeMcQuaid merged 1 commit into
mainfrom
postinstall-link-steps
Jul 6, 2026
Merged

Add structured link install steps#22987
MikeMcQuaid merged 1 commit into
mainfrom
postinstall-link-steps

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Improved fix for Homebrew/homebrew-core#291532 and eliminates more post-install blocks.

  • 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.
  • 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.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local review and testing.


Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) and link_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.

Comment thread Library/Homebrew/install_steps.rb Outdated
- 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.
@MikeMcQuaid MikeMcQuaid force-pushed the postinstall-link-steps branch from 135982f to 6b0a4dd Compare July 6, 2026 16:53
@MikeMcQuaid MikeMcQuaid enabled auto-merge July 6, 2026 17:34
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 6, 2026
Merged via the queue into main with commit cc060c9 Jul 6, 2026
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the postinstall-link-steps branch July 6, 2026 17:50
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.

3 participants