Skip to content

Use bottled inputs and add RuboCop guard - #23468

Open
MikeMcQuaid wants to merge 1 commit into
mainfrom
bottled-post-install-inputs
Open

Use bottled inputs and add RuboCop guard#23468
MikeMcQuaid wants to merge 1 commit into
mainfrom
bottled-post-install-inputs

Conversation

@MikeMcQuaid

@MikeMcQuaid MikeMcQuaid commented Aug 7, 2026

Copy link
Copy Markdown
Member
  • Discover CPython wheels already packaged in each keg.
  • Expand PyPy bootstrap archives packaged in libexec.
  • Resolve dependency paths without loading formula source.
  • Enforce source independence with RuboCop and API-loaded tests.
  • Keep the internal JSON API unchanged and minimal.

Fixes #23465


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

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

OpenAI Codex 5.6 Sol xhigh with local review and testing.


Copilot AI lite review requested due to automatic review settings August 7, 2026 12:42

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 tightens Homebrew鈥檚 structured install-step runners to avoid depending on formula source and post-pour resources by switching to bottled inputs and API-derived context, and it adds enforcement via a dedicated RuboCop cop plus accompanying specs.

Changes:

  • Add a new Homebrew/InstallStepsSourceIndependence RuboCop cop and spec coverage to prevent formula/source/resource lookups and direct downloads in install-step runners.
  • Update install-step execution logic to resolve helper-tool paths and pkgetc paths without loading formula source.
  • Update install-step specs to use API-loaded formula structs and to validate bootstrapping behavior against bottled wheel/archive inputs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Library/Homebrew/test/rubocops/install_steps_source_independence_spec.rb Adds spec coverage for the new RuboCop cop鈥檚 allowed/forbidden patterns.
Library/Homebrew/test/install_steps_spec.rb Updates tests to use API-loaded formula structs and validates bootstrapping via bottled wheel/archive inputs and opt-path tool resolution.
Library/Homebrew/rubocops/install_steps_source_independence.rb Introduces the RuboCop cop enforcing install-step source independence.
Library/Homebrew/rubocops/all.rb Registers the new RuboCop cop for loading.
Library/Homebrew/install_steps/formula_actions.rb Switches CPython/PyPy bootstrapping to use bottled wheels/archives rather than formula resources.
Library/Homebrew/install_steps.rb Resolves helper-tool and pkgetc paths without loading formula source.
Library/.rubocop.yml Enables/scopes the new cop to install-step runner files.
docs/Formula-Cookbook.md Documents that named actions must use bottled inputs rather than formula resources after pouring.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/install_steps.rb
- Discover CPython wheels already packaged in each keg.
- Expand PyPy bootstrap archives packaged in `libexec`.
- Resolve dependency paths without loading formula source.
- Validate helper executables before attempting to run them.
- Enforce source independence with RuboCop and API-loaded tests.
- Keep the internal JSON API unchanged and minimal.
@MikeMcQuaid
MikeMcQuaid force-pushed the bottled-post-install-inputs branch from 6635b2c to a75d41b Compare August 7, 2026 13:44
@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 7, 2026 15:40
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.

Structured API bootstrap actions cannot access required formula resources

2 participants