- 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
Follow up to #10183.
This improves the error message displayed when `formula.pour_bottle?` is
false.
Before:
❯ brew install python@3.8
Error: python@3.8: no bottle available!
The bottle needs the Apple Command Line Tools to be installed.
You can install them, if desired, with:
xcode-select --install
You can try to install from source with e.g.
brew install --build-from-source python@3.8
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
After:
❯ brew install python@3.8
Error: python@3.8: the bottle needs the Apple Command Line Tools to be installed.
You can install them, if desired, with:
xcode-select --install
You can try to install from source with e.g.
brew install --build-from-source python@3.8
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
- Refuse to create bottles which have non-relocatable references to
`HOMEBREW_LIBRARY`. This allows us to make all bottles ignore where
`HOMEBREW_REPOSITORY` is (even those that aren't `cellar :any`).
I cannot see any circumstances in which any bottle should link to
anything within `HOMEBREW_REPOSITORY`.
- Remove audit that becomes unnecessary given the above change.
- Relocate references to `@HOMEBREW_LIBRARY@` but don't actually write
any references yet. This will allow us to move to using
`@HOMEBREW_LIBRARY` and remove all relocation of `HOMEBREW_REPOSITORY`
in a future release (2.7.1, most likely).
- Rename `BuildToolsError` to `UnbottledError` to better reflect what it
does (particularly now)
- Improve the `UnbottledError` messaging
- Raise the `UnbottledError` for dependencies also when building bottles
(so that we don't try and build bottles against things that have been
built from source).
We were previously only looking at the `cellar` value when pouring
bottles and ignoring the `prefix` and (implicit) `repository`.
Actually look at these values and set the defaults for each platform.
Also, when we're relocating to create or pour bottles when `prefix`
and `repository` are equal then skip relocating the `repository` and
always use references to the `prefix` instead.
Fixes#9453
- Output `brew doctor` and `brew install` messages noting this configuration is (currently) unsupported and encourage use of Rosetta instead
- Output Rosetta 2 usage in `brew config` on ARM (whether in Rosetta 2 or not)
- Check the architecture of (newly installed) dependencies and ensure they are using the correct architecture.
- Don't allow installing macOS Intel Homebrew in macOS ARM Homebrew default prefix (and vice versa
- Actually write out the architecture of dependencies to the tab rather than generating and throwing them away
- Set and document the expected default prefix for macOS Intel Homebrew, macOS ARM Homebrew (`/opt/homebrew`) and Homebrew on Linux
While we're here:
- Don't say Big Sur is a prerelease version but still make it clear we
don't support it (yet).
- Don't reference non-existent IRC channel
- set `Formula#force_bottle` from `FormulaInstaller`
- refuse to install non-bottled formulae with `--force-bottle`
- raise exceptions on fetch/pour failures if `--force-bottle is passed.
While we're here:
- use `CannotInstallFormulaError` for some `RuntimeError`/`odie`
Fixes https://github.com/Homebrew/brew/issues/8866.
The way we currently handle @-versioned formulae linking is pretty
labourius:
- it requires extensive use of `link_overwrite` to avoid the `link`
stage failing on certain install/upgrade scenarios
- we teach people to use `brew link --force` whenever they wish to
link a versioned formulae when it's pretty obvious what's expected
in that situation
Instead, let's:
- automatically unlink other versioned formulae when linking a
versioned formula (either through `brew link` or `install`/`upgrade`
/`reinstall`)
- notify the user what we've done (with the same messaging as if
they had run `brew link` manually)
Ensure that we don't try to check for broken linkage in a keg that
doesn't exist. Furthermore, fix the reason we checked for the keg that
doesn't exist by `Formula.clear_cache`.
While here, I noticed that there was other methods of caching at use in
`Formula` so consolidate them to be consistent.
Fixes#8997