This makes `ENV.O{1,0}` behave like `ENV.deparallelize`.
This should also allow us to build libgcrypt's jitter entropy collector,
which we currently disable because it interacts poorly with our compiler
shims. See #11201.
Some formulae are able to detect the features of the runtime CPU, and
execute code accordingly. This typically entails 1) the detection of
features of the build-time CPU in order to determine the targets that
the compiler can generate code for, and 2) generating code for the
targets that the compiler can support.
Our filtering of optimization flags can cause misdetection of compiler
features, leading to failed builds [1], and miscompilation even when the
build does not fail [2].
Let's try to fix this by allowing formulae to declare
`ENV.runtime_cpu_detection` which skips the filtering of `-march` and
related flags.
I've also skipped the filtering of the optimisation
level, since it seems to me that if upstream maintainers have gone to
the lengths of writing code that detects runtime hardware, they probably
also know better about appropriate `-O` flags to use.
This is a partial list of formulae that should make use of this feature:
1. apache-arrow
2. fftw
3. gromacs
4. open-mpi
5. openblas
Partially resolvesHomebrew/homebrew-core#76537.
[1] open-mpi/ompi#8306 and linked issues/PRs
[2] Homebrew/homebrew-core#76537
This reverts commits 318175cfe2b23328f1b5f13812fd59cfd45fe1dc,
e7ab760392b9691a6c730b7e0d660b7874969e70 and
3b35af63f608438b1882756feca94a6ebdd0d6a3 (PR #11537).
While this should never be necessary for per-OS bottles, this could be useful for :all bottles where the OS it was built on uses a Perl version that doesn't exist on all macOS versions.
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.