148 Commits

Author SHA1 Message Date
Patrick Linnane
2c9b094bea
os/mac/diagnostic: set OCLP Support Tiers
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-04-12 17:03:54 -07:00
Mike McQuaid
d899f00c4b
Link to Support Tiers in diagnostic/error messages
Now that we have this nice URL let's reference it to allow our other
messages to be a bit shorter/kinder.
2025-04-01 11:35:27 +01:00
Eric Knibbe
e52943d8d6
os/mac/diagnostic: fix case of OpenCore check 2024-11-13 12:23:34 -05:00
Ruoyu Zhong
d0418add45
os/mac/diagnostic: improve OpenCore check
This is based on [1].

[1]: https://github.com/Homebrew/brew/pull/18765#issuecomment-2474056438
2024-11-14 00:55:49 +08:00
Ruoyu Zhong
a525ce0ad8
Apply suggestions from code review
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2024-11-13 23:43:24 +08:00
Ruoyu Zhong
13265ca170
os/mac/diagnostic: skip OpenCore check in CI 2024-11-13 23:11:16 +08:00
Ruoyu Zhong
dee399c27d
os/mac/diagnostic: display OpenCore version 2024-11-13 23:01:29 +08:00
Ruoyu Zhong
854fc16889
os/mac/diagnostic: fix OpenCore check
Fixes #18763.
2024-11-13 22:48:51 +08:00
Carlo Cabrera
2c20e3b8de
os/mac/diagnostic: check for OpenCore
This configuration is not supported. Let's make `brew doctor` complain
about it.
2024-11-13 09:43:16 +08:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07:00
Mike McQuaid
dc9618457d
Improve brew doctor output on prerelease macOS
- Avoid near duplicate messages
- Provide correct CLT download instructions

Before:
```
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Your Command Line Tools are too outdated.
Update them from Software Update in System Settings.

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 16.0.

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Settings.

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 16.0.

Warning: Your Xcode (15.4) at /Applications/Xcode.app is too outdated.
Please update to Xcode 16.0 (or delete it).
Xcode can be updated from:
  https://developer.apple.com/download/all/

Warning: Your Xcode (15.4) is outdated.
Please update to Xcode 16.0 (or delete it).
Xcode can be updated from:
  https://developer.apple.com/download/all/

If 16.0 is installed, you may need to:
  sudo xcode-select --switch /Applications/Xcode.app
Current developer directory is:
  /Applications/Xcode.app/Contents/Developer

```

After:
```console
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Your Command Line Tools are too outdated.
Install the Command Line Tools for Xcode 16 from:
  https://developer.apple.com/download/all/

Warning: Your Xcode (15.4) at /Applications/Xcode.app is too outdated.
Please update to Xcode 16.0 (or delete it).
Xcode can be updated from:
  https://developer.apple.com/download/all/

```
2024-09-06 17:38:25 +01:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Issy Long
0e81efcccb
sorbet: Comment more files that can't be strict because of undef
- Found with
  `grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`.
- This stops people from trying to bump them and
  getting an error that they can't fix because
  [it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008),
  wasting contributor time.
2024-08-09 18:23:00 +01:00
Mike McQuaid
16901a674f
extend/kernel: make opoo/odie/etc. print GitHub Actions notes.
We already do this for deprecations but these may make warnings
and errors from Homebrew easier to spot in GitHub Actions logs.

