- Found with
`grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`.
- This stops people from trying to bump them and
getting an error that they can't fix because
[it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008),
wasting contributor time.
- Add more early return checks
- Move to a recursive approach for more readability and avoiding a
counter that we need to bump
- Perform more caching
- Keep class variable usage isolated into specific methods
Right now this is done through the gcc@5 formula.
See 9692318ca6/Formula/gcc%405.rb (L33)
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from one gcc formula to another..
Also, not having the right glibc version results in a non-functional brew
installation on an older Linux: the glibc installation needs
to be done by brew, and not by a workaround in a specific formula
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Bo Anderson <mail@boanderson.me>
Co-Authored-By: Shaun Jackman <sjackman@gmail.com>
There are about 10 formulae which need a bit more flexibility from
`#rpath`. Most of them use `Pathname#relative_path_from`, so we can
replace those instances with a call to `#rpath` instead once `#rpath`
knows how to handle this.
This method takes an optional array of `Pathnames`s or `Strings`s and
extracts the native slice from the specified universal binary. If no
parameter is supplied, this is done on all compatible universal binaries
in a formula's keg.
`deuniversalize_machos` is a no-op on Linux.
I still need to look into a) error handling, and b) whether using this
method requires codesigning on ARM.
I've also added signatures to the methods in `extend/os/linux/formula`.
About 40 formulae set `CMAKE_INSTALL_RPATH` to `lib` or `opt_lib`, but
this breaks bottle relocatability.
The correct solution is to use `@loader_path/../lib`, but this is macOS
specific, so it requires some OS-specific logic. Rather than replicating
this logic over many formulae, we may as well define a helper method for
it.
See https://github.com/Homebrew/homebrew-core/issues/75458.
1. Raise an exception on macOS.
2. Verify that the missing libraries are specified either as Strings or
Regular Expressions.
Signed-off-by: Maxim Belkin <maxim.belkin@gmail.com>
We have strings containing hardcoded ".dylib" extensions in homebrew-core.
To be able to bring linuxbrew-core and homebrew-core closer together,
I am introducing a new generic attribute that can be used in formulae.