819 Commits

Author SHA1 Message Date
Douglas Eichelberger
eb7c3e52a0 Require SystemInclude only where needed 2024-01-31 11:42:01 -08:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Bo Anderson
c51838fa1f os/mac/pkgconfig/14: update for 14.2 2024-01-01 16:33:25 +00:00
Bo Anderson
afe453da28
Merge pull request #16389 from Bo98/xcode-15.1
os/mac/xcode: support Xcode 15.1
2023-12-23 16:46:18 +00:00
Bo Anderson
61a73014d3 os/mac/xcode: support Xcode 15.1 2023-12-23 00:55:50 +00:00
Bo Anderson
04ad24efe8 os/mac/xcode: add fast path for Xcode version detection 2023-12-23 00:49:36 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Rylan Polster
b7532a86e1
Add commented out deprecations for MacOS when simulating Linux 2023-11-22 21:22:00 -05:00
Rylan Polster
4efd7cdb28
Comment out MacOS on Linux deprecations 2023-11-22 21:21:29 -05:00
Rylan Polster
0839e21425 Deprecate MacOS methods on Linux 2023-11-15 18:38:53 +00:00
Bo Anderson
cf08039712
os/mac/xcode: remove unnecessary type assertion 2023-09-13 14:26:27 +01:00
Bo Anderson
6d0c424b41
os/mac/pkgconfig: update for macOS 14 RC SDK 2023-09-13 01:47:03 +01:00
Mike McQuaid
9d44d278e4
os/mac/keg: fix change_rpath type signature.
Fixes #15990
2023-09-11 14:57:22 +01:00
Steve Peters
94ef9a4b7a codesign in keg_relocate instead of keg methods
Currently the codesign_patched_binary method may be called many
times for the same file when installing a keg.

This removes the calls to codesign_patched_binary from os/mac/keg
and adds a single call to the relocate_dynamic_linkage and
fix_dynamic_linkage methods in extend/os/mac/keg_relocate
to speed up keg installation.
2023-09-09 18:14:28 -07:00
Carlo Cabrera
93b43ad7a9
os/mac/mach: fix rpath deletion of fat machos
Fixes #15859.
2023-08-14 14:29:05 +08:00
Carlo Cabrera
b5334b818c
os/mac/mach: avoid recursively resolving rpaths
This is just a recipe for infinite loops. Plus, recursive references are
likely to be invalid, so we don't really gain much by attempting to
resolve them.[^1] (But we could if we made the logic here much more
complicated.)

Fixes a CI failure seen at Homebrew/homebrew-core#138323.

[^1]: See, for example, embree/embree#455.
2023-08-05 23:40:22 +08:00
Osama Albahrani
77f97f71eb config: :OS_VERSION (fix style) 2023-07-29 00:58:36 -04:00
Osama Albahrani
8243009d06 config: fallback to ::OS_VERSION
In Linux systems where lsb_release is not available by default,
`brew config` now falls back to `PRETTY_NAME` (`HOMEBREW_OS_VERSION`).

Before:
```console
$ brew config
HOMEBREW_VERSION: 4.1.2-30-gc346a5c
ORIGIN: https://github.com/Homebrew/brew
HEAD: c346a5c97adef16fcc439b53cc6e757b64b71cb4
Last commit: 14 hours ago
Core tap JSON: 29 Jul 04:16 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: /usr/bin/nano
HOMEBREW_EVAL_ALL: set
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: quad-core 64-bit skylake
Clang: N/A
Git: 2.41.0 => /bin/git
Curl: 8.2.1 => /bin/curl
Kernel: Linux 6.4.4-200.fc38.x86_64 x86_64 GNU/Linux
OS: Unknown
Host glibc: 2.37
/usr/bin/gcc: 13.1.1
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A
```

After:
```console
$ brew config
HOMEBREW_VERSION: 4.1.2-30-gc346a5c-dirty
ORIGIN: https://github.com/Homebrew/brew
HEAD: c346a5c97adef16fcc439b53cc6e757b64b71cb4
Last commit: 14 hours ago
Core tap JSON: 29 Jul 04:37 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: /usr/bin/nano
HOMEBREW_EVAL_ALL: set
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: quad-core 64-bit skylake
Clang: N/A
Git: 2.41.0 => /bin/git
Curl: 8.2.1 => /bin/curl
Kernel: Linux 6.4.4-200.fc38.x86_64 x86_64 GNU/Linux
OS: Arch Linux
Host glibc: 2.37
/usr/bin/gcc: 13.1.1
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A
```
2023-07-29 00:41:13 -04:00
Carlo Cabrera
b80940e1d8
os/mac/mach: simplify
We can avoid having to define a local variable and then reference it
inside these blocks by passing a proc instead.
2023-07-27 12:02:20 +08:00
Carlo Cabrera
acae97e70f
os/mac/mach: resolve rpaths too
We can add a small amount of logic to `#resolve_variable_name` that will
allow us to perform (limited) resolution of rpath references. This is
for informational purposes only: failing to resolve an `@rpath`
reference will not (and should not) result in `brew linkage` failures.

`dyld` will typically have more information than we do to resolve these
references, so not failing `brew linkage` when we fail to resolve an
`@rpath` reference is the right behaviour here.

