204 Commits
Author SHA1 Message Date
Mike McQuaid 5280c6df5c Revert "Restore base64 gem"
- This reverts commit 10bdd6ba45.
- All formulae that needed `base64` now use native
  `String#unpack1`/`Array#pack` after Homebrew/homebrew-core#296594
  so the vendored gem is no longer needed.
- Bump `VENDOR_VERSION` as the vendored gem set changed again.
2026-08-04 09:37:22 +01:00
Mike McQuaid f5a7cdfe1e Remove superseded Licensed integration
- Use the `git-pkgs` workflow for dependency licence checks.
- Drop generated `licensed` metadata and vendor workflow handling.
2026-07-29 16:50:54 +01:00
botantony 10bdd6ba45 Restore base64 gem
See https://github.com/Homebrew/brew/pull/23309#issuecomment-5106773256
2026-07-28 18:37:24 +02:00
Mike McQuaid eee8d944c0 Reduce vendored gem dependencies
- Replace `addressable` and `public_suffix` with Ruby's `URI` while
  retaining brewed-curl host detection.
- Inline JWS decoding and scoped warning filtering.
- Keep Base64 only as ruby-prof's on-demand transitive dependency.
- Remove unused Redcarpet and the largely unmaintained Pry backend.
- Defer heavy runtime gems until their functionality is needed.
- Resolve lazy type dependencies before Sorbet runtime checks.

Hyperfine (`--warmup 10 --runs 30`, repeated in both orders):

- `HOMEBREW_NO_AUTO_UPDATE=1 brew info --json=v2 jq`:
  528.9 ms ± 21.1 ms on `origin/main` and 512.6 ms ± 16.2 ms
  here, a 3% speedup.
2026-07-27 21:06:20 +01:00
Mike McQuaid b8d19870cf Run brew lgtm on stop in AI hooks
- replace the per-edit `style --changed --fix` and `typecheck`
  `PostToolUse` hooks and the `tests --changed` `Stop` hook with a
  single `./bin/brew lgtm` on `Stop` in `.claude/settings.json`
- add a matching Codex `Stop` hook in `.codex/hooks.json`, unignoring
  `.codex` like `.claude`, so both agents run the same check
- `brew lgtm` runs typecheck, style and the relevant tests together
2026-06-10 13:13:51 +01:00
Patrick Linnane eb891c0a34 Fix brew tests tap trust config home
`brew tests` overrode `HOME` but not `HOMEBREW_USER_CONFIG_HOME`, which
`bin/brew` had already derived from the real `HOME`. The spec teardown
`rm_rf`s `$HOMEBREW_USER_CONFIG_HOME/trust.json`, so every run deleted the
user's real `~/.homebrew/trust.json`.

Re-point `HOMEBREW_USER_CONFIG_HOME` at the sandboxed `HOME`, matching
`test_bot.rb`, and refuse to clean a `trust.json` that is not sandboxed
under `HOME` so a runner that forgets fails loudly instead of deleting
real user data.
2026-06-08 22:24:22 -07:00
Mike McQuaid 59818f180e Check RubyGems licences
- Ensure we do not accidentally include gems with licences we do not
  agree with.
- Run the Homebrew `licensed` formula in the vendor-gems workflow so
  CI fails when a Bundler gem has an unapproved licence or stale cache
  record.
- Keep `licensed` outside `Library/Homebrew/Gemfile` so all-groups
  Bundler installs do not need its native dependencies.
- Use an isolated Homebrew formula cache key and allow cleanup of any
  existing formulae before installing `licensed` for CI.
- Vendor the current `.licenses` cache so future dependency updates
  have an explicit review baseline.
- Mark generated licence, Sorbet RBI and Bundler files as generated.
2026-05-19 11:47:11 +01:00
Harald Nordgren 782965884e gitignore: ignore test/.npm/ 2026-05-18 19:27:16 +02:00
Mike McQuaid 4e90a9e36a gitignore: ignore brew-rs.
This isn't in the repository just now so ignore the symlink.
2026-05-12 11:21:09 +01:00
Mike McQuaid 231c15837c gitignore: ignore rubydex. 2026-04-10 14:18:30 +01:00
Mike McQuaid 5afdff6b57 brew-rs: add an opt-in Rust frontend path
Homebrew's Ruby and Bash startup cost is most noticeable on common API-backed
commands, so add a tightly gated Rust frontend experiment for search, info,
list, and the essential mutating commands. The goal is to make iteration on a
faster CLI possible without changing the default user experience or taking on
the risk of reimplementing all of FormulaInstaller in Rust on day one.

Keep the risk contained by only enabling the Rust path on supported Tier 1
default-prefix installs when both HOMEBREW_DEVELOPER and
HOMEBREW_EXPERIMENTAL_RUST_FRONTEND are set, and by continuing to delegate
complex install, upgrade, uninstall, and update behaviour back to the existing
Homebrew frontend for v1 correctness. That lets us measure the frontend win
first and only move more logic out of Ruby when profiling proves it is worth
the complexity.

