- rename #dependencies_list to #internal_dependencies_hash
- the initial implementation returned an array but now it doesn't
- simplify usage of #tap in #internal_dependencies_hash
- remove safe navigation operator usages in #internal_dependencies_hash
- better document why implicit dependencies are not included in the API JSON
- add new test fixture formula to better test generation of uses from
macos bounds with the new internal json format
Some backfilled bottle signatures were signed from a branch, and others
from main, so the signing workflow is slightly different which causes
some bottles to incorrectly fail when checking their attestation (apr
for example). The simplest way to solve this is just removing the
backfill repo `cert-identity` check and just rely on the repository and
attestation date falling before our cutoff. This shouldn't meaningfully
affect security because if somehow someone could generate false backfill
attestations from a different workflow (the only case this protects
against), we will still catch it because the attestation would have been
generated after our cutoff date.
- in `brew.sh` split the `case` into those cases that take a single or
no arguments and those that take multiple arguments or handle
multiple commands. This considerably speeds up the
`brew shellenv bash` case that wasn't being handled here before.
- add `setup-ruby` to the list of commands that can be called quickly
by `brew.sh` without additional setup. This speeds up the
`brew setup-ruby` no-op case by ~10x.
- add a parameter to `setup-ruby` to avoid running Bundler if the
command doesn't need it. This makes many more cases for
`brew setup-ruby` to be no-op cases.
- Remove the (now) unused `HOMEBREW_RUBY3` check in `setup-ruby`.
- Improve argument handling in `command_path.sh` to allow it to be
used as a function in `setup-ruby.sh`.
- Add a new RuboCop to check usage of `install_bundler_gems!` is only
inside `dev-cmd` (or a few other acceptable places).
- Use new `processed_source.file_path` API in `formula_cop.rb`
- Add a (large) speedup by moving some logic to Bash for the typical
case of a normal or dev-cmd, Bash or Ruby command.
- Make `brew command` a non-developer command, I don't think it makes
sense to consider it something needed for developing Homebrew.
- Update the manpage/tests/RBI accordingly.
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
- Call `Homebrew.install_bundler_gems!` as early as possible
- Always call `Homebrew.install_bundler_gems!` in `dev-cmd` rather than
in `Library/Homebrew` helpers method (to ensure we don't accidentally
call this for non-dev-cmd commands)
Occasionally, when failing to `brew install` or `brew upgrade` a formula, users will get an error message and the last line of it will be:
```
Error: Validation Failed: [{"message"=>"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.", "resource"=>"Search", "field"=>"q", "code"=>"invalid"}]
```
Here's an old public example: https://gitlab.com/tabos/rogerrouter/-/issues/21
At Square, this error can be caused by a transient issue with a user's GitHub credentials.
My proposal is that any error which prevents `brew` from showing related issues should:
1. Not cause `brew` to exit early (vs. printing diagnostic checks and doing any other cleanup)
2. Be clearly differentiated from the original failure (so it doesn't become a red herring for users troubleshooting their broken formula)
When doing an `install`, `outdated` or `upgrade` and referring to a
formula or cask in a specific tap: you probably want to get the latest
version of that formula/cask more often than the default 1 or 24 hours.
Let's check for arguments for these commands that look appropriate and
auto-update every 5 minutes in that case.