Embed executables in API JSON#22301
Open
MikeMcQuaid wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
executablestoFormulaStructand write it into per-formula JSON and internalpackages.<tag>.jsonfromExecutablesDBdata committed in the tap. - Add
Homebrew::API.write_executables_file!and call it fromAPI::Formula.write_names_and_aliases/API::Internal.write_formula_names_and_aliasesto regenerateinternal/executables.txtfrom JSON. - Drop the dedicated curl +
homebrew.commandnotfoundfetch path fromupdate.sh/which-formula.sh(nowensure_executables_filejust 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.
b0da37d to
ee2dc80
Compare
- 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.
ee2dc80 to
9d8a8d1
Compare
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.
executables.txtas a separate API artefact.which-formuladata generated from active formula JSON.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review, tweaks and testing.