Repository navigation
Combine dependency role tags from API metadata - #24302
Merged
Merged
Conversation
- `FormulaStructGenerator.process_dependencies` emitted one entry per role, so formulae loaded from the API split e.g. `depends_on "foo" => [:build, :test]` into separate dependencies while source loading keeps one. - Union each name's role tags in a fixed order, appending `:no_linkage`, and keep runtime entries separate so `Formula#to_hash` role lists still match the source. - Stub API metadata in the dependency round-trip specs so they run offline. Signed-off-by: Patrick Linnane <patrick@linnane.io>
edbfi
added a commit
to edbfi/homebrew-taps
that referenced
this pull request
Oct 21, 2026
* fix(ci): update Homebrew before building formulae Since Homebrew/brew#24302 the formula API lists dependency tags as arrays, which the runner image's brew rejects (Can't set Homebrew::API::FormulaStruct.head_dependencies). HOMEBREW_NO_AUTO_UPDATE kept that old brew, so every formula build fails. Signed-off-by: edbfi <326875205+edbfi@users.noreply.github.com> * docs(ci): say that check-formulae.sh updates Homebrew Signed-off-by: edbfi <326875205+edbfi@users.noreply.github.com> --------- Signed-off-by: edbfi <326875205+edbfi@users.noreply.github.com>
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.
Formulae loaded from the API split a dependency with more than one role, such as
depends_on "foo" => [:build, :test], into separate:buildand:testdependencies, while loading the formula's Ruby source keeps oneDependencywith both tags.FormulaStructGenerator.process_dependenciesnow unions each name's role tags in a fixed order (:build,:test,:recommended,:optional, then:no_linkage) so API-loaded formulae get the same dependencies as source-loaded ones; separate:buildand:testdeclarations of one name also load as one combined dependency. Runtime entries stay separate, so a formula that depends ongettextand also declares it:buildkeeps it in bothdependenciesandbuild_dependenciesfromFormula#to_hash. The round-trip examples now cover a runtime dependency with combined tags, compare theFormula#to_hashdependency lists and stub the API metadataFormula#to_hashreads so they run offline. Brew versions before 7.0.10 (#24262) reject array-valued tags in the internal API whenHOMEBREW_SORBET_RUNTIMEis set.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Codex (GPT-6 Astra) wrote the change and tests, compared source and API-loaded dependencies across homebrew/core for all 16 OS/arch tags, checked the new examples fail before the change on host and
--genericand ranbrew lgtm --online. Claude Code (Opus 5.5) reviewed it, found that an earlier version dropped runtime dependencies from theFormula#to_hashrole lists, reran the comparison on the final version for the formulae whose output could change, checked the new examples fail on the previous code offline on host and--generic, rebased onto currentmainand ranbrew lgtm --onlineon this commit.Summary by CodeRabbit