Diagnostic: require CLT headers on 10.14

This commit is contained in:
Misty De Meo 2018-06-12 14:30:51 -07:00
parent 95e3754b95
commit e5212d74a6
2 changed files with 25 additions and 0 deletions

View File

@ -20,6 +20,7 @@ module Homebrew
check_xcode_minimum_version
check_clt_minimum_version
check_if_xcode_needs_clt_installed
check_if_clt_needs_headers_installed
].freeze
end
@ -135,6 +136,17 @@ module Homebrew
EOS
end
def check_if_clt_needs_headers_installed
return unless MacOS::CLT.separate_header_package?
return if MacOS::CLT.headers_installed?
<<~EOS
The Command Line Tools header package must be installed on #{MacOS.version.pretty_name}.
The installer is located at:
#{MacOS::CLT::HEADER_PKG_PATH.sub(":macos_version", MacOS.version)}
EOS
end
def check_for_other_package_managers
ponk = MacOS.macports_or_fink
return if ponk.empty?

View File

@ -32,6 +32,19 @@ describe Homebrew::Diagnostic::Checks do
.to match("Xcode alone is not sufficient on El Capitan")
end
specify "#check_if_clt_needs_headers_installed" do
allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.14"))
allow(MacOS::CLT).to receive(:installed?).and_return(true)
allow(MacOS::CLT).to receive(:headers_installed?).and_return(false)
expect(subject.check_if_clt_needs_headers_installed)
.to match("The Command Line Tools header package must be installed on Mojave.")
allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.13"))
expect(subject.check_if_clt_needs_headers_installed)
.to be_nil
end
specify "#check_homebrew_prefix" do
# the integration tests are run in a special prefix
expect(subject.check_homebrew_prefix)