[前][次][番号順一覧][スレッド一覧]

ruby-changes:50134

From: k0kubun <ko1@a...>
Date: Tue, 6 Feb 2018 22:47:09 +0900 (JST)
Subject: [ruby-changes:50134] k0kubun:r62252 (trunk): transform_mjit_header.rb: add output for debug

k0kubun	2018-02-06 22:47:02 +0900 (Tue, 06 Feb 2018)

  New Revision: 62252

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62252

  Log:
    transform_mjit_header.rb: add output for debug
    
    AIX's header build is failing like:
    
    ./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "/usr/bin/gcc " rb_mjit_header.h .ext/include/powerpc-aix7.1.3.0/rb_mjit_min_header-2.6.0.h
    error in initial header file:
    /home/odaira/chkbuild/tmp/build/20180206T113302Z/tmp/20180206-15335556-aaiego.c:19:59: error: conflicting types for 'restrict'
     extern size_t fread(void *restrict, size_t, size_t, FILE *restrict);
                                                               ^
    
    https://rubyci.org/logs/rubyci.s3.amazonaws.com/aix71_ppc/ruby-trunk/log/20180206T113302Z.log.html.gz#make
    
    It's so hard to know the cause from current output. Let me add debug
    output and see tomorrow's CI result.

  Modified files:
    trunk/tool/transform_mjit_header.rb
Index: tool/transform_mjit_header.rb
===================================================================
--- tool/transform_mjit_header.rb	(revision 62251)
+++ tool/transform_mjit_header.rb	(revision 62252)
@@ -83,9 +83,14 @@ module MJITHeader https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L83
       f.close
       cmd = "#{cc} #{cflags} #{f.path}"
       unless system(cmd, err: File::NULL)
-        STDERR.puts "error in #{stage} header file:"
-        system(cmd)
-        exit false
+        out = IO.popen(cmd, err: [:child, :out], &:read)
+        STDERR.puts "error in #{stage} header file:\n#{out}"
+
+        if match = out.match(/error: conflicting types for '(?<name>[^']+)'/)
+          unless (related_lines = code.lines.grep(/#{match[:name]}/)).empty?
+            STDERR.puts "possibly related lines:\n#{related_lines.join("\n")}"
+          end
+        end
       end
     end
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]