diff options
| author | Adam Vandenberg | 2010-03-10 13:29:57 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2010-03-11 15:58:17 -0800 |
| commit | 485d4807226594274e90f9c6192e87ee04844393 (patch) | |
| tree | 88f85bd0c94e0b406b0603415876427cb4009287 | |
| parent | 07934ce3ab72a1b677609aeb5595f0de5e7de335 (diff) | |
| download | brew-485d4807226594274e90f9c6192e87ee04844393.tar.bz2 | |
Add a snapshot of ENV to BuildError and show some flags with the stack trace.
| -rw-r--r-- | Library/Homebrew/global.rb | 6 | ||||
| -rwxr-xr-x | bin/brew | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 9f2211eb6..4e8ae2810 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -60,4 +60,10 @@ class ExecutionError <RuntimeError end class BuildError <ExecutionError + attr :env + + def initialize cmd, args = [], es = nil + super + @env = ENV.to_hash + end end @@ -66,6 +66,12 @@ X11 installed? #{x11_installed?} EOS end +def dump_build_env env + %w[CC CXX LD CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MAKEFLAGS].each do |k| + puts "#{k}: #{env[k]}" + end +end + begin require 'brew.h' @@ -374,10 +380,16 @@ rescue Interrupt => 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) |
