Skip to content

Commit

Permalink
Provides a config option to ignore warnings about Xcode being outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
ctaintor committed Oct 5, 2024
1 parent 84c3117 commit 5f4a8bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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,
},
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"]

# 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

0 comments on commit 5f4a8bd

Please sign in to comment.