1153 Commits

Author SHA1 Message Date
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
Caleb Xu
a70d15c80d
shared: only fall back to -march=native on supported architectures 2024-11-12 11:34:40 -05:00
Caleb Xu
33a9d24111
linux/hardware/cpu: add some missing AMD CPUs 2024-11-09 21:54:05 -05:00
Carlo Cabrera
017c8d05dc
linux/hardware/cpu: add some missing Intel CPUs
Information taken from 1bf385f102/llvm/lib/TargetParser/Host.cpp
2024-11-09 11:45:23 +08:00
Mike McQuaid
f5b211efaa
os/linux/diagnostic: remove XDG_DATA_DIRS. 2024-10-31 12:43:36 +00:00
Bo Anderson
b34e6ee20e
Merge pull request #18638 from Homebrew/keg_relocate-type-fix
keg_relocate: fix error when dylib_id doesn't need changing
2024-10-26 06:45:57 +01:00
Bo Anderson
28f19878e3
keg_relocate: fix error when dylib_id doesn't need changing 2024-10-26 06:31:05 +01:00
Bo Anderson
529eadd6cc
os/mac/keg_relocate: don't change Swift stdlib dylib IDs 2024-10-25 20:55:21 +01:00
Bo Anderson
97866f8adf
Perform preinstall checks when a formula is installed via a cask 2024-10-11 16:57:47 +01:00
Douglas Eichelberger
ed4129b580 Remove removable constants 2024-10-07 19:45:48 -07:00
Douglas Eichelberger
8033fcf4a6 Fix brew style docs 2024-10-07 18:59:27 -07:00
Douglas Eichelberger
2d16333bbc Replace removable constants with overridable methods 2024-10-07 18:33:03 -07:00
Douglas Eichelberger
d3d25beb35 Use requires_ancestor consistently 2024-10-06 09:25:57 -07:00
Douglas Eichelberger
0855d7c9e0 Revert ENV changes 2024-10-05 12:35:28 -07:00
Douglas Eichelberger
f4a6dce64a Fix ENV 2024-10-05 12:18:29 -07:00
Douglas Eichelberger
0d5b56aa6a Fix tests 2024-10-05 12:18:29 -07:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07:00
Bo Anderson
567f5eb4be
Allow sockets to use longer paths on macOS 2024-09-27 04:37:03 +01:00
Mike McQuaid
eab322946a
formula: fix alias/generic/prepend std_cmake_args issue.
Seen in:
https://github.com/Homebrew/homebrew-core/pull/191090#issuecomment-2363215204

There's a missing signature issue here due to the `generic_*` aliasing
we're doing. With prepend, though: this is no longer needed and we can
use `super` instead which is more idiomatic and nicer overall.

This pattern should probably be applied in other places but: let's try
this targetting fix for here first.
2024-09-20 13:01:42 +01:00
Douglas Eichelberger
125ced9cf8 Fix formatting 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
61985bc7f3 Use top-level OS instead 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
bb80f063dc Fix namespacing 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
7cd329c116 Makes args readable 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
27e951c408 Replace undef with prepended modules 2024-09-19 10:58:53 -07:00
Michael Cho
99d81b4717
ENV/super: replace m4 shim with M4 variable
The problem is the shim can end up getting baked into formula binaries
(e.g. `flex`) or cause odd issues when mixed up with brew `m4`, e.g.
https://github.com/Homebrew/homebrew-core/issues/180040
2024-09-11 11:33:44 -04: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
Bo Anderson
98fb5f9dea
Don't assume ENV is a superenv in RBI 2024-08-23 05:59:00 +01:00
Michael Cho
1dbedddc58
diagnostic: check for strings in XDG_DATA_DIRS 2024-08-17 21:59:49 -04:00
Douglas Eichelberger
df2fcfdfb0 Add missing sigs 2024-08-15 09:21:43 -07:00
Douglas Eichelberger
70b072a7d0 Suppress sorbet type errors when using `undef' 2024-08-15 08:03:45 -07:00
Carlo Cabrera
c42860cd3c
Merge pull request #18045 from Homebrew/linux-formula_installer-strict 2024-08-15 17:47:19 +08:00
Patrick Linnane
699d918d95
extend/os/linux/keg: use typed: strict
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-08-13 13:09:43 -06:00
Patrick Linnane
7e58233aaf
extend/os/linux/formula_installer: use typed: strict
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-08-13 12:56:01 -06: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
Mike McQuaid
6105728c31
Merge pull request #18004 from Homebrew/more-srb-strict 2024-08-12 14:22:00 +01:00
Issy Long
fc3c138cb0
extend/os/linux/cmd/update-report: Bump to Sorbet typed: strict 2024-08-10 23:55:14 +01:00
Issy Long
c62ee6be6c
extend/os/mac/utils/bottles: Bump to Sorbet typed: strict 2024-08-10 00:21:13 +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
Adrian Ho
3eaebdc9d8
diagnostic: fix XDG_DATA_DIRS check
Pass `XDG_DATA_DIRS` through `bin/brew` so that it can be checked.
2024-08-05 09:11:01 +01:00
Michael Cho
0477944e71
shims/super/cc: pass -ld_classic if needed for -dead_strip_dylibs 2024-08-03 14:46:18 -04:00
Issy Long
9c6430954b
All the extract_to_dirs return void now 2024-07-11 11:05:47 +01:00
Kevin
c3c1528611
Revert "Use cp -c when copying files" 2024-06-17 21:17:10 -07:00
Mike McQuaid
1e0add6d66
Merge pull request #17373 from tesaguri/cp-reflink 2024-06-13 08:57:20 +01:00
Daiki Mizukami
a30cd15a73
extend/os/mac/utils/copy: typed: strict 2024-06-13 06:56:18 +09:00
Daiki Mizukami
028cfe1ea6
Utils::Cp: Rename to Utils::Copy
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#discussion_r1633217748
2024-06-11 20:31:34 +09:00
Daiki Mizukami
eab1e87726
Utils::Cp: Deduplicate SystemCommand invocations 2024-06-09 22:59:24 +09:00
Daiki Mizukami
67f280eb53
Utils::Cp: Add force_system keyword argument
This fixes the test for `UnpackStrategy::Directory`, which needs the
`cp` command.
2024-06-09 07:57:56 +09:00
Daiki Mizukami
9156891c99
Utils::Cp: Use FileUtils.cp on Linux
`FileUtils.cp` is implemented with the lightweight `copy_file_range(2)`
syscall on Linux, so it's more performant than the plain `cp` command on
that platform.

cf. https://github.com/Homebrew/brew/pull/17373#pullrequestreview-2105629022
2024-06-08 20:25:19 +09:00