Use the formula file from the Keg if `local_bottle_install` is set,
which means that the formula file from the tap is used for `-s`,
`--HEAD` and normal installs but the formula file present within
formula.prefix/".brew" is used for local bottle installs.
- Both formulae and casks can have caveats, but only formulae caveats
were shown at the end of a bulk install/upgrade/reinstall operation
via `Homebrew.messages.record_caveats`. This fixes that to show Cask
caveats too, for consistency (scrolling up all of the
multi-formulae-and-casks output to see caveats is time-consuming and
users might miss them).
- In doing this I had to change how `Messages#record_caveats` works
since the cask name is just a string, not an object.
Currently, Homebrew recognises only the architectures listed in
`hardware.rb`. [1] Attempting to pass an unrecognised architecture to
`--bottle-arch` while building a bottle returns an error.
Let's change that by passing unrecognised bottle arches to the compiler
instead of immediately failing with a `CannotInstallFormulaError`.
Partially resolves#5815.
[1] 64b6846d60/Library/Homebrew/hardware.rb (L28-L42)
- remove usage on macOS as we don't care about it there
- don't error out on incompatibility but still store stdlib on Linux
- remove (now) unused methods
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file.
- ensure that `HOMEBREW_DEVELOPER` still fails when there's a bottle
available but the `pour_bottle?` block fails. This is usually due to
the CLT being missing (and it's removed on even patch macOS upgrades)
so building from source without prompt is undesirable.
- require `--build-from-source` for dependencies that aren't already
installed
- do these bottle checks before fetching dependencies (they were already
done before fetching requested formulae)
Fixes#10729
Dependencies were using `Tab.for_formula(df)` to get a `Tab` which meant
that they were always ending up with the (default) value of `true` for
`installed_on_request`. Fix this by:
- setting `installed_on_request` to `false` by default in empty `Tab`s;
we always override it on installation so we'd rather have it default
to `false`
- only read and use a `Tab` for the existing dependency formula if
there's an existing `Keg`
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
the default. We mostly already do this since we added the need for
the `--build-from-source` override on macOS. This allows us to
delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
upgrading if failing on a formula-specific reason e.g. the CLT is
not/no longer installed, you're using a non-default prefix.
Fixes#10623