- 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!
I bailed before going all the way to `typed: strict` but this should at
least improve things and fix:
`Library/Homebrew/tab.rb:111: warning: The class Tab reached 8 shape variations, instance variables accesses will be slower and memory usage increased.`
This is the pattern we've been adopting for a while and it's a bit
cleaner. Let's remove all of the existing usage of the existing pattern
to avoid confusion when adopting the new one.
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.
I previously added some instance variables in `Cask::DSL` to its
`initialize` method but I missed some last time, so we still see
warnings like `The class Cask::DSL reached 8 shape variations,
instance variables accesses will be slower and memory usage increased.
It is recommended to define instance variables in a consistent order,
for instance by eagerly defining them all in the #initialize method.`
This initializes more instance variables in `Cask` classes to resolve
other situations where this warning may occur. I've been testing this
for a while and haven't see any warnings with these changes but
there's always a chance that there's still more work to be done.
While we're here, also add `brew tests --no-parallel` which I relied
on during testing.
Pretty much anywhere we rely on a stubbed formula on disk to work: we
need to disable the API.
- move some things out of `extend` that don't really fit there e.g.
`Module`s that are included but not doing any
overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
`rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
`ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
- Remove a bunch of non-actionable/unnecessary noise in GitHub Actions
CI.
- Limit number of threads used to generate analytics API data to avoid
reproducible failures producing errors and requiring retries.
- Move to Debian Old Stable for testing non-system `glibc`.
- Remove unneeded core taps/updates.
- Improve naming of CI jobs to clarify purpose i.e. we're testing
things work on Linux, not Ubuntu specifically.
- Remove dedicated non-online/non-generic Linux `brew tests` jobs from
3 to 1.
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
The flag used to work well, but at some point started to run more and
more git actions. We use this to update formula and casks in other
homebrew taps, and it works well except for this issue.