Mirror brew-rs files to Homebrew names#21918
Merged
MikeMcQuaid merged 1 commit intomainfrom Apr 4, 2026
Merged
Conversation
afc18a3 to
c3dd7ed
Compare
Contributor
There was a problem hiding this comment.
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 withsrc/cmd/*entrypoints and factors shared logic intofetch.rs,formula_installer.rs,download_queue.rs, andsearch.rs. - Renames “homebrew” helpers usage to “global” across the Rust frontend.
- Documents the mirroring/porting rules in
README.mdandAGENTS.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
c3dd7ed to
d74244c
Compare
carlocab
approved these changes
Apr 4, 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.
Library/Homebrew/cmd/,Library/Homebrew/dev-cmd/, and matching helper files in reviewssrc/cmd/, addsrc/dev_cmd/, and split shared logic into mirrored files such asfetch.rsandformula_installer.rssearch::search_namesand document the layout rules inREADME.mdandAGENTS.mdso future ports drift less from the Homebrew implementationbrew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex used with manual testing, edits and review.