35 Commits

Author SHA1 Message Date
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
botantony
4b62b9d2c5
fix: ignore broken kegs during gcc linkage test
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-03-18 11:00:14 +01:00
Carlo Cabrera
343eac915b
os/linux/diagnostic: skip error on arm64 when HOMEBREW_ARM64_TESTING is set
This[^1] will enable us to start testing arm64 bottle builds in
Homebrew/core when this environment variable is set.

[^1]: Along with some tweaks to the `dispatch-build-bottle` workflow.
2025-03-17 20:52:12 +08:00
Mike McQuaid
f5b211efaa
os/linux/diagnostic: remove XDG_DATA_DIRS. 2024-10-31 12:43:36 +00:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07:00
Michael Cho
1dbedddc58
diagnostic: check for strings in XDG_DATA_DIRS 2024-08-17 21:59:49 -04: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
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
Markus Reiter
38695f96c7
Don't use deprecated Kernel#shell_profile. 2023-04-14 21:14:44 +02:00
Douglas Eichelberger
4df5a80c73 brew style --fix 2023-04-02 12:25:55 -07:00
Douglas Eichelberger
0079cefc95 Enable types in remaining untyped extensions 2023-04-02 12:24:11 -07:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Carlo Cabrera
ab696cbbb7
linux/diagnostic: fix rpath returning nil.
Fixes #13762.

There's still a bug in the GCC linkage check, but I'll need a bit more
time to work on a fix. This at least makes sure `brew doctor` will not
return the error in the issue linked above.
2022-08-26 22:23:02 +08:00
Carlo Cabrera
fec5b4080a
linux/diagnostic: add check for versioned GCC linkage
This complements my other two GCC-on-Linux PRs (#13631, #13633), however
they are both reliant on bottles eventually being (re-)poured.

Let's try to speed that up by returning an error message from `brew doctor`
whenever a user has formulae installed that would benefit from a `brew reinstall`.
2022-08-03 20:54:16 +08:00
Caleb Xu
d9780bd260
diagnostic: skip linuxbrew-core tap check when installing from API 2022-03-28 14:59:32 -04:00
Mike McQuaid
0118e6ec41
Apply suggestions from code review
Co-authored-by: Xuehai Pan <XuehaiPan@outlook.com>
2021-10-21 15:10:17 +01:00
Mike McQuaid
eb1b244fd2
update-report: better handle user set bottle domain, core git remote.
Unset these variables and print a warning if they were set to
non-default values.
2021-10-21 15:01:58 +01:00
Michka Popoff
1cc7ca33c0
update: migrate everyone from linuxbrew-core to homebrew-core
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-20 11:01:38 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
e024b12d47 Remove os/linux/diagnostic. 2020-08-24 00:22:17 +02:00
Seeker
3379e3b5cf os: add kernel_version 2020-08-19 11:41:30 -07:00
Shaun Jackman
db361e29b8 check_tmpdir_executable: Remove stray undent
Fix the error:
Error: undefined method undent for #<String>
.../extend/os/linux/diagnostic.rb:41:in check_tmpdir_executable
2020-08-17 11:54:42 -07:00
Jonathan Chang
57109a175a diagnostic: add doctor check for CPU arch on Linux
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-03-13 11:39:27 +11:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Shaun Jackman
eeed04fdad diagnostic: Fix check_xdg_data_dirs for Linux
Fix Error: undefined method prepend_variable_in_profile'
for Utils::Shell:Module Did you mean? prepend_path_in_profile
2019-02-21 10:06:33 -08:00
Mike McQuaid
3a0e0dca36
Output more warnings on unsupported configurations 2019-01-21 13:58:03 +00:00
Jonathan Chang
76d7b586ce diagnostic: check kernel, glibc versions [Linux] 2019-01-01 16:10:43 -08:00
nvg
0ca61d55ae Check if umask is 000 in brew doctor 2018-11-02 17:02:47 -07:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
955214abc0
Use ActiveSupport Object#blank? and #present? 2018-09-14 17:02:19 +01:00
Shaun Jackman
4adbfa3fcf Check that HOMEBREW_TEMP permits executing programs 2018-08-14 11:51:18 -07:00
Maxim Belkin
e5435dfeb7
Cross-platform diagnostics. 2018-05-14 04:44:15 -05:00