Concise --config output for build errors
Rationale, lets only pay attention to the output when it matters. Speeding up diagnosis.
This commit is contained in:
parent
6c0950999f
commit
2c84be96d8
@ -76,14 +76,41 @@ module Homebrew extend self
|
|||||||
Pathname.new(a_path).realpath.to_s
|
Pathname.new(a_path).realpath.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def hardware
|
||||||
|
"CPU: #{Hardware.cores_as_words}-core #{Hardware.bits}-bit #{Hardware.intel_family}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def kernel
|
||||||
|
`uname -m`.chomp
|
||||||
|
end
|
||||||
|
|
||||||
|
# we try to keep output minimal
|
||||||
|
def dump_build_config
|
||||||
|
puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" if HOMEBREW_PREFIX.to_s != "/usr/local"
|
||||||
|
puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar"
|
||||||
|
puts hardware
|
||||||
|
puts "MacOS: #{MACOS_FULL_VERSION}-#{kernel}"
|
||||||
|
puts "Xcode: #{xcode_version}"
|
||||||
|
puts "/usr/bin/ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8
|
||||||
|
|
||||||
|
ruby = Pathname.new("/usr/bin/ruby")
|
||||||
|
puts "/usr/bin/ruby => #{ruby.realpath}" unless ruby.realpath.to_s =~ %r{^/System}
|
||||||
|
|
||||||
|
ponk = macports_or_fink_installed?
|
||||||
|
puts "MacPorts/Fink: #{ponk?}" if ponk
|
||||||
|
|
||||||
|
x11 = describe_x11
|
||||||
|
puts "X11: #{x11}" unless x11 == "/usr/X11"
|
||||||
|
end
|
||||||
|
|
||||||
def config_s; <<-EOS.undent
|
def config_s; <<-EOS.undent
|
||||||
HOMEBREW_VERSION: #{HOMEBREW_VERSION}
|
HOMEBREW_VERSION: #{HOMEBREW_VERSION}
|
||||||
HEAD: #{sha}
|
HEAD: #{sha}
|
||||||
HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}
|
HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}
|
||||||
HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}
|
HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}
|
||||||
Hardware: #{Hardware.cores_as_words}-core #{Hardware.bits}-bit #{Hardware.intel_family}
|
#{hardware}
|
||||||
OS X: #{MACOS_FULL_VERSION}
|
OS X: #{MACOS_FULL_VERSION}
|
||||||
Kernel Architecture: #{`uname -m`.chomp}
|
Kernel Architecture: #{kernel}
|
||||||
Xcode: #{xcode_version}
|
Xcode: #{xcode_version}
|
||||||
GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"}
|
GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"}
|
||||||
GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"}
|
GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"}
|
||||||
|
@ -98,17 +98,17 @@ class BuildError < Homebrew::InstallationError
|
|||||||
issues_url = ISSUES_URL
|
issues_url = ISSUES_URL
|
||||||
end
|
end
|
||||||
|
|
||||||
ohai "Exit Status: #{e.exit_status}"
|
if ARGV.verbose?
|
||||||
puts "https://github.com/#{repo}/blob/master/#{repo_path}/#{formula_name}.rb#L#{error_line}"
|
ohai "Exit Status: #{e.exit_status}"
|
||||||
ohai "Environment"
|
puts "https://github.com/#{repo}/blob/master/#{repo_path}/#{formula_name}.rb#L#{error_line}"
|
||||||
puts Homebrew.config_s
|
end
|
||||||
ohai "Build Flags"
|
ohai "Build Environment"
|
||||||
|
Homebrew.dump_build_config
|
||||||
puts %["--use-clang" was specified] if ARGV.include? '--use-clang'
|
puts %["--use-clang" was specified] if ARGV.include? '--use-clang'
|
||||||
puts %["--use-llvm" was specified] if ARGV.include? '--use-llvm'
|
puts %["--use-llvm" was specified] if ARGV.include? '--use-llvm'
|
||||||
puts %["--use-gcc" was specified] if ARGV.include? '--use-gcc'
|
puts %["--use-gcc" was specified] if ARGV.include? '--use-gcc'
|
||||||
Homebrew.dump_build_env e.env
|
Homebrew.dump_build_env e.env
|
||||||
puts
|
onoe "#{e.to_s.strip} (#{formula_name}.rb:#{error_line})"
|
||||||
onoe e
|
|
||||||
issues = GitHub.issues_for_formula formula_name
|
issues = GitHub.issues_for_formula formula_name
|
||||||
if issues.empty?
|
if issues.empty?
|
||||||
puts "If `brew doctor' does not help diagnose the issue, please report the bug:"
|
puts "If `brew doctor' does not help diagnose the issue, please report the bug:"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user