Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions .github/workflows/brew-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,31 @@ jobs:
echo "${portable_ruby_bindir}" >> "${GITHUB_PATH}"

- name: Build brew-rs
working-directory: Library/Homebrew/rust/brew-rs
run: rake build
run: ./bin/brew vendor-install brew-rs

- name: Check brew-rs formatting
working-directory: Library/Homebrew/rust/brew-rs
run: rake fmt
run: cargo fmt --check

- name: Lint brew-rs
working-directory: Library/Homebrew/rust/brew-rs
run: rake clippy
run: cargo clippy --all-targets --locked -- -D warnings

- name: Test brew-rs crate
working-directory: Library/Homebrew/rust/brew-rs
run: rake test

- name: Run brew-rs integration tests
run: ./bin/brew tests --only=cmd/brew_rs --no-parallel
run: cargo test --locked

- name: Benchmark brew-rs
working-directory: Library/Homebrew/rust/brew-rs
run: rake benchmark
run: rake benchmark:check

- name: Upload brew-rs benchmark results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: brew-rs-benchmarks-${{ runner.os }}-${{ runner.arch }}
path: Library/Homebrew/rust/brew-rs/benchmark-results
if-no-files-found: ignore

- name: Stage brew-rs into default-prefix Homebrew
env:
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/rust/brew-rs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
- Respect existing Homebrew cache, Cellar, Caskroom, logs, temp, and metadata paths.
- Keep Rust command entrypoints in `src/commands/` with one file per command where practical.
- Before running `rake`, prepend `Library/Homebrew/vendor/portable-ruby/current/bin` to `PATH` and install `rake` there if it is missing.
- Run tasks from `Library/Homebrew/rust/brew-rs` with `rake ...`.
- Use `rake build` to vendor the binary locally.
- Use `rake check` for Rust formatting, lint, and Rust tests.
- Run `./bin/brew vendor-install brew-rs` to vendor the binary locally.
- Run `cargo fmt --check`, `cargo clippy --all-targets --locked -- -D warnings`, and `cargo test --locked` from `Library/Homebrew/rust/brew-rs`.
- Use `BREW_RS_STAGE_REPOSITORY=/path/to/Homebrew rake stage` to stage into another checkout.
- Use `rake benchmark` for Ruby vs Rust benchmarks.
- Use `rake benchmark:check` for the CI benchmark gate.
Comment on lines +10 to +14
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

./bin/brew vendor-install brew-rs assumes the repository root as the working directory, but this guidance appears inside Library/Homebrew/rust/brew-rs/AGENTS.md where earlier instructions were explicitly run from within this directory. Please clarify “from the repo root” or update the command to a correct relative path from Library/Homebrew/rust/brew-rs.

Copilot uses AI. Check for mistakes.
- Run `./bin/brew typecheck` and `./bin/brew lgtm` for repo-wide verification.
- Outside the default prefix, benchmarks should cover read commands and skip mutating commands.
12 changes: 6 additions & 6 deletions Library/Homebrew/rust/brew-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export PATH="${portable_ruby_bindir}:${PATH}"
## Build

```bash
cd Library/Homebrew/rust/brew-rs
rake build
./bin/brew vendor-install brew-rs
```
Comment on lines 36 to 40
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

The build instructions use ./bin/brew vendor-install brew-rs, but this README is located under Library/Homebrew/rust/brew-rs/ and the surrounding examples previously had you cd into that directory. As written, running this from Library/Homebrew/rust/brew-rs will fail because ./bin/brew won’t exist there. Please clarify the expected working directory (e.g., “from the repo root”) or adjust the path accordingly.

Copilot uses AI. Check for mistakes.

## Enable
Expand All @@ -58,19 +57,20 @@ prints a handoff warning before delegating back to Ruby.

```bash
cd Library/Homebrew/rust/brew-rs
rake check
cargo fmt --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --locked
```

## Homebrew Checks

```bash
HOMEBREW_NO_AUTO_UPDATE=1 ./bin/brew tests --only=cmd/brew_rs --no-parallel
HOMEBREW_NO_AUTO_UPDATE=1 ./bin/brew typecheck
HOMEBREW_NO_AUTO_UPDATE=1 ./bin/brew lgtm
```

The `cmd/brew_rs` integration spec is intentionally small because integration
tests are slow. It currently covers the Rust-owned `search` and `list` flows.
The Rust frontend tests now live in the `brew-rs` crate and the dedicated
`brew-rs` GitHub Actions workflow instead of `brew tests`.

## Benchmark

Expand Down
Loading
Loading