Skip to content

Commit

Permalink
Warn when using Xcode 8 without CLT on 10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Sep 16, 2016
1 parent 0992951 commit 8a0861f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def development_tools_checks
check_for_installed_developer_tools
check_xcode_license_approved
check_for_osx_gcc_installer
check_xcode_8_without_clt_on_el_capitan
]
end

Expand Down Expand Up @@ -90,6 +91,19 @@ def check_clt_up_to_date
EOS
end

def check_xcode_8_without_clt_on_el_capitan
return unless MacOS::Xcode.without_clt?
# Scope this to Xcode 8 on El Cap for now
return unless MacOS.version == :el_capitan && MacOS::Xcode.version >= "8"

<<-EOS.undent
You have Xcode 8 installed without the CLT;
this causes certain builds to fail on OS X 10.11.
Please install the CLT via:
sudo xcode-select --install
EOS
end

def check_for_osx_gcc_installer
return unless MacOS.version < "10.7" || ((MacOS::Xcode.version || "0") > "4.1")
return unless DevelopmentTools.clang_version == "2.1"
Expand Down
8 changes: 8 additions & 0 deletions Library/Homebrew/test/test_os_mac_diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ def test_check_for_beta_xquartz
MacOS::XQuartz.stubs(:version).returns("2.7.10_beta2")
assert_match "The following beta release of XQuartz is installed: 2.7.10_beta2", @checks.check_for_beta_xquartz
end

def test_check_xcode_8_without_clt_on_el_capitan
MacOS.stubs(:version).returns OS::Mac::Version.new("10.11")
MacOS::Xcode.stubs(:installed?).returns true
MacOS::Xcode.stubs(:version).returns "8.0"
MacOS::Xcode.stubs(:without_clt?).returns true
assert_match "You have Xcode 8 installed without the CLT", @checks.check_xcode_8_without_clt_on_el_capitan
end
end

0 comments on commit 8a0861f

Please sign in to comment.