The array of options that is passed to the spawned build process is a
combination of the current ARGV, options passed in by a dependent
formula, and an existing install receipt. The objects that are
interacting here each expect the resulting collection to have certain
properties, and the expectations are not consistent.
Clear up this confusing mess by only dealing with Options collections.
This keeps our representation of options uniform across the codebase.
We can remove BuildOptions dependency on HomebrewArgvExtension, which
allows us to pass any Array-like collection to Tab.create. The only
other site inside of FormulaInstaller that uses the array is the #exec
call, and there it is splatted and thus we can substitute our Options
collection there as well.
Formulae can now pass build options to dependencies. The following
syntax is supported:
depends_on 'foo' => 'with-bar'
depends_on 'foo' => ['with-bar', 'with-baz']
If a dependency is already installed but lacks the required build
options, an exception is raised. Eventually we may be able to just stash
the existing keg and reinstall it with the combined set of used_options
and passed options, but enabling that is left for another day.
Optional deps are not installed by default but generate a corresponding
"with-foo" option for the formula. Recommended deps _are_ installed by
default, and generate a corresponding "without-foo" option.