From 485d4807226594274e90f9c6192e87ee04844393 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 10 Mar 2010 13:29:57 -0800 Subject: [PATCH] Add a snapshot of ENV to BuildError and show some flags with the stack trace. --- Library/Homebrew/global.rb | 6 ++++++ bin/brew | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 9f2211eb60..4e8ae28109 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -60,4 +60,10 @@ class ExecutionError e rescue BuildError => e e.backtrace[1] =~ %r{Library/Formula/(.+)\.rb:(\d+)} formula_name = $1 - puts "http://github.com/mxcl/homebrew/blob/master/Library/Formula/#{formula_name}.rb#L#{$2}" + error_line = $2 + puts "Exit status: #{e.exit_status}" + puts + puts "http://github.com/mxcl/homebrew/blob/master/Library/Formula/#{formula_name}.rb#L#{error_line}" + puts ohai "Environment" dump_config - puts "Exit status: #{e.exit_status}" + puts + ohai "Build Flags" + dump_build_env e.env onoe e puts PLEASE_REPORT_BUG # this feature can be slow (depends on network conditions and if github is up)