Make CompilerSelectionError an InstallationError
Fixes Homebrew/homebrew#19962.
This commit is contained in:
parent
fa5b633650
commit
65a00e213b
@ -73,7 +73,7 @@ class CompilerSelector
|
||||
end while @f.fails_with?(cc)
|
||||
|
||||
if cc.nil?
|
||||
raise CompilerSelectionError
|
||||
raise CompilerSelectionError.new(@f)
|
||||
else
|
||||
cc.name
|
||||
end
|
||||
|
||||
@ -218,9 +218,10 @@ end
|
||||
|
||||
# raised by CompilerSelector if the formula fails with all of
|
||||
# the compilers available on the user's system
|
||||
class CompilerSelectionError < StandardError
|
||||
def message; <<-EOS.undent
|
||||
This formula cannot be built with any available compilers.
|
||||
class CompilerSelectionError < Homebrew::InstallationError
|
||||
def initialize f
|
||||
super f, <<-EOS.undent
|
||||
#{f.name} cannot be built with any available compilers.
|
||||
To install this formula, you may need to:
|
||||
brew install apple-gcc42
|
||||
EOS
|
||||
|
||||
@ -116,11 +116,7 @@ module SharedEnvExtension
|
||||
# If no valid compiler is found, raises an exception.
|
||||
def validate_cc!(formula)
|
||||
if formula.fails_with? ENV.compiler
|
||||
begin
|
||||
send CompilerSelector.new(formula).compiler
|
||||
rescue CompilerSelectionError => e
|
||||
raise e.message
|
||||
end
|
||||
send CompilerSelector.new(formula).compiler
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user