Skip to content
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

Provides a config option to ignore warnings about Xcode being outdated #18509

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Library/Homebrew/cmd/doctor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class Doctor < AbstractCommand
def run
Homebrew.inject_dump_stats!(Diagnostic::Checks, /^check_*/) if args.audit_debug?

# While it is probably OK to run an outdated Xcode for normal operations,
# it's good to know if we have an outdated Xcode when running `brew doctor`.
ENV.delete("HOMEBREW_NO_WARN_OUTDATED_XCODE")

checks = Diagnostic::Checks.new(verbose: args.verbose?)

if args.list_checks?
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/env_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ module EnvConfig
"from homebrew-core.",
boolean: true,
},
HOMEBREW_NO_WARN_OUTDATED_XCODE: {
description: "If set, Homebrew will not warn about using outdated (but still compatible) Xcode versions.",
boolean: true,
},
Comment on lines +400 to +403
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined not to document this at all:

Suggested change
HOMEBREW_NO_WARN_OUTDATED_XCODE: {
description: "If set, Homebrew will not warn about using outdated (but still compatible) Xcode versions.",
boolean: true,
},

in which case you should ignore my other suggestion about Homebrew::EnvConfig (since that relies on the env variable being in env_config.rb).

HOMEBREW_PIP_INDEX_URL: {
description: "If set, `brew install` <formula> will use this URL to download PyPI package resources.",
default_text: "`https://pypi.org/simple`.",
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def check_xcode_up_to_date
# Homebrew/brew is currently using.
return if GitHub::Actions.env_set?

return if ENV["HOMEBREW_NO_WARN_OUTDATED_XCODE"]
ctaintor marked this conversation as resolved.
Show resolved Hide resolved

# With fake El Capitan for Portable Ruby, we are intentionally not using Xcode 8.
# This is because we are not using the CLT and Xcode 8 has the 10.12 SDK.
return if ENV["HOMEBREW_FAKE_MACOS"]
Expand Down
Loading