Skip to content

Mirror brew-rs files to Homebrew names#21918

Merged
MikeMcQuaid merged 1 commit intomainfrom
mirror-homebrew-rust
Apr 4, 2026
Merged

Mirror brew-rs files to Homebrew names#21918
MikeMcQuaid merged 1 commit intomainfrom
mirror-homebrew-rust

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • make Rust ports easier to compare against Library/Homebrew/cmd/, Library/Homebrew/dev-cmd/, and matching helper files in reviews
  • move command wrappers under src/cmd/, add src/dev_cmd/, and split shared logic into mirrored files such as fetch.rs and formula_installer.rs
  • keep parity-focused names such as search::search_names and document the layout rules in README.md and AGENTS.md so future ports drift less from the Homebrew implementation

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

OpenAI Codex used with manual testing, edits and review.


Copilot AI review requested due to automatic review settings April 4, 2026 10:19
@MikeMcQuaid MikeMcQuaid force-pushed the mirror-homebrew-rust branch from afc18a3 to c3dd7ed Compare April 4, 2026 10:20
@MikeMcQuaid MikeMcQuaid enabled auto-merge April 4, 2026 10:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 restructures brew-rs to mirror Homebrew’s Ruby/Bash filenames and command layout, extracting shared logic into parity-named Rust modules to make ongoing ports easier to review and keep aligned.

Changes:

  • Replaces the old src/commands/* layout with src/cmd/* entrypoints and factors shared logic into fetch.rs, formula_installer.rs, download_queue.rs, and search.rs.
  • Renames “homebrew” helpers usage to “global” across the Rust frontend.
  • Documents the mirroring/porting rules in README.md and AGENTS.md.

Reviewed changes

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

Show a summary per file
File Description
Library/Homebrew/rust/brew-rs/src/utils/tty.rs Switches color/TTY gating from homebrew helpers to global.
Library/Homebrew/rust/brew-rs/src/search.rs Introduces shared search_names + matcher logic with tests.
Library/Homebrew/rust/brew-rs/src/matcher.rs Removes standalone matcher module (logic moved into search.rs).
Library/Homebrew/rust/brew-rs/src/lib.rs Updates module layout/entrypoint wiring to new mirrored structure.
Library/Homebrew/rust/brew-rs/src/global.rs Renames test temp-path prefix to reflect global naming.
Library/Homebrew/rust/brew-rs/src/formula_installer.rs Extracts install planning/pour/link helpers for reuse by cmd entrypoints.
Library/Homebrew/rust/brew-rs/src/fetch.rs Moves progress rendering into download_queue and switches to global helpers.
Library/Homebrew/rust/brew-rs/src/download_queue.rs New shared download progress renderer extracted from fetch.rs with tests.
Library/Homebrew/rust/brew-rs/src/delegate.rs Uses global::brew_file() for Ruby delegation execution.
Library/Homebrew/rust/brew-rs/src/commands/search.rs Removes old command implementation (replaced by src/cmd/search.rs + src/search.rs).
Library/Homebrew/rust/brew-rs/src/commands/mod.rs Removes old commands module root (replaced by src/cmd/mod.rs).
Library/Homebrew/rust/brew-rs/src/cmd/mod.rs New command module root mirroring Library/Homebrew/cmd/*.rb.
Library/Homebrew/rust/brew-rs/src/cmd/fetch.rs New thin fetch entrypoint delegating to shared fetch module logic.
Library/Homebrew/rust/brew-rs/src/cmd/install.rs New thin install entrypoint using formula_installer + fetch helpers.
Library/Homebrew/rust/brew-rs/src/cmd/search.rs New thin search entrypoint using shared search::search_names.
Library/Homebrew/rust/brew-rs/src/cmd/list.rs Switches to global helpers for path discovery and printing.
Library/Homebrew/rust/brew-rs/src/cmd/info.rs Routes warning delegation through cmd::run_with_warning.
Library/Homebrew/rust/brew-rs/src/cmd/reinstall.rs Routes warning delegation through cmd::run_with_warning.
Library/Homebrew/rust/brew-rs/src/cmd/update.rs Routes warning delegation through cmd::run_with_warning.
Library/Homebrew/rust/brew-rs/src/cmd/upgrade.rs Routes warning delegation through cmd::run_with_warning.
Library/Homebrew/rust/brew-rs/src/cmd/uninstall.rs Routes warning delegation through cmd::run_with_warning.
Library/Homebrew/rust/brew-rs/src/brew.rs Dispatches commands via cmd::* instead of commands::*.
Library/Homebrew/rust/brew-rs/README.md Documents the file/module mirroring “Porting Rule”.
Library/Homebrew/rust/brew-rs/AGENTS.md Updates agent guidance to the new src/cmd/ / src/dev_cmd/ layout.

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

- make Rust ports easier to compare against `Library/Homebrew/cmd/`,
  `Library/Homebrew/dev-cmd/`, and matching helper files in reviews
- move command wrappers under `src/cmd/`, add `src/dev_cmd/`, and split
  shared logic into mirrored files such as `fetch.rs` and
  `formula_installer.rs`
- keep parity-focused names such as `search::search_names` and document
  the layout rules in `README.md` and `AGENTS.md` so future ports drift
  less from the Homebrew implementation
@MikeMcQuaid MikeMcQuaid force-pushed the mirror-homebrew-rust branch from c3dd7ed to d74244c Compare April 4, 2026 10:27
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 4, 2026
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 4, 2026
Merged via the queue into main with commit e0e6301 Apr 4, 2026
40 checks passed
@MikeMcQuaid MikeMcQuaid deleted the mirror-homebrew-rust branch April 4, 2026 16:34
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