-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add brew doctor --ignore-warnings
#17864
Conversation
When `brew doctor` is run, `brew` exits with a non-zero status if any warnings or errors are encountered. However, this groups warnings and errors together, but (as the output notes) warnings can be innocuous: > 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! The `--ignore-warnings` switch makes it possible for automated tools interacting with Homebrew to distinguish between warnings and hard errors. ``` $ brew doctor --ignore-warnings 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: Some installed casks are deprecated or disabled. You should find replacements for the following casks: graphql-playground $ echo "$?" 0 ``` Hard errors will still cause a non-zero exit status: ``` $ brew doctor --ignore-warnings 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: gettext files detected at a system prefix. These files can cause compilation and link failures, especially if they are compiled with improper architectures. Consider removing these files: /opt/homebrew/lib/libgettextlib.dylib /opt/homebrew/lib/libintl.dylib /opt/homebrew/include/libintl.h Error: unknown or unsupported macOS version: :dunno $ echo "$?" 1 ```
c5d26dd
to
ab56cff
Compare
There is no distinction in Automated tools should either avoid running
This is not a |
I understand that (although perhaps it should be a |
How are you triggering this error? It seems like you're on an unknown macOS version? |
I maintain a developer environment bootstrapping tool which (among other things) installs Homebrew and then PostgreSQL with Homebrew. I'm working on a feature to upgrade the PostgreSQL installation. However, we only use Homebrew for PostgreSQL, so developers rarely update it on their own. As a result, we have a bunch of engineers running macOS Sonoma with versions of Homebrew too old to support macOS Sonoma. I can solve this with Ideally, I'd also like to catch any other show-stopper errors with the Homebrew installation, and I was hoping I could use |
BTW I appreciate you taking the time to talk this over! I would've included more context in the original PR description but I thought the feature was uncontroversial enough that it wasn't warranted. |
That error isn't an intentional from You could try |
Sorry, passing on this PR but hopefully @Bo98's suggested workaround is useful. |
@Bo98 Thanks, |
When
brew doctor
is run,brew
exits with a non-zero status if any warnings or errors are encountered. However, this groups warnings and errors together, but (as the output notes) warnings can be innocuous:The
--ignore-warnings
switch makes it possible for automated tools interacting with Homebrew to distinguish between warnings and hard errors.Hard errors will still cause a non-zero exit status:
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?