For a long time people have requested some sort of configuration files
for Homebrew. Now: here's the first version of that.
Similarly to how you can configure Git for a system, a repository or
a user: you can configure Homebrew for a system, a prefix or a user.
The system-wide configuration file is `/etc/homebrew/brew.env`, the
prefix-specific configuration file is
`$HOMEBREW_PREFIX/etc/homebrew/brew.env`
and the user-specific configuration file is `~/.homebrew/brew.env`.
As we need to read these files from Bash in `bin/brew` (so they can)
influence functionality ASAP: they are in a simple format that Bash
can read. It may be that we have more complex array or hash data in
future that's configured through JSON or YAML (most likely JSON as we
use it more) and stored in a `brew.json`/`brew.yaml` file in the same
directory.
As this is relying on `eval` in Bash which is fairly dangerous: we
filter the lines with a regex to ensure we're only permitting setting
`HOMEBREW_*` variables and nothing more.
To give a bit of power to system administrators, the
`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in
`/etc/homebrew/brew.env` to ensure that the system-wide configuration
file is loaded last and overrides any prefix or user settings.
Now that we have an actual location for configuration files, let's also
change the `brew livecheck` watchlist configuration file to be in this
directory and deprecate the existing location. As this is a developer
command and the mitigation is to just move the file: we don't need to
follow the normal deprecation process here.
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
- Without this, `brew man` produces a lowercasing diff that violates
Vale's rules.
- Also run `brew man` to test this out, and that updated some dates to
December.
This variable allows a user to configure how often `brew update` runs.
With the previous implementation, however, it was still pretty slow as
it would run some of `brew update` even within the timeout. This feels
related to complaints about Homebrew "feeling slow" since we enabled
this. Address this by:
- making `HOMEBREW_AUTO_UPDATE_SECS` behave more like
`HOMEBREW_NO_AUTO_UPDATE` and entirely skip the invocation of
`brew update` if the relevant tap (homebrew-core or homebrew-cask
depending on command invoked) has been checked in the last
`HOMEBREW_AUTO_UPDATE_SECS`
- Only require/check the update of a single tap rather than every tap
- Increase the default value of `HOMEBREW_AUTO_UPDATE_SECS` from 1m
to 5m to cut people a bit more slack. We're not updating things
often enough for 1m not to feel a bit overkill and 5m feels
appropriate for a Homebrew "session" to only require a single update.
Today the Homebrew maintainers elected a new PLC, TSC and project lead.
Documentation is to follow detailing exactly the responsibilities for
each of these roles but adjust these to reflect the current state until
that point.
This will become the default in a later version of Homebrew but has an
opt-out through HOMEBREW_NO_INSTALL_CLEANUP.
Also, always cleanup files older than 120 days and set the general
default value for "old" logs, casks etc. to 30 days.
more.
`brew`'s `man` page's 'ENVIRONMENT' section is intended to list only those
environment variables that users can set, not any that Homebrew sets as part of
its operation.