Skip to content

Embed executables in API JSON#22301

Open
MikeMcQuaid wants to merge 1 commit into
mainfrom
embed-executables-api-json
Open

Embed executables in API JSON#22301
MikeMcQuaid wants to merge 1 commit into
mainfrom
embed-executables-api-json

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Avoid fetching executables.txt as a separate API artefact.
  • Keep which-formula data generated from active formula JSON.
  • Let internal API packages carry executable metadata.

  • 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? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • 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. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 xhigh with local review, tweaks and testing.


Copilot AI review requested due to automatic review settings May 16, 2026 12:58
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

Removes the dedicated internal/executables.txt download path and instead embeds per-formula executable lists in the formula/internal API JSON. The client-side cache file is regenerated from that JSON whenever update-report writes name/alias lookups, and brew which-formula/brew exec rely on brew update --auto-update to refresh it rather than performing their own curl.

Changes:

  • Add executables to FormulaStruct and write it into per-formula JSON and internal packages.<tag>.json from ExecutablesDB data committed in the tap.
  • Add Homebrew::API.write_executables_file! and call it from API::Formula.write_names_and_aliases / API::Internal.write_formula_names_and_aliases to regenerate internal/executables.txt from JSON.
  • Drop the dedicated curl + homebrew.commandnotfound fetch path from update.sh/which-formula.sh (now ensure_executables_file just relies on auto-update).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Library/Homebrew/api.rb New write_executables_file! writing internal/executables.txt from formula JSON.
Library/Homebrew/api/formula.rb Call write_executables_file! after writing formula names/aliases.
Library/Homebrew/api/internal.rb Same call from the internal-API path.
Library/Homebrew/api/formula_struct.rb Add executables field to FormulaStruct.
Library/Homebrew/dev-cmd/generate-formula-api.rb Load ExecutablesDB and inject executables into generated formula hashes.
Library/Homebrew/dev-cmd/generate-internal-api.rb Same injection for internal packages JSON.
Library/Homebrew/executables_db.rb New to_hash accessor for read-only consumers.
Library/Homebrew/cmd/update.sh Remove conditional fetch of internal/executables.txt.
Library/Homebrew/cmd/which-formula.sh Replace download_and_cache_executables_file with ensure_executables_file that triggers brew update --auto-update.
Library/Homebrew/cmd/exec.sh Update caller to ensure_executables_file.
Library/Homebrew/test/api/* Add coverage for executables field and write_executables_file!.
Library/Homebrew/test/dev-cmd/generate-*-api_spec.rb Verify generator embeds executables read from ExecutablesDB.

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

Comment thread Library/Homebrew/api.rb Outdated
Comment thread Library/Homebrew/cmd/update.sh Outdated
Comment thread Library/Homebrew/cmd/which-formula.sh
@MikeMcQuaid MikeMcQuaid force-pushed the embed-executables-api-json branch 3 times, most recently from b0da37d to ee2dc80 Compare May 16, 2026 15:25
- Avoid fetching `executables.txt` as a separate API artefact.
- Keep `which-formula` data generated from active formula JSON.
- Fall back to legacy executable data during the JSON transition.
- Drop obsolete `--skip-update` command options.
- Keep stale `HOMEBREW_BOOTSNAP_GEM_PATH` from breaking coverage runs.
- Use the correct Linux mtime check for the executables database.
@MikeMcQuaid MikeMcQuaid force-pushed the embed-executables-api-json branch from ee2dc80 to 9d8a8d1 Compare May 16, 2026 15:57
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.

2 participants