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.
This can happen on e.g. fossil where the dependency HEAD requires having
an install of fossil in order to check it out. Bit of a silly edge case
but this handles it.
FixesHomebrew/homebrew#25605
When decided what dependencies should be part of the build environment
(and have appropriate entries added to variables like PKG_CONFIG_PATH),
we select the entire dependency tree except for
(1) inactive optional and recommended deps (2) indirect build-time deps
(i.e., build-time deps of other deps)
There is a third category that sould be excluded: dependencies of direct
build-time deps. These are irrelevant to the build, and including them
can cause unexpected linkages.
When an exception is raised in the build process, it is marshaled and
sent to the main process over a pipe. The marshaled exception has
a reference to the formula, so the formula and all objects it references
are marshaled as well.
Previously this did not include dependencies, as they were stored only
on the class and not referenced by an instance variable. However, now
they are stored on SoftwareSpec instances, to which the formula *does*
have a direct reference, so they must be marshalable.