Homebrew/homebrew-core#77623 revealed two bugs. One in `ruby-macho`,
which turns out to be unable to delete duplicated `RPATH`s. This was
fixed with `ruby-macho` 2.5.1.
The second, which this commit fixes, is in our handling of duplicate
`RPATH`s. Since we iterate over each `RPATH`, attempting to relocate the
first duplicate fails since it will no longer exist after having
relocated the original.
We currently filter out `TMUX`, but this breaks displaying some caveats.
This also enables an alias I use (and improved by @Rylan12):
brew alias fzp='!id="$(gh pr list -L200 -R github.com/Homebrew/homebrew-core | TMUX=$HOMEBREW_TMUX fzf-tmux -p "90%,50%" --multi | cut -f1)"; [ -n "$id" ] && brew pr-publish --autosquash $id'
Running `brew bottle` changes dylib IDs, install names, and rpaths into
placeholders for the bottle, creates a bottle tarball, and then changes
the placeholders back to their correct values.
With my refactoring in #11358, the behaviour of this relocation changed:
dylib IDs would no longer be changed back from placeholders into their
correct values after the creation of the bottle tarball.
Currently, Homebrew recognises only the architectures listed in
`hardware.rb`. [1] Attempting to pass an unrecognised architecture to
`--bottle-arch` while building a bottle returns an error.
Let's change that by passing unrecognised bottle arches to the compiler
instead of immediately failing with a `CannotInstallFormulaError`.
Partially resolves#5815.
[1] 64b6846d60/Library/Homebrew/hardware.rb (L28-L42)
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.
- remove usage on macOS as we don't care about it there
- don't error out on incompatibility but still store stdlib on Linux
- remove (now) unused methods
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file.
[g]libtoolize looks for m4 using the environment variable M4. When
that isn't set, it looks for m4 in PATH.
However, when libtool is a build dependency but m4 is not, m4 will
not be found in PATH. Since it is currently not set in the
environment by superenv, this causes some builds to fail.
Closes https://github.com/Homebrew/homebrew-core/pull/73932.
Building automake fails with autoconf 2.70+, when autoconf is used with
macOS m4. It therefore makes sense for autoconf to depend on brewed m4.
However, without the change proposed here, the setting of the M4
environment variable in superenv breaks the automake build.
Related: https://github.com/Homebrew/homebrew-core/pull/73797