Track dependencies with linkage in formulae
Verification
- [x] This issue's title and/or description do not reference a single formula e.g.
brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.
Provide a detailed description of the proposed feature
When new bottles are built for formulae, compare their linkage to dependencies versus the previous version's bottle. This information can then be autogenerated and stored in the bottle block or a new linkage block. This will allow us to drop dependencies that are no longer used, and be able to check/do this automatically, unlike now – we are unable to do this without maintainers/contributors checking this.
CC @Homebrew/core
What is the motivation for the feature?
Removing redundant dependencies means fewer dependencies are installed or old, unused dependencies are removed – reducing disk usage for users and keeping the dependency information in the formula file correct.
How will the feature be relevant to at least 90% of Homebrew users?
Yes, reducing users' disk space and ensuring formula files have correct dependency information are both important goals.
What alternatives to the feature have been considered?
Current status quo: do nothing different.
This is great, thanks @nandahkrishna! One nit:
When new bottles are built for formulae, compare their linkage to dependencies versus the previous version's bottle. This information can then be autogenerated and stored in the
bottleblock or a newlinkageblock. This will allow us to drop dependencies that are no longer used, and be able to check/do this automatically, unlike now – we are unable to do this without maintainers/contributors checking this.
I'm fairly 👎🏻 on storing this in the bottle or linkage block; it'll look pretty ugly. Some alternate options here:
- store in the
INSTALL_RECEIPT.json - store somewhere else in the bottle manifest (as it includes the
INSTALL_RECEIPT.json) - require something like
depends_on "foo" => :linkagewhich causes a failure ifbrew linkagedetects that it's not linked to and causesbrew linkageto fail if it detects any formulae with linkage that don't have:linkage
Any of these could be used by brew test-bot similarly for comparison purposes.
This is a duplicate of https://github.com/Homebrew/brew/issues/19697 at this point and, despite this being opened earlier, I think that's now the preferred approach.