As an example, before:

    ❯ brew linkage jpeg-turbo
    System libraries:
      /usr/lib/libSystem.B.dylib
    @rpath-referenced libraries:
      @rpath/libjpeg.8.dylib
      @rpath/libturbojpeg.0.dylib

After:

    ❯ brew linkage jpeg-turbo
    System libraries:
      /usr/lib/libSystem.B.dylib
    Homebrew libraries:
      /usr/local/Cellar/jpeg-turbo/3.0.0/lib/libjpeg.8.dylib (jpeg-turbo)
      /usr/local/Cellar/jpeg-turbo/3.0.0/lib/libturbojpeg.0.dylib (jpeg-turbo)
2023-07-27 12:02:20 +08:00
Carlo Cabrera
6b728bf3bd
Implement ruby-macho TODOs
We now have the new release of ruby-macho (#15758), so we can now
finish off the remaining work from #15731.
2023-07-26 11:15:19 +08:00
Carlo Cabrera
4c73942fae
extend/os/mac/keg_relocate: improve rpath handling
This implements the TODO that I left as a comment from #15722.

In order to simplify the handling of deleting an absolute rpath that has
a relative duplicate (or vice-versa, i.e., a relative rpath with an
absolute duplicate), we relocate all rpaths first in one pass and then
delete the duplicates in a separate pass.

We currently rely on some lower-level (but still public) methods from
ruby-macho since the standard `#delete_rpath` method changes the order
in which rpaths are resolved. We can switch back to using
`#delete_rpath` when Homebrew/ruby-macho#555 is merged and released.
2023-07-23 00:22:05 +08:00
Carlo Cabrera
13f2dc325e
os/mac/mach: report duplicate rpaths
We don't want to call `uniq` on this because this breaks our handling of
duplicate rpaths.
2023-07-17 13:11:12 +08:00
Carlo Cabrera
38c00934d6
os/mac/mach: better typechecking fix
Co-authored-by: Douglas Eichelberger <dduugg@users.noreply.github.com>
2023-07-12 01:24:19 +08:00
Carlo Cabrera
88a14c644c
os/mac/mach: fix type-checking error 2023-07-11 22:49:06 +08:00
Gabriel Gerlero
15a0c7fd7d linkage_checker: resolve some variable install names on macOS 2023-07-06 14:15:14 -03:00
Bo Anderson
f504b92c45
Preliminary macOS 14 (Sonoma) support 2023-06-05 23:21:11 +01:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Markus Reiter
4bbf120630
Add note about Version constructor. 2023-05-09 01:13:55 +02:00
Markus Reiter
a1efaf1864
Merge HeadVersion and NullVersion into Version. 2023-05-09 01:13:54 +02:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
7fdd75ad41 brew style --fix 2023-04-17 11:00:55 -07:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
Ruoyu Zhong
f5d414e365
os/mac/xcode: fix Clang version for Xcode 14.3
The one shown on the Wikipedia [^1] seems to be wrong. I can confirm
the actual version locally.

[^1]: https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2
2023-04-11 22:27:37 +08:00
Bo Anderson
5c55cd78fd
os/mac/xcode: update for Xcode 14.3 2023-04-11 02:50:44 +01:00
Bo Anderson
4465f36f2c
os/mac/pkgconfig/13: update for macOS 13.3 2023-04-11 02:50:26 +01:00
Carlo Cabrera
fdc113d85c
os/mac/version: add unsupported_release? helper 2023-04-07 22:21:08 +08:00
Carlo Cabrera
a4ebb96fe6
Remove MacOS definition from generic OS
We don't want to define `MacOS` in the generic OS, so let's make sure we
refer to it as `OS::Mac` in the places we need it.

This reverts commit 575cb0263cb1428c63b9428bbd913ffde83bd317.
2023-04-04 23:10:51 +08:00
Carlo Cabrera
575cb0263c
determine-test-runners: fix generic OS test failures
Without this, testing on the generic OS results in errors like

    Error: uninitialized constant Homebrew::MacOS
2023-04-04 22:34:17 +08:00
Douglas Eichelberger
adfd12cfd0 Enable more typing 2023-03-21 21:42:51 -07:00
Douglas Eichelberger
4f2ff3819b Clean up rbi files 2023-03-18 16:03:25 -07:00
Ruoyu Zhong
e9ce4a5a4e
Update path to system settings on Ventura
"System Preferences" has been renamed to "System Settings" on Ventura.
Privacy and security settings have moved, too. This commit makes sure
these changes are reflected. (Some adjustments were already made in
#14092.)

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-03-17 19:24:07 +08:00
Douglas Eichelberger
04fa6e24d7 Enable more typing 2023-03-13 09:08:56 -07:00
Issy Long
e9d994622e
rubocop: Drop "f" from Naming/MethodParameterName allowlist
- This either stands for "file" but more often than not "formula".
2023-03-11 00:17:27 +00:00
Issy Long
3e7a46f474
rubocop: Drop "v" from Naming/MethodParameterName allowlist
- This was an easy fix, "v" => "version".
2023-03-08 14:40:55 +00:00
Maxim Belkin
2b008ae7fd os/linux.rb: wsl_version: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-27 16:56:28 +00:00
Maxim Belkin
c9b289fc3d Use 'wslview' instead of 'xdg-open' on Windows 2023-02-27 14:39:56 +00:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00