While we're here, cleanup other cases that should have used
`GitHub::Actions::Annotation` but didn't and provide some helpers and
tweaks there necessary for our use case here.
2024-05-09 14:43:53 +01:00
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Mike McQuaid
de73522b5a
os/Mac/diagnostic: include Xcode path and version. 2024-03-08 08:24:45 +00:00
Gábor Lipták
05acfaba33 Emit more specific error text on outdated Xcode
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2024-03-07 16:24:08 -05:00
Bo Anderson
58874de60b
Generalise internal cross-image handling 2024-02-22 17:25:20 +00:00
Issy Long
0e27dc2564
Fix RuboCop Style/ArrayIntersect offenses 2024-01-18 14:11:43 +00:00
Bo Anderson
688d87e839
Remove Ruby 2.6 & macOS system Ruby support code 2023-12-12 03:44:31 +00:00
Bo Anderson
386fd0548a
Support system Ruby 3 on Linux 2023-11-07 19:27:30 +00:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Bo Anderson
e2aae0fa63
Require Ruby 2.6.10 2023-04-12 13:15:34 +01:00
Douglas Eichelberger
0079cefc95 Enable types in remaining untyped extensions 2023-04-02 12:24:11 -07:00
apainintheneck
b6f9b7d3e0 Remove bitdefender diagnostic check
This shows up in `brew doctor` but hasn't been
reported as a problem by users in 3+ years.
2022-12-28 10:45:29 -08:00
Bo Anderson
476b5e7424
os/mac/diagnostic: allow Ruby 2.6.10 on < Ventura 2022-10-25 10:55:05 +01:00
Bo Anderson
c092708448
Ventura RC version bumps 2022-10-20 20:04:42 +01:00
Bo Anderson
75e76361ac
Preliminary macOS 13 support 2022-06-07 02:39:36 +01:00
Bo Anderson
d857c8416d
os/mac: allow fake El Capitan setup for Portable Ruby builds 2022-05-31 17:56:25 +01:00
Bo Anderson
d0f6f7d52b
Require Ruby 2.6.8 2021-11-08 18:39:21 +00:00
Bo Anderson
4836ea0ba2
Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Carlo Cabrera
b0939478d1
extend/os/mac/diagnostic: fix unqualified macOS version reference
Currently, this says something like

    Ruby version 2.6.8 is unsupported on 12.

which is a little cryptic. Let's change that to say

    Ruby version 2.6.8 is unsupported on macOS 12.
2021-10-21 20:06:34 +08:00
Bo Anderson
943b79d2fb
os/mac/diagnostic: allow Ruby 2.6.8 2021-10-21 02:31:32 +01:00
Bo Anderson
acc20ef2c4
os/mac/diagnostic: also check Xcode minimum version on env setup 2021-09-17 00:03:44 +01:00
Bo Anderson
8076c9e569
os/mac/diagnostic: don't check for prerelease macOS in integration tests 2021-09-09 16:53:52 +01:00
Bo Anderson
8efce9a9d2
os/mac/diagnostic: check min CLT version on env setup 2021-08-17 18:36:27 +01:00
Bo Anderson
9686ebe355
os/mac/diagnostic: prevent some double diagostic failures 2021-08-11 14:19:22 +01:00
Sam Ford
0752d25125
OS::Mac: Move version methods into ::Version 2021-06-23 09:03: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
fe52b3a402 os/mac/diagnostic: check SDK version matches the path 2021-02-11 01:19:59 +00:00
Bo Anderson
ec3e078bcb os/mac/diagnostic: always require dev tools on Apple Silicon 2021-02-05 12:26:28 +00:00
Francois-Xavier Coudert
b02acb37c0 Remove warning on ARM 2020-12-24 14:15:03 +01:00
Nick Morgan
77e063d4a6
Fixing xcode-select --switch command line option 2020-12-16 21:33:20 -05:00
Mike McQuaid
3c4d12a5d5
extend/os/mac/diagnostic: add more Xcode/CLT update instructions.
Addresses issue mentioned in #9215.
2020-11-20 13:30:00 +00:00
Mike McQuaid
74264b8582
Big Sur cleanup
Remove `HOMEBREW_BIG_SUR_TESTING` variable as it is no longer needed.
2020-11-18 10:15:53 +00:00
Markus Reiter
f87c9c5dc4 Fix tests failing locally. 2020-11-18 05:54:42 +01:00
Mike McQuaid
5afff3f3aa
Handle macOS Homebrew on ARM
- Output `brew doctor` and `brew install` messages noting this configuration is (currently) unsupported and encourage use of Rosetta instead
- Output Rosetta 2 usage in `brew config` on ARM (whether in Rosetta 2 or not)
- Check the architecture of (newly installed) dependencies and ensure they are using the correct architecture.
- Don't allow installing macOS Intel Homebrew in macOS ARM Homebrew default prefix (and vice versa
- Actually write out the architecture of dependencies to the tab rather than generating and throwing them away
- Set and document the expected default prefix for macOS Intel Homebrew, macOS ARM Homebrew (`/opt/homebrew`) and Homebrew on Linux

While we're here:
- Don't say Big Sur is a prerelease version but still make it clear we
  don't support it (yet).
- Don't reference non-existent IRC channel
2020-11-12 17:06:47 +00:00
Mike McQuaid
6b27dcb11c
workflows/tests: use Big Sur.
Migrate GitHub Actions to Big Sur.
2020-11-06 15:11:33 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00