From 5cc1e95be3f552b907b3f5cfc2d1d79907087273 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 30 Dec 2014 06:13:33 +0000 Subject: [PATCH] fiddle: append libffi config.log * ext/fiddle/extconf.rb: copy config.log of libffi when failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/fiddle/extconf.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb index f505a280ad..a05eccf008 100644 --- a/ext/fiddle/extconf.rb +++ b/ext/fiddle/extconf.rb @@ -78,8 +78,14 @@ begin FileUtils.rm_f("#{libffi.include}/ffitarget.h") Logging::open do Logging.message("%p in %p\n", args, opts) - system(*args, **opts) or + unless system(*args, **opts) + begin + IO.copy_stream(libffi.dir + "/config.log", Logging.instance_variable_get(:@logfile)) + rescue SystemCallError => e + Logfile.message("%s\n", e.message) + end raise "failed to configure libffi. Please install libffi." + end end if $mswin && File.file?("#{libffi.include}/ffitarget.h") FileUtils.rm_f("#{libffi.include}/ffitarget.h")