1741 Commits

Author SHA1 Message Date
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
Shaun Jackman
31aa0375ca
build_info: Add oldest_cpu_family for Linux only 2021-04-02 18:42:53 -07:00
Mike McQuaid
04abc51d1f
Cleanup use of CxxStdlib
- 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
2021-04-02 13:55:29 +01:00
Shaun Jackman
95e7e010ee Add OS::Linux::Glibc.version 2021-04-01 22:16:33 -07:00
Shaun Jackman
0db0db9516
build_system_info: Use the host glibc version only
Use the host glibc version only to avoid errors with
brew tests --no-compat
2021-04-01 15:04:40 -07:00
Shaun Jackman
11bfba1762
build_info: Add glibc_version for Linux 2021-04-01 13:04:32 -07:00
Mike McQuaid
d8a2cf9efc
Write tabs to bottle JSON, optionally not bottle
- 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.
2021-03-31 09:43:37 +01:00
Carlo Cabrera
bfb9134884
Merge pull request #10944 from carlocab/libtool-m4
extend/ENV/super: set `M4` for `libtool`
2021-03-29 16:02:54 +01:00
nandahkrishna
09febbf031
extend/ENV: make 'passphrase' sensitive
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-03-29 16:58:07 +05:30
Mike McQuaid
9d70b48e93
Merge pull request #10851 from kthchew/audit-empty-files
audit: check for installed empty files
2021-03-29 11:55:56 +01:00
Kenneth Chew
9d6bfa5965
pathname: do not install empty metafiles 2021-03-27 13:34:50 -04:00
Carlo Cabrera
e8452de418
extend/ENV/super: set M4 for libtool
[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.
2021-03-26 14:32:09 +00:00
Carlo Cabrera
9308a2515b
Merge pull request #10921 from carlocab/brewed-m4
extend/ENV/super: remove M4
2021-03-25 06:04:43 +00:00
Carlo Cabrera
f6eba3c1ea
extend/ENV/super: remove M4
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
2021-03-24 13:14:58 +00:00
Rylan Polster
57b2660cae
Revert "Merge pull request #10864 from reitermarkus/command-timeout"
This reverts commit d55bdd3ddbe7ff2b1f106a41bd994dc117ca5142, reversing
changes made to 3c3bf1c74d1d7ef1d2c792719574623b6c3c4d25.
2021-03-24 01:22:18 -04:00
Markus Reiter
712a95fdd0 Allow specifying timeouts for commands and downloads. 2021-03-16 18:15:21 +01:00
Liyang HU
adac92b326 Library/Homebrew/extend/os/mac/extend/ENV/super.rb: obsolete HOMEBREW_CCCFG flag s
@Bo98's comment https://github.com/Homebrew/brew/pull/10802#issuecomment-792072121
2021-03-06 23:15:55 +00:00
Bo Anderson
344ab02f18
Merge pull request #10767 from Bo98/audit_deps-force_homebrew_on_linux
Allow deps auditing to run on Linux via HOMEBREW_SIMULATE_MACOS_ON_LINUX
2021-03-05 23:46:31 +00:00
Bo Anderson
abb2b26a93
Add HOMEBREW_SIMULATE_MACOS_ON_LINUX 2021-03-05 12:21:45 +00:00
Bo Anderson
7448a6be58
Revert "Revert "uses_from_macos: fix force_homebrew_on_linux behaviour.""
This reverts commit 9ad37ddc36c8438db97fdb3e4484d724e06eaffe.
2021-03-05 12:21:45 +00:00
Mike McQuaid
49642e4267
linux/keg_relocate: patchelf dependency is conditional.
This is only needed if we're not using `patchelf.rb`.

Partial fix for https://github.com/Homebrew/brew/issues/10784
2021-03-05 11:36:23 +00:00
Mike McQuaid
dc1fdc9f8d
Speedup brew --version.
Port `brew --version` to Bash to speed it up.

While we're here:
- remove (now) unused `Tap` Git methods
- use `--quiet` instead of `-q` to be more verbose

Benchmarks:
```
$ hyperfine --min-runs=3 --warmup=2 "git checkout origin/master; brew --version" "git checkout speedup_brew_version; brew --version"
Benchmark #1: git checkout origin/master; brew --version
  Time (mean ± σ):      2.083 s ±  0.004 s    [User: 396.8 ms, System: 597.2 ms]
  Range (min … max):    2.080 s …  2.088 s    3 runs

Benchmark #2: git checkout speedup_brew_version; brew --version
  Time (mean ± σ):     847.9 ms ±  35.2 ms    [User: 100.0 ms, System: 247.9 ms]
  Range (min … max):   824.1 ms … 888.3 ms    3 runs

Summary
  'git checkout speedup_brew_version; brew --version' ran
    2.46 ± 0.10 times faster than 'git checkout origin/master; brew --version'
```
2021-03-04 12:59:42 +00:00