648 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
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
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
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
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
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
Bo Anderson
65c03573c6
ENV: fix missing arg for generic OS and correct type sigs 2021-02-26 18:23:48 +00:00
Bo Anderson
fb8b247db3
dev-cmd/unbottled: various improvements
* Ignore bottles for older macOS versions
* Ignore disabled formulae
* Ignore formulae which can't build on the chosen macOS
* Improve/fix sort description
2021-02-23 16:27:58 +00:00
Mike McQuaid
c13d7e6723
Fix brew style 2021-02-16 09:25:34 +00:00
Bo Anderson
0f4ccd7625
Merge pull request #10552 from Bo98/sdk-checks
os/mac/diagnostic: check SDK version in SDKSettings matches the path
2021-02-11 12:53:05 +00:00
Bo Anderson
fe52b3a402 os/mac/diagnostic: check SDK version matches the path 2021-02-11 01:19:59 +00:00
Michka Popoff
0a292c7041
linux: use preferred_gcc instead of gcc 2021-02-09 21:48:48 +01:00
Michka Popoff
221983dbcf
compilers: prefer gcc 5 on linux
Fixes #10170 by preferring gcc@5 on linux
This makes sure ENV.cc and ENV.cxx is correctly set:

If a formula does not explicitely depend on a brewed gcc,
ENV.cc is set to gcc-5 (system gcc-5 or brewed gcc-5) with this change,
even if other gcc versions are installed on the system.
2021-02-08 13:26:50 +01:00
Bo Anderson
ec3e078bcb os/mac/diagnostic: always require dev tools on Apple Silicon 2021-02-05 12:26:28 +00:00
Carlo Cabrera
5ce6537169
extend/os/mac/language/java: improve readability 2021-02-02 14:42:47 +00:00
Jonathan Chang
d6bba1c493 java: fix java_home on macOS 2021-02-02 18:49:29 +11:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
EricFromCanada
99ad3350ee use single quotes around stanza and parameter names 2021-01-26 16:19:47 -05:00
Rylan Polster
64816651d0
Only tap homebrew/cask on CaskUnavailableError in brew install 2021-01-20 12:22:31 -05:00
Rylan Polster
ebba369887
Tap: add untapped_official_taps method 2021-01-20 12:02:24 -05:00
Rylan Polster
3ca68c076e
Don't tap user-untapped official taps 2021-01-19 17:55:03 -05:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Mike McQuaid
8af4895479
Improve submitted analytics data
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
  not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference.
2021-01-07 09:28:40 +00:00