Let's start storing `revision` and `pkg_version` for tab runtime
dependencies and use them when available.
When the `revision` is not available, use a conservative approach to
deciding whether dependencies need to be upgrade.
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
When we're installing a formula from a bottle, we currently always
upgrade all dependencies in the dependency tree to be safe.
However, if we're installing a bottle and the `runtime_dependencies`
within that bottle's tab all have older or equal versions to those
already installed: we do not need to upgrade these dependencies.
This should help a lot of upgrading a lot of the time, at least for
users using bottles (which is the huge majority).
The only downside or other noticeable change is that this requires us
to download or attempt to download the bottle tab before we compute
the dependencies at installation time.
Co-authored-by: Kevin <apainintheneck@gmail.com>
Dependency.to_formula() in the following line will cause a
CoreTapFormulaUnavailableError then download all dependency bottles in FormulaInstaller.verfi_deps_exist()
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.