aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-12-30 23:47:07 -0500
committerJack Nagel2014-12-30 23:47:07 -0500
commitaccd72b2907b4a098bad01dad53304b880a03532 (patch)
tree80e17718c4402697c788bce0408601e4e1d600e1 /Library
parent77c0f60434aa9c51ef5b052a43a200ea2b39f04f (diff)
downloadbrew-accd72b2907b4a098bad01dad53304b880a03532.tar.bz2
Log build environment on failure
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/--env.rb4
-rw-r--r--Library/Homebrew/formula.rb12
2 files changed, 12 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/--env.rb b/Library/Homebrew/cmd/--env.rb
index 28bdb4f3d..803654635 100644
--- a/Library/Homebrew/cmd/--env.rb
+++ b/Library/Homebrew/cmd/--env.rb
@@ -30,7 +30,7 @@ module Homebrew
ACLOCAL_PATH PATH CPATH].select { |key| env.key?(key) }
end
- def dump_build_env env
+ def dump_build_env env, f=$stdout
keys = build_env_keys(env)
keys -= %w[CC CXX OBJC OBJCXX] if env["CC"] == env["HOMEBREW_CC"]
@@ -41,7 +41,7 @@ module Homebrew
when "CC", "CXX", "LD"
s << " => #{Pathname.new(value).realpath}" if File.symlink?(value)
end
- puts s
+ f.puts s
end
end
end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index a4a7a4cff..143aeb191 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -686,9 +686,17 @@ class Formula
log.flush
Kernel.system "/usr/bin/tail", "-n", "5", logfn unless verbose
log.puts
- require 'cmd/config'
+
+ require "cmd/config"
+ require "cmd/--env"
+
+ env = ENV.to_hash
+
Homebrew.dump_verbose_config(log)
- raise BuildError.new(self, cmd, args, ENV.to_hash)
+ log.puts
+ Homebrew.dump_build_env(env, log)
+
+ raise BuildError.new(self, cmd, args, env)
end
ensure
log.close