I've been doing this personally for a few months and not hit any bugs.
We already do this for `brew tests`.
It will allow us to:
- remove manual type checks from all developer commands (Sorbet does a
better job with these)
- better surface bugs
- better surface type signatures
- get closer to being able to enable this by default for everyone
Instead of doing so literally whenever we query for a formula, Instead
do so only when we're in an auto-updateable command.
This better fits the existing behaviour while still updating when it's
most important to do so.
This sets the default and allows customising how often we try to
download files from the API.
This does not affect `brew update` as we want to always check every time
on an explicit call.
`brew bump` relies on `livecheck`, which we don't want to query the API
for.
Also, some small refactoring:
1. Declare the list of commands we want to set
`HOMEBREW_NO_INSTALL_FROM_API` for as an array.
2. Only check against this list when the command being run is a
developer command, to avoid checking the list when we know we're not
running a dev command.
- remove all places we check the flag so it's a no-op now
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where
relevant
- adjust the documentation
When either being in a non-default prefix or being on an unsupported
macOS version we expect most things to be built from source. In that
environment, do not allow HOMEBREW_INSTALL_FROM_API to be set.
Fixes#14475
Test `HOMEBREW_INSTALL_FROM_API` on `HOMEBREW_DEV_CMD_RUN` and
`HOMEBREW_DEVELOPER` folks who haven't run a
`HOMEBREW_DEVELOPER_COMMAND`.
The next step after this will be to make this functionality the default
for everyone.
This doesn't need to be nearly as often for HOMEBREW_INSTALL_FROM_API users because we're getting the latest information from the API when needed rather than just at `brew update` time.
This fix is required for ARM Linux where portable Homebrew Portable Ruby is not
available. Without this fix, after auto update, brew is restarted with cleaned up path.
This causes it to pick not find user installed Ruby by RVM or rbenv, causing brew to fail.
We used to need this because the GitHub runner process was running under
Rosetta. GitHub Actions has supported native M1 runners for a few months
now, so I think it's time to remove this.
add support for credentials usage in combination with other mirroring
features. previously `HOMEBREW_DOCKER_REGISTRY_TOKEN` and
`HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN` where only used in combination
with `HOMEBREW_ARTIFACT_DOMAIN` which affects *all* curl download strategies.
`HOMEBREW_BOTTLE_DOMAIN` is only used for bottle artifacts, whose mirror might
also require credentials.
this change removes the requirement of using `HOMEBREW_ARTIFACT_DOMAIN`.
related to #13226
- Rename use of "preinstall" to "auto update". The original "preinstall"
naming came from the fact that we used to only auto-update before
`brew install` but now that it's many commands: this is more confusing
than useful.
- Add `HOMEBREW_NO_UPDATE_REPORT_ONLY_INSTALLED` and remove
`HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED`; the latter is now the default
and the prior provides an opt-out for better output, performance and
avoiding reading potentially untrusted formulae.
- Add `HOMEBREW_UPDATE_FORMULA_VERSION_CHECKS` and don't check formula
versions by default for better performance by default.
Co-authored-by: Eric Knibbe <3324775+EricFromCanada@users.noreply.github.com>
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>