diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2841618538..2d25d248b7 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -205,6 +205,12 @@ class Formula onoe e.inspect puts e.backtrace ohai "Rescuing build..." + if (e.was_running_configure? rescue false) and File.exist? 'config.log' + puts "It looks like an autotools configure failed." + puts "Gist 'config.log' and any error output when reporting an issue." + puts + end + puts "When you exit this shell Homebrew will attempt to finalise the installation." puts "If nothing is installed or the shell exits with a non-zero error code," puts "Homebrew will abort. The installation prefix is:" diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index cb889bbb31..06cca3859c 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -44,13 +44,18 @@ RECOMMENDED_GCC_42 = (MACOS_VERSION >= 10.6) ? 5646 : 5577 class ExecutionError e + assert e.was_running_configure? + end + end +end + + class InstallTests < Test::Unit::TestCase def temporary_install f # Brew and install the given formula diff --git a/Library/Homebrew/test/testball.rb b/Library/Homebrew/test/testball.rb index 6393342e59..58af9d2b74 100644 --- a/Library/Homebrew/test/testball.rb +++ b/Library/Homebrew/test/testball.rb @@ -12,3 +12,18 @@ class TestBall e # then replace that string with the following when the github api returns issues = issues_for_formula(formula_name) puts "These existing issues may help you:", *issues unless issues.empty? + if e.was_running_configure? + puts "It looks like an autotools configure failed." + puts "Consider re-running the install with '-vd' to keep 'config.log' around:" + puts " brew install -vd formula_name" + puts "Gist 'config.log' and any error output when reporting an issue." + end + puts puts "Consider running `brew doctor` if a large number of installs are failing." exit 1 rescue RuntimeError, SystemCallError => e