From bccd792bbffaf0c219f402d893be4c5c0d284d97 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 5 Nov 2016 10:36:13 -0400 Subject: diagnostic: add checks for minimum Xcode/CLT versions. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Library/Homebrew/extend') diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 0ac95bfd9..883565749 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -104,6 +104,27 @@ module Homebrew EOS end + def check_xcode_minimum_version + return unless MacOS::Xcode.installed? + return unless MacOS::Xcode.minimum_version? + + <<-EOS.undent + Your Xcode (#{MacOS::Xcode.version}) is too outdated. + Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it). + #{MacOS::Xcode.update_instructions} + EOS + end + + def check_clt_minimum_version + return unless MacOS::CLT.installed? + return unless MacOS::CLT.minimum_version? + + <<-EOS.undent + Your Command Line Tools are too outdated. + #{MacOS::CLT.update_instructions} + 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" -- cgit v1.2.3 From 6359c75a2dea3673284bc5f9b00d1ed790469e7b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 5 Nov 2016 10:36:52 -0400 Subject: os/mac/diagnostic: split some unless conditions. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/extend') diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 883565749..6649865ba 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -62,7 +62,8 @@ module Homebrew end def check_xcode_up_to_date - return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated? + return unless MacOS::Xcode.installed? + return unless MacOS::Xcode.outdated? message = <<-EOS.undent Your Xcode (#{MacOS::Xcode.version}) is outdated. @@ -83,7 +84,8 @@ module Homebrew end def check_clt_up_to_date - return unless MacOS::CLT.installed? && MacOS::CLT.outdated? + return unless MacOS::CLT.installed? + return unless MacOS::CLT.outdated? <<-EOS.undent A newer Command Line Tools release is available. @@ -94,7 +96,8 @@ module Homebrew 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" + return unless MacOS.version == :el_capitan + return unless MacOS::Xcode.version >= "8" <<-EOS.undent You have Xcode 8 installed without the CLT; -- cgit v1.2.3 From b38f5b3e7d597fe8fa9611f142ac253b94614c88 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 5 Nov 2016 10:38:39 -0400 Subject: diagnostic: only make minimum Xcode/CLT version checks fatal. Also: freeze the relevant arrays. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Library/Homebrew/extend') diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 6649865ba..a60dd2d05 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -10,19 +10,18 @@ module Homebrew check_xcode_license_approved check_for_osx_gcc_installer check_xcode_8_without_clt_on_el_capitan - ] + check_xcode_up_to_date + check_clt_up_to_date + check_for_other_package_managers + ].freeze end def fatal_development_tools_checks - if MacOS.version >= :sierra && ENV["CI"].nil? - %w[ - check_xcode_up_to_date - check_clt_up_to_date - ] - else - %w[ - ] - end + %w[ + check_xcode_minimum_version + check_clt_minimum_version + ].freeze + end end def check_for_unsupported_macos -- cgit v1.2.3 From 262eaca56e9efbb21a20be2fe83af563c9b9289e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 5 Nov 2016 10:39:00 -0400 Subject: diagnostic: add build error checks. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Library/Homebrew/extend') diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index a60dd2d05..0f37e8af5 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -22,6 +22,11 @@ module Homebrew check_clt_minimum_version ].freeze end + + def build_error_checks + (development_tools_checks + %w[ + check_for_unsupported_macos + ]).freeze end def check_for_unsupported_macos -- cgit v1.2.3 From 1f6c26a2e4b97ad90e6b8623df90daf4e07086a9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 5 Nov 2016 16:13:42 -0400 Subject: software_spec: no `_or_later` in bottle filenames. It's more useful to be able to "bless" an existing bottle to be used on later OSs (e.g. where it cannot yet be built) than it is to have to create a new, identical bottle just to have a different filename. --- Library/Homebrew/extend/os/mac/utils/bottles.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'Library/Homebrew/extend') diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb index 0dd7341ea..18312c9fa 100644 --- a/Library/Homebrew/extend/os/mac/utils/bottles.rb +++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb @@ -38,7 +38,6 @@ module Utils # Allows a bottle tag to specify a specific OS or later, # so the same bottle can target multiple OSs. - # Not used in core, used in taps. def find_or_later_tag(tag) begin tag_version = MacOS::Version.from_symbol(tag) -- cgit v1.2.3