We skip build-time deps when installing from bottles. However, the
current logic only considers the root, rather than the actual dependent
formula. Given
A (bottled)
|__B (not bottled)
|__C (build-time)
C will be pruned from the effective dependency tree of A. This is wrong,
because C is required in order to build B.
Fix this by examining the current dependent rather than the root.
FixesHomebrew/homebrew#17356.
Since 'gcc' is a symlink to 'llvm-gcc' on Xcode 4.3+, --use-gcc and
--use-llvm were doing exactly the same thing. Combined with the
previous commit, this allows users with either a leftover
/usr/bin/gcc-4.2 or a homebrewed apple-gcc42 to build with gcc.
This doesn't however fix Xcode-only systems with apple-gcc42.
FixesHomebrew/homebrew#17243.
xcrun has a lot of fallbacks if the first case fails but never actually
reaches them on CLT systems since it doesn't check the validity of the
first path before executing it.
(When should it reach these? Mainly for non-Xcode compilers we
support, e.g. apple-gcc42 which can be found by xcrun but which isn't
in /usr/bin)
The xcrun invocation also needed chomping.
Given
depends_on 'gnutls' => :recommended
depends_on 'libgcrypt' unless build.without? 'gnutls'
the dependency on libgcrypt should be enabled by default. However, the
corresponding option has not yet been generated, so the condition is
true and the dependency is disabled.
Instead, add a hook method that fires after each depends_on and adds the
appropriate option.
Yes, the formula object does refer to a version that has not yet been
installed, but we were not looking into Formula#prefix, but #linked_keg,
which is version agnostic (since the original patch was committed, we
Tab#for_formula learned to look into #opt_prefix as well). The rest of
the logic is already embedded in the Tab accessors.
Now that FormulaInstaller does dependency expansion the _right_ way,
avoid duplicating the logic in upgrade. Instead, offload it to the
installer, which will generate an exception in check_install_sanity that
we can safely ignore when formulae in the outdated list are upgraded as
part of the dependency tree of another outdated formula.