From b36f59dd3c8a3bf95eeb715e3fdd05bce2ccdc75 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 18 Mar 2012 13:58:13 -0500 Subject: New fails_with infrastructure - Formulae can now declare failures on any compiler. - FailsWithLLVM and associated formula elements have been moved to compat. Signed-off-by: Jack Nagel --- Library/Homebrew/formula_support.rb | 58 ------------------------------------- 1 file changed, 58 deletions(-) (limited to 'Library/Homebrew/formula_support.rb') diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index df98f3cb4..3bda65dcd 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -69,61 +69,3 @@ EOS end end end - - -# Used to annotate formulae that won't build correctly with LLVM. -class FailsWithLLVM - attr_reader :msg, :data, :build - - def initialize msg=nil, data=nil - if msg.nil? or msg.kind_of? Hash - @msg = "(No specific reason was given)" - data = msg - else - @msg = msg - end - @data = data - @build = data.delete :build rescue nil - end - - def reason - s = @msg - s += "Tested with LLVM build #{@build}" unless @build == nil - s += "\n" - return s - end - - def handle_failure - return unless ENV.compiler == :llvm - - # version 2336 is the latest version as of Xcode 4.2, so it is the - # latest version we have tested against so we will switch to GCC and - # bump this integer when Xcode 4.3 is released. TODO do that! - if build.to_i >= 2336 - if MacOS.xcode_version < "4.2" - opoo "Formula will not build with LLVM, using GCC" - ENV.gcc - else - opoo "Formula will not build with LLVM, trying Clang" - ENV.clang - end - return - end - opoo "Building with LLVM, but this formula is reported to not work with LLVM:" - puts - puts reason - puts - puts <<-EOS.undent - We are continuing anyway so if the build succeeds, please open a ticket with - the following information: #{MacOS.llvm_build_version}-#{MACOS_VERSION}. So - that we can update the formula accordingly. Thanks! - EOS - puts - if MacOS.xcode_version < "4.2" - puts "If it doesn't work you can: brew install --use-gcc" - else - puts "If it doesn't work you can try: brew install --use-clang" - end - puts - end -end -- cgit v1.2.3