1762 Commits

Author SHA1 Message Date
Carlo Cabrera
2599cccc81
Add comment for in-source style exception 2021-07-08 19:16:39 +01:00
Carlo Cabrera
ebeb9e7e90
Define O1 and O0 methods separately 2021-07-08 10:56:36 +01:00
Carlo Cabrera
b37e574ad3
Fix typecheck error 2021-07-08 09:19:11 +01:00
Carlo Cabrera
b0b521001e
extend/ENV/super: allow O{1,0} to accept a block
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.
2021-07-08 08:59:47 +01:00
Carlo Cabrera
10edae9b94
Merge pull request #11644 from carlocab/cpuid-check
formula_cellar_checks: check for `cpuid` instruction when needed
2021-07-06 06:29:27 -07:00
Dawid Dziurla
8d5dc50b68
keg_relocate: swap env var 2021-07-04 15:02:39 +02:00
Carlo Cabrera
c59a42b24e
formula_cellar_checks: check for cpuid instruction when needed
This implements the second audit discussed in #11608.
2021-07-04 00:31:31 +01:00
Carlo Cabrera
0404da7ba7
superenv: handle formulae with runtime CPU detection
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 resolves Homebrew/homebrew-core#76537.

[1] open-mpi/ompi#8306 and linked issues/PRs
[2] Homebrew/homebrew-core#76537
2021-07-01 16:24:38 +01:00
Sam Ford
0752d25125
OS::Mac: Move version methods into ::Version 2021-06-23 09:03:46 -04:00
Mike McQuaid
72c59c816f
Merge pull request #11548 from MikeMcQuaid/3_2_deprecate_disable_remove
Deprecate, disable, delete code for Homebrew 3.2.0
2021-06-18 14:34:10 +01:00
Misty De Meo
c0a02442d9
Revert "language/java: use shortened brew paths"
This reverts commits 318175cfe2b23328f1b5f13812fd59cfd45fe1dc,
e7ab760392b9691a6c730b7e0d660b7874969e70 and
3b35af63f608438b1882756feca94a6ebdd0d6a3 (PR #11537).
2021-06-17 20:29:43 -07:00
Mike McQuaid
30a65342e8
Deprecate, disable, delete code for Homebrew 3.2.0
Do the usual deprecation, disable, delete dance for Homebrew 3.2.0.
2021-06-17 11:34:32 +01:00
Mike McQuaid
6a5891f1d8
Merge pull request #11537 from alebcay/short-brew-path
Utils: shortened brew paths
2021-06-16 11:13:59 +01:00
Caleb Xu
e7ab760392
extend/pathname: use shortened brew paths 2021-06-15 09:58:46 -04:00
Mike McQuaid
2395113154
diagnostic: hide some warnings on Apple Silicon.
We don't want to complain about either Intel or ARM installations of
Homebrew in `brew doctor` so check for/allow both.
2021-06-15 11:51:29 +01:00
Bo Anderson
095d5215f1
Merge pull request #11472 from Bo98/perl-all
os/mac/keg_relocate: add fallback to default Perl version when using tab
2021-06-09 13:59:35 +01:00
Daniel Nachun
273b06c822
Merge pull request #11459 from danielnachun/gcc_fix
super: fix GCC linkage issue in Linux
2021-06-02 20:23:53 -07:00
danielnachun
bd88f3d857 super: fix GCC issues 2021-05-31 11:17:00 -07:00
Bo Anderson
1fc39d2d0d
os/mac/keg_relocate: add fallback to default Perl version when using tab
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.
2021-05-31 16:31:26 +01:00
danielnachun
dc8568f541 linkage_checker: add libatomic 2021-05-31 00:40:19 -07:00
Carlo Cabrera
ada399c7db
Fix perl shebang rewriting for perl formula
See

    https://github.com/Homebrew/homebrew-core/issues/77797
    https://github.com/Homebrew/brew/issues/11275#issuecomment-846522409
2021-05-23 11:05:17 +01:00
Carlo Cabrera
e8b5eb7e42
extend/os/mac/keg_relocate: fix relocation of duplicate RPATHs
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.
2021-05-17 00:14:46 +01:00
Carlo Cabrera
d45832bbfc
Merge pull request #11382 from carlocab/build-rpaths
extend/os/mac/keg_relocate: remove `RPATH`s rooted in build directory
2021-05-15 01:04:25 +01:00
Carlo Cabrera
28c0caae4d
extend/os/mac/keg_relocate: remove RPATHs rooted in build directory
Keeping dangling `RPATH`s is a security risk, and is bad for build
reproducibility.
2021-05-14 01:07:14 +01:00
Carlo Cabrera
4fb06efe81
Fix TMUX env variable filtering
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'
2021-05-13 17:05:18 +01:00
Carlo Cabrera
dd199901e7
Merge pull request #11370 from carlocab/relocate-metavars 2021-05-13 07:02:25 +01:00
Carlo Cabrera
c7de544fe8
extend/os/mac/keg_relocate: fix post-bottling dylib ID relocation
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.
2021-05-12 21:37:33 +01:00
Carlo Cabrera
4b6f7aaa5b
extend/os/mac/keg_relocate: remove HOMEBREW_RELOCATE_METAVARS
It's not being used, and it breaks formulae when it is.

Plus do some extra refactoring.
2021-05-12 04:08:41 +01:00
Carlo Cabrera
a1c4243dd7
extend/os/mac/keg_relocate: refactor relocate_dynamic_linkage
Following feedback from #11331.
2021-05-10 17:42:35 +01:00
Carlo Cabrera
734defb1a9
Merge pull request #11352 from carlocab/custom-arch
extend/ENV/super: allow bottles with custom architectures
2021-05-10 14:30:41 +01:00
Bo Anderson
ae49b06600
keg_relocate: replace Perl shebangs 2021-05-10 06:13:54 +01:00
Bo Anderson
91ab5fe0ce
extend/os/mac/development_tools: add preferred_perl to built_on 2021-05-10 05:50:08 +01:00
Bo Anderson
1e567161d1
ENV/shared: specify which Perl version we want to use 2021-05-10 05:50:02 +01:00
Carlo Cabrera
e893f16727
extend/ENV/super: allow bottles with custom architectures
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)
2021-05-09 11:01:48 +01:00
Carlo Cabrera
dec7b97342
keg_relocate: style improvements
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-05-06 12:01:51 +01:00
Carlo Cabrera
8f1cd1288d
extend/os/mac/keg_relocate: relocate rpaths on macOS 2021-05-05 23:43:43 +01:00
Bo Anderson
f826ffdca8
Merge pull request #11307 from Bo98/pathname-write
extend/pathname: limit `write` override to a refinement
2021-05-04 15:16:12 +01:00
Bo Anderson
f174d4363f
extend/pathname: limit write override to a refinement 2021-05-04 14:20:20 +01:00
Sean Molenaar
4c67a8ce27
caveats: simplify non-plist return
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2021-05-04 14:36:00 +02:00
Sean Molenaar
0e27ec707b
Update Library/Homebrew/extend/os/mac/caveats.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-05-02 15:25:47 +02:00
Sean Molenaar
3ab21cc412
services: replace plist_options :manual with service command 2021-05-01 16:20:47 +02:00
Bo Anderson
7ee76b85d5
unpack_strategy/zip: ensure consistent timezone management 2021-04-27 20:29:18 +01:00
Carlo Cabrera
309504a32c
formula: add rpath helper method
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.
2021-04-19 09:23:33 +01:00
Mike McQuaid
1d34f7f2fa
Merge pull request #11077 from MikeMcQuaid/any_bottles
Support `all: SHA256` bottles.
2021-04-09 10:18:19 +01:00
Mike McQuaid
6b5213286c
Rename "exact" tag match to "no_older_versions"
This is more specific about the behaviour we want to have in future.
2021-04-09 09:36:18 +01:00
Mike McQuaid
d73351251c
Deprecate, disable, delete code for next major/minor version.
Do the usual dance for bumping our major/minor version.
2021-04-09 09:30:36 +01:00
Bo Anderson
20d86c0185
Refactor some tag handling into a Utils::Bottles::Tag class 2021-04-08 17:23:57 +01:00
Mike McQuaid
a654730acc
Merge pull request #11004 from MikeMcQuaid/cleanup_cxxstdlib
Cleanup use of CxxStdlib
2021-04-05 14:22:49 +01:00
Markus Reiter
b6ed8915e5
Add compatibility layer for AbstractDownloadStrategy#fetch. 2021-04-03 20:10:33 +02:00
Markus Reiter
24c9b599a6
Revert "Revert "Merge pull request #10864 from reitermarkus/command-timeout""
This reverts commit 57b2660cae8cf43efd2b88d84a7174706328c001.
2021-04-03 20:10:32 +02:00