591 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
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
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
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
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
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
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
a99323e5a6
os/mac/xcode: do not recommend softwareupdate CLI 2022-10-30 18:16:08 +00:00
Aryeh Hillman
51643d0ef0
Suggest --verbose for softwareupdate --all ...
Gives information about what is being updated, downloaded, etc. Else the updater is quite silent and it's hard to tell what's going on and when it will complete.

Example with the `--verbose` flag:

```
% softwareupdate --all --install --force --verbose

Software Update Tool

Finding available software
Downloading macOS Ventura 13.0
Password: 
Downloading: 65.02%
```

This feature is documented via `--help`; i.e.:

```
% softwareupdate --help
usage: softwareupdate <cmd> [<args> ...]

** Manage Updates:
	-l | --list		List all appropriate update labels (options:  --no-scan, --product-types)
	-d | --download		Download Only
	-i | --install		Install
		<label> ...	specific updates
		-a | --all		All appropriate updates
		-R | --restart		Automatically restart (or shut down) if required to complete installation.
		-r | --recommended	Only recommended updates
		     --os-only	Only OS updates
		     --safari-only	Only Safari updates
		     --stdinpass	Password to authenticate as an owner. Apple Silicon only.
		     --user	Local username to authenticate as an owner. Apple Silicon only.
	--list-full-installers		List the available macOS Installers
	--fetch-full-installer		Install the latest recommended macOS Installer
		--full-installer-version	The version of macOS to install. Ex: --full-installer-version 10.15
	--install-rosetta	Install Rosetta 2
	--background		Trigger a background scan and update operation

** Other Tools:
	--dump-state		Log the internal state of the SU daemon to /var/log/install.log
	--evaluate-products	Evaluate a list of product keys specified by the --products option 
	--history		Show the install history.  By default, only displays updates installed by softwareupdate.  

** Options:
	--no-scan		Do not scan when listing or installing updates (use available updates previously scanned)
	--product-types <type>		Limit a scan to a particular product type only - ignoring all others
		Ex:  --product-types macOS  || --product-types macOS,Safari 
	--products		A comma-separated (no spaces) list of product keys to operate on. 
	--force			Force an operation to complete.  Use with --background to trigger a background scan regardless of "Automatically check" pref 
	--agree-to-license		Agree to the software license agreement without user interaction.

	--verbose		Enable verbose output
	--help			Print this help
```
2022-10-22 16:09:52 -07:00
Bo Anderson
c092708448
Ventura RC version bumps 2022-10-20 20:04:42 +01:00
Francois-Xavier Coudert
e16afb305e Mark macOS Ventura as supported 2022-10-19 11:21:52 +02:00
Bo Anderson
44f93069bb
os/mac/pkgconfig/13: update for beta 9 SDK 2022-10-17 01:14:01 +01:00
Bo Anderson
cd6b81b28d
os/mac/xcode: require Xcode 14.1 on Ventura 2022-10-07 19:28:35 +01:00
Rylan Polster
b271ae151b
Cleanup 2022-06-29 11:47:57 -04:00
Rylan Polster
ac067eedb2
Create MacOSVersions module 2022-06-29 11:34:49 -04:00
Rylan Polster
f38db6e100
Define MacOS::Version::SYMBOLS on macOS and linux 2022-06-24 14:39:17 -04:00
Bo Anderson
75e76361ac
Preliminary macOS 13 support 2022-06-07 02:39:36 +01:00
Mike McQuaid
f43e9b6c04
os/mac/version: remove Yosemite.
It's no longer possible to run Homebrew there.

Co-authored-by: Bo Anderson <mail@boanderson.me>
2022-06-06 05:18:53 +01:00