Build brew-rs through vendor-install and run Rust subtree tasks through
portable Ruby's rake so local development, first-run bootstrapping, and CI all
use the same path instead of bespoke scripts. Add integration coverage, a
dedicated workflow, hyperfine benchmarks, Dependabot support, and Rust-specific
docs so the experiment is easy to validate, benchmark, and evolve.
2026-03-22 14:50:32 +00:00
Mike McQuaid 4d038f0164 .gitignore: add more gems to ignore. 2026-03-06 16:00:55 +00:00
Patrick LinnaneandBo Anderson 449e740b8f Portable Ruby 4.0.1
Co-authored-by: Bo Anderson <mail@boanderson.me>
2026-03-06 01:13:43 +00:00
Patrick Linnane a24a534ddd .gitignore: add ostruct
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-02-27 13:44:44 -08:00
Patrick Linnane 6feb6f1f11 docs: Modernize GitHub Pages deployment 2026-02-10 13:13:15 -08:00
BrewTestBotandMike McQuaid 897b0bc03d Update vendored gems. 2026-01-16 09:55:05 -07:00
Mike McQuaid f30bd07a53 Vendor and ignore gems 2026-01-09 15:18:50 +00:00
Mike McQuaid 313926364a gitignore: ignore tmp files.
We ignore some specific ones but various tools dump various other tmp
files that we'll never want to commit.
2025-12-17 15:20:18 +00:00
Mike McQuaid 956ccbb6d1 Add profiling to brew tests
Add the same profilers support as `brew prof` using `test-prof`.

While we're here, fix a `formula_installer` performance issue that
added ~0.5s to every call to `FormulaInstaller#finish` which is a lot
of integration tests (already our slowest types).
2025-11-14 18:17:30 +00:00
Mike McQuaid b0c32e5b0a Import rubydoc.brew.sh into docs.brew.sh/rubydoc
This will make life a bit easier to keep these in the same repository.

Not migrating all links yet until it's confirmed to be working.
2025-10-14 14:43:49 +01:00
Mike McQuaid f560d47b4e Add AI hooks
These should help Claude Code and Cursor agents run more effectively.
2025-10-09 15:08:40 +01:00
BrewTestBotandMike McQuaid 3f6fb0da51 brew vendor-gems: commit updates.
Also gnore new `tapioca` `require-hooks` dependency.
2025-07-14 19:12:37 +01:00
Mike McQuaid 214074cf02 docs/Support-Tiers: tweak wording, add CODEOWNERS.
Let's improve the wording of the Support Tiers document and add it to
a (new) CODEOWNERS file to ensure that I or the TSC review changes.
2025-05-27 14:14:05 +01:00
Eric Knibbe 6a07851c46 docs: localize internal URLs 2025-05-22 12:17:52 -04:00
Mike McQuaid 681e803c4f docs: improve/fix jekyll setup 2025-04-25 09:46:29 +01:00
Patrick Linnane 5d8d453a90 Portable Ruby 3.4.3 2025-04-22 11:50:08 -07:00
Douglas Eichelberger bafce2a81f Exclude lint_roller from git and rbi_generation 2025-02-17 18:56:31 -08:00
Mike McQuaid 6f99704a64 Import brew formula-analytics and generate-analytics-api commands
Import these from the homebrew/formula-analytics tap and deprecate
that tap.

This required a little messing around with filenames and paths to get
it finding Python and writing to the user's home directory.
2025-02-07 20:05:05 +00:00
Patrick LinnaneandGitHub b57274f396 Revert "Restructure .gitignore gem handling" 2025-01-17 20:53:05 -08:00
Douglas Eichelberger 2c75f4d414 Restructure .gitignore gem handling 2025-01-16 10:27:37 -08:00
Douglas Eichelberger ac7009cc23 Exclude benchmark from rbi generation and git 2025-01-10 18:17:05 -08:00
Patrick Linnane fc216a4f0d .gitignore: add unicode-emoji
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-11-26 14:09:13 -08:00
Patrick Linnane c6c7373a60 gems/logger: add to .gitignore
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-09-04 10:54:48 -07:00
Rylan Polster 9ddde17ea5 Add vscode Ruby LSP config and documentation 2024-08-02 10:44:43 -04:00
Mike McQuaid 3392226a10 Include more Ruby metadata files
- include `.ruby-version` and in the project root (and unignore in
  `.gitignore`) to improve editor support which expects these files
- use the `.ruby-version` in `docs/Gemfile` to use a consistent Ruby
  version here
- remove hardcoded Ruby versions from `workflows/docs` in favour of
  using the `.ruby-version` file instead
- use more consistent configuration in `workflows/docs` to match
  `workflows/tests`
2024-05-23 16:29:14 +01:00
Bo Anderson d70e5d4071 .gitignore: add bigdecimal (native gem) 2024-05-23 14:30:09 +01:00
Patrick Linnane 6012533487 tapioca/config: remove unf & unf_ext
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-22 10:19:54 -07:00
Mike McQuaid fd7df63b9d dev-cmd/prof: add vernier support.
It's the newest great profiler for Ruby.
2024-05-17 23:57:46 +09:00
Mike McQuaidandBo Anderson bde9afa70e Portable Ruby 3.3.1
Use the latest version of Portable Ruby.
2024-05-17 00:23:36 +01:00
Markus Reiter 9b6fb3d4df Add redcarpet gem. 2024-05-01 11:35:21 +02:00
Issy Long 073e739005 Use the debug gem from portable Ruby
- This is cleaner than vendoring a whole bunch of new gems and pinning `psych`.
- Thanks for the pointer, Bo!
- It doesn't work, though?

