summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-19 14:05:26 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-19 14:05:26 +0000
commit826f16d46581f9a66eeb5902b4f2f6e9f950ada0 (patch)
tree74afa2c9ec9ef93f6003f533aa250c8b6d3f7808 /ext
parentcd8f9904427e6db858a4dcc1dabff60a76cad445 (diff)
downloadruby-826f16d46581f9a66eeb5902b4f2f6e9f950ada0.tar.gz
extmk.rb: improve message printed when configuring extensions fails
Point to the mkmf.log if configuring an extension fails so that people can find and fix the culprit easily. [ruby-core:80131] [Feature #13302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rwxr-xr-xext/extmk.rb37
1 files changed, 18 insertions, 19 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 4317a2a8a3..3b19b05309 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -222,7 +222,6 @@ def extmake(target, basedir = 'ext', maybestatic = true)
rescue SystemExit
# ignore
rescue => error
- lineno = error.backtrace_locations[0].lineno
ok = false
ensure
rm_f "conftest*"
@@ -238,18 +237,16 @@ def extmake(target, basedir = 'ext', maybestatic = true)
return true if !error and target.start_with?("-")
- if parent
- message = "Failed to configure #{target}. It will not be installed."
- else
- message = "Skipped to configure #{target}. Its parent is not configured."
- end
- if Logging.log_opened?
- Logging::message(error.to_s) if error
- Logging::message(message)
+ message = nil
+ if error
+ loc = error.backtrace_locations[0]
+ message = "#{loc.absolute_path}:#{loc.lineno}: #{error.message}"
+ if Logging.log_opened?
+ Logging::message("#{message}\n\t#{error.backtrace.join("\n\t")}\n")
+ end
end
- message = error.message if error
- return parent ? [conf, lineno||0, message] : true
+ return [parent, message]
end
args = $mflags
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
@@ -560,7 +557,7 @@ exts.each do |d|
if !$nodynamic or $static
result = extmake(d, ext_prefix, !@gemname) or abort
extso |= $extso
- fails << result unless result == true
+ fails << [d, result] unless result == true
end
end
@@ -719,15 +716,17 @@ begin
mf.puts "\n""note:\n"
unless fails.empty?
- mf.puts %Q<\t@echo "*** Following extensions failed to configure:">
- fails.each do |d, n, err|
- d = "#{d}:#{n}:"
- if err
- err.scan(/.+/) do |ee|
- mf.puts %Q<\t@echo "#{d} #{ee.gsub(/["`$^]/, '\\\\\\&')}">
+ mf.puts %Q<\t@echo "*** Following extensions are not compiled:">
+ fails.each do |ext, (parent, err)|
+ mf.puts %Q<\t@echo "#{ext}:">
+ if parent
+ mf.puts %Q<\t@echo "\tCould not be configured. It will not be installed.">
+ err&.scan(/.+/) do |ee|
+ mf.puts %Q<\t@echo "\t#{ee.gsub(/["`$^]/, '\\\\\\&')}">
end
+ mf.puts %Q<\t@echo "\tCheck #{ext_prefix}/#{ext}/mkmf.log for more details.">
else
- mf.puts %Q<\t@echo "#{d}">
+ mf.puts %Q<\t@echo "\tSkipped because its parent was not configured.">
end
end
mf.puts %Q<\t@echo "*** Fix the problems, then remove these directories and try again if you want.">