A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing
Now that all bottles (without existing `sha256` mismatches) have been
uploaded to GitHub Packages make it the default download location.
Will give this a few days testing before we make a tag and make this
default for everyone.
No migration has been done for Linuxbrew packages yet; those will be
done after we have fully migrated over Homebrew.
This case is _really_ slow even although it's something we encourage
people to run often and build systems often do. The `brew --prefix`
case is really fast because it's just in Bash so: let's pull the
`brew --prefix <formula>` case into Bash too.
This doesn't handle any edge-cases like `--installed` and the formula
detection is pretty simple.
Also, to make this behaviour consistent, never output `Cellar` paths
from the (Ruby) `brew --prefix`; we never want people relying on the
Cellar paths anyway, only output them if the formula wasn't installed
(where, arguably, using a Cellar path is even worse) and the speedup is
worth this deviation in behaviour.
- Enable it by default if you've run a developer command or set
`HOMEBREW_DEVELOPER`.
- Clarify the documentation that there's various configuration in which
it doesn't work.
I've rolled this out of most of GitHub's developers with no ill effects
and we've enabled it in both CI and for various maintainers so it feels
appropriate to have a bigger rollout.
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference.
We do not use curl that much there, setting the HOMEBREW_ON_DEBIAN7 flag
allows to lower the version, so that we can successfully pass the curl
version check below.
`HOMEBREW_CURL_PATH` has an effect only when `HOMEBREW_DEVELOPER` is set. However, the part of `brew.sh` that prints a message about outdated cURL disregards the value of `HOMEBREW_DEVELOPER`, which leads to a misleadnig message telling the user that `HOMEBREW_CURL_PATH` is outdated even though another cURL was used/tested.
This PR fixes it and instructs Homebrew to:
1. Display a warning message when system cURL is outdated and either `HOMEBREW_CURL_PATH` **or `HOMEBREW_DEVELOPER`** are not set. New `HOMEBREW_CURL_WARNING` variable is set to display the above warning only once (useful when `brew` calls itself internally).
2. Display `Installing Homebrew cURL` before auto-installing cURL in `update.sh` (due to `HOMEBREW_FORCE_BREWED_CURL`) and stop/exit if this step fails.
3. Display `Installing Homebrew Git` before auto-installing Git in `update.sh` (due to `HOMEBREW_FORCE_BREWED_GIT`) and stop/exit if this step fails.
Reorder and restructure this file to make it as fast as possible for
e.g. `brew --prefix`. Once we have that, also give `brew shellenv`
short-circuit command execution to make it as fast as possible.
On my machine (with a warm cache) this gets:
```
brew shellenv 0.01s user 0.03s system 100% cpu 0.038 total
```
Compared to:
```
brew shellenv 0.09s user 0.19s system 100% cpu 0.277 total
```
before this commit.