- This file was _massive_ - over 60k lines and we had to bump the file
size limit for pushes to the repo!
- This was because by default Tapioca, when it encounters a
`require "rubocop"` during RBI generation, loads all of the cops ever
because they're all classes inside `RuboCop::Cop`.
- There wasn't an easy way to control this at Tapioca generation time
(we tried), so now we parse the generated RBI file and delete classes
and method definitions that we don't use.
- I regenerated the RBIs (`brew tc --update rubocop`) and added new
things to the allowlist until Sorbet came back green.
- Now the file is ~7k lines and 240K - much better!
We have a `HOMEBREW_MACOS_NEWEST_UNSUPPORTED` environment variable
and this is used in `MacOSVersion` to determine prerelease versions
but we don't have a way of easily determining the newest supported
macOS version.
`bump-cask-pr` contains logic that assumes the first key/value in
`MacOSVersion::SYMBOLS` is the newest macOS version but it recently
became clear that this is a prerelease version between WWDC and the
subsequent macOS release. Similarly, `dev-cmd/generate-cask-api.rb`
tries to compute the newest stable macOS version as
`HOMEBREW_MACOS_NEWEST_UNSUPPORTED.to_i - 1` and this will fail
if/when we update that variable to `"26"`, as the macOS version
before 26 is 15, not 25.
This adds a `HOMEBREW_MACOS_NEWEST_SUPPORTED` environment variable,
so we have a straightforward way of quickly identifying the newest
supported macOS version without having to make potentially unreliable
assumptions or do computations to identify the latest non-prerelease
`MacOSVersion` value. This also updates the two aforementioned areas
to use this environment variable to produce the newest stable macOS
version symbol in a more reliable way.
This extracts the logic for generating the `system_options` array in
the `replace_version_and_checksum` method into a separate
`generate_system_options` method. This logic is becoming more complex
(after recent changes) and manually testing it is a pain, so this
change is intended to allow us to add tests. The tests added here
provide 100% coverage for the method.
Import these from the homebrew/formula-analytics tap and deprecate
that tap.
This required a little messing around with filenames and paths to get
it finding Python and writing to the user's home directory.
We will now build on Ventura (macOS 13) to Sequoia (macOS 15).
Runners for macOS 15-x86_64 will not be allocated by default due to a
lack of appropriate hardware.
We were selectively requiring the tap.rb file in a few places for
performance reasons. The main method we were referencing was the
`Tap.cmd_directories` method which uses `Pathname` and the `TAP_DIRECTORY`
constant internally. `Tap.cmd_directories` is mostly used in the `Commands`
module and that is loaded very early on in the program so it made sense
to move that command to that module. To facilitate that I moved the
`TAP_DIRECTORY` constant to the top-level and renamed it to
`HOMEBREW_TAP_DIRECTORY`. It now lies in the tap_constants.rb file.
A nice bonus of this refactor is that it speeds up loading external
commands since the tap.rb file is no longer required by default in
those cases.
- I was on a plane and this failed with:
```
expected block to not output to stderr, but output
"curl: (6) Could not resolve host: spdx.github.io\nWarning: Failed to fetch SBOM schema, cannot perform SBOM validation!
Warning: Could not fetch JSON schema to validate SBOM!\nWarning: SBOM is not valid, not writing to disk!"
```
This allows us to keep all information about timeout values here in
`brew` instead of both here and in Homebrew/core.
Will be needed after Homebrew/homebrew-core#171457.
- 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>