```
❯ brew tests --only=migrator --debug
Error: cannot load such file -- debug/debug.so
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:16:in `require'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:16:in `rescue in <module:DEBUGGER__>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:13:in `<module:DEBUGGER__>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/session.rb:31:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/session.rb:31:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug.rb:3:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/dev-cmd/tests.rb:48:in `require'
/opt/homebrew/Library/Homebrew/dev-cmd/tests.rb:48:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:89:in `<main>'
```
2024-04-17 23:26:40 +01:00
Issy Long 1daeb5bee0 Set up the debug gem for test debugging
- This processed that we'd requested a debugger, but didn't drop us into
  a debugging console until I
  [stopped the stdin disablement](https://github.com/Homebrew/brew/issues/16708#issuecomment-1953483970).

Usage:

```
❯ git diff
diff --git a/Library/Homebrew/test/migrator_spec.rb b/Library/Homebrew/test/migrator_spec.rb
index 87fadd5e95..db4700810a 100644
--- a/Library/Homebrew/test/migrator_spec.rb
+++ b/Library/Homebrew/test/migrator_spec.rb
@@ -69,6 +69,8 @@ RSpec.describe Migrator do
       tab.source["tap"] = "homebrew/core"
       tab.write

+      binding.break
+
       expect do
         described_class.new(new_formula, "oldname")
       end.to raise_error(Migrator::MigratorDifferentTapsError)

issyl0 at pictor in /opt/homebrew on bye-byebug
❯ brew tests --only=migrator --debug
Randomized with seed 59158
1 process for 1 spec, ~ 1 spec per process
.==> Relinking newname
.==> Unlinking oldname
...==> Moving oldname versions to /private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/newname
....==> Migrating formula oldname to newname
==> Unlinking oldname
==> Moving oldname versions to /private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/newname
==> Relinking newname
....[67, 76] in ~/migrator_spec.rb
    67|       tab = Tab.empty
    68|       tab.tabfile = HOMEBREW_CELLAR/"oldname/0.1/INSTALL_RECEIPT.json"
    69|       tab.source["tap"] = "homebrew/core"
    70|       tab.write
    71|
=>  72|       binding.break
    73|
    74|       expect do
    75|         described_class.new(new_formula, "oldname")
    76|       end.to raise_error(Migrator::MigratorDifferentTapsError)
=>#0    block in <top (required)> (3 levels) at ~/migrator_spec.rb:72
  #1    [C] BasicObject#instance_exec at /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:263
  # and 68 frames (use `bt' command for all frames)
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p tab
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p    # command(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p     # command t    # command ta    # command tab    # command(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p tab    # command
=> #<Tab:0x0000000107156be0 @aliases=[], @arch=nil, @built_as_bottle=false, @built_on={"os"=>"Macintosh", "os_version"=>"macOS 14", "cpu_family"=>"arm_firestorm_icestorm"}, @compiler=:clang, @homebrew_version="4.2.16-55-gc8f60ec-dirty", @installed_as_dependency=false, @installed_on_request=false, @loaded_from_api=false, @poured_from_bottle=false, @runtime_dependencies=nil, @source={"path"=>nil, "tap"=>"homebrew/core", "tap_git_head"=>nil, "spec"=>"stable", "versions"=>{"stable"=>nil, "head"=>nil, "version_scheme"=>0}}, @source_modified_time=0, @stdlib=nil, @tabfile=#<Pathname:/private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/oldname/0.1/INSTALL_RECEIPT.json>, @time=nil, @unused_options=[], @used_options=[]>
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464)
```
2024-04-17 22:25:12 +01:00
Issy Long 58fbaecedb Add the debug gem for test debugging 2024-04-17 22:25:10 +01:00
Douglas Eichelberger 820d320835 Remove and refactor rspec-its use 2024-03-17 22:47:37 -07:00
Bo Anderson 754d580a91 Replace ronn with Kramdown's converter 2024-03-10 22:31:38 +00:00
Carl Fürstenberg aadd7bbbd8 Be more lenient with the unignore of Library in .gitignore
vscode for example has a issue in that it won't unignore Library if the
unignore line ends with a slash.
2024-03-02 17:48:18 +01:00
Douglas Eichelberger 07fad780de Remove hidden defs references 2024-02-11 20:27:38 -08:00
Douglas Eichelberger bec27d44c6 Remove stray ActiveSupport references 2024-01-26 15:38:13 -08:00
Douglas Eichelberger 53bba9c00f cleanup 2024-01-22 10:52:43 -08:00
Douglas Eichelberger 8efe73b32c Add Object#deep_dup to extend/ 2024-01-22 10:52:43 -08:00