This repository has been archived by the owner. It is now read-only.

`brew leaves` breaks for formulas with no `deps` #16108

wants to merge 1 commit into


None yet
2 participants

theunraveler commented Nov 16, 2012

Certain formula in the josegonzalez/homebrew-php repo (, for example) have separate classes for verifying dependencies. This confuses the brew leaves command, which I guess expects all classes to have a deps method.

I'm not sure if this is correct place to fix the problem, but I added an additional check to the brew-leaves script that ignores classes without a deps method. This seems to fix the problem (i.e. brew leaves now runs without errors), but I don't know if this is something that should instead be fixed in the josegonzalez/homebrew-php repo.

Steps to reproduce:
brew tap josegonzalez/homebrew-php
brew install composer
brew leaves


jacknagel commented Nov 17, 2012

This is actually caused by a deeper problem: Homebrew assumes that all Ruby files in a tapped repo are formulae. In the case of homebrew-php, this is not true anymore due to the shared requirement classes. These get loaded like they are formulae, though, and formulae methods get called on them.

This previously manifested itself in #16053, but it will cause problems in any code that iterates over all formulae. A hack was added in Homebrew/homebrew-php@7b0f650, but obviously the problem needs to be fixed in Homebrew-core.

So we probably should avoid peppering code with ad-hoc fixes.


jacknagel commented Nov 17, 2012

Rolling this into #16121.

@jacknagel jacknagel closed this Nov 17, 2012

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.