Filtering for this is now handled properly in places where this function is used.
In some scenarios, we _want_ test deps on more than the first level (Homebrew.args.include_formula_test_deps?).
Previously, this returned a String, but a Tap instance seems much more
sensible.
I couldn't find anywhere this method was actually used, so the change
shouldn't break anything.
- formula_installer: only recompute dependencies when necessary i.e.
when a bottle pour fails.
- formula_installer: re-add accidentally remove dependency options
- dependency: missing options are only those that actually exist on a
formula
During the dependencies expansion, there may be errors (e.g. FormulaUnavaiableError).
As result, some deps will be left behind in the stack and interfere afterwards
dependencies expansion.
So let's ensure stack clean for each expansions.
FixesHomebrew/homebrew#48834.
If we have a dependency cycle ensure that infinite recursion does not
result by storing state in a stack which we push/pop from for each
level of recursion and verify that we haven’t been through this
dependency already.
ClosesHomebrew/homebrew#47933.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
While it may suffice to merge string and non-reserved tags by forming a
union of all tags of dependencies of the same name, this approach fails
to work for the reserved tags. These are now merged such that the most
restrictive tag (meaning sometimes an empty tag) is preserved.
The previous behavior caused essential dependencies to be omitted and
builds to fail in response. E.g., multiple `:fortran` dependencies with
tags `[]`, `[:recommended]`, and `[:optional]` would have been expanded
and merged to `"gcc"` with tags `[:recommended, :optional]`, causing it
to be no longer seen as a required dependency.
ClosesHomebrew/homebrew#47040.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This means that dependencies can be merged but still maintain all
their option names.
ClosesHomebrew/homebrew#46916.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This code is supposed to allow
depends_on "foo" => "with-bar"
to work when foo has only a "without-bar" option.
The options system was not designed to support this. Unfortunately, it
was bolted on anyway. The implementation is extremely difficult to
understand, and it only works for certain types of options, which is
confusing from a user's point of view. Luckily, no formulae in core or
the official taps rely on the behavior in order to function.
It is hindering progress in improving this code, so I am removing it.