Repository navigation
Preserve and validate no_linkage metadata - #24263
Merged
Merged
Conversation
p-linnane
added this pull request to stack #24264
October 14, 2026 23:27
p-linnane
force-pushed
the
no-linkage-api-metadata
branch
from
October 14, 2026 23:55
d135da1 to
ee524cb
Compare
- `Formula#to_hash` dropped `:no_linkage`, so formulae loaded from the API lost the linkage expectations `brew linkage` relies on. - Emit a `no_linkage_dependencies` name list beside the existing string arrays and overlay it when loading, keeping older readers working. - Reject conflicting `:no_linkage` declarations for one dependency within a spec and platform at load time, since the overlay is by name. Signed-off-by: Patrick Linnane <patrick@linnane.io>
MikeMcQuaid
force-pushed
the
no-linkage-api-metadata
branch
from
October 15, 2026 07:38
ee524cb to
a9aa984
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.
Formula#to_hashdrops:no_linkage, so formulae loaded from the API lose the linkage expectations thatbrew linkageuses to exempt a dependency from the unnecessary-dependency check and to report unexpected linkage. This emits ano_linkage_dependenciesname list beside the existing string arrays for stable, HEAD and each variation, and overlays it when buildingFormulaStructdependencies, so the role arrays keep their shape and older readers keep working;uses_from_macosentries already carried their tags.Because the overlay is keyed by name, all declarations of one dependency within a spec and platform must now agree on
:no_linkage; a contradiction raisesFormulaSpecificationErrorwhen the spec is instantiated, including for an inactive HEAD spec, and the rule is documented in thedepends_ondocs and the Formula Cookbook. All 356 homebrew-core formulae that use:no_linkageload without conflicts across the 16 platform tags. New examples cover the writer, the generator, both API loaders end to end from formula source on macOS and Linux tags and the declaration validation.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Codex (GPT-6 Astra) wrote the change, tests and Cookbook text, verified the new examples fail without the change (four pin existing behaviour and pass on both), scanned homebrew-core and ran
brew lgtm --online; Claude Code (Mythos 5.1) reviewed it, round-tripped synthetic and homebrew-core formulae through the public and internal loaders on macOS and Linux tags, repeated the red and green runs against the base, ran the docs checks (brew style docs, Vale andmdl) and ranbrew lgtm --onlineon this commit.Summary by CodeRabbit