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

ruby-changes:52734

From: k0kubun <ko1@a...>
Date: Mon, 8 Oct 2018 00:10:05 +0900 (JST)
Subject: [ruby-changes:52734] k0kubun:r64945 (trunk): mjit_worker.c: clean up all unnecessary files on mswin

k0kubun	2018-10-08 00:09:58 +0900 (Mon, 08 Oct 2018)

  New Revision: 64945

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

  Log:
    mjit_worker.c: clean up all unnecessary files on mswin
    
    test_jit.rb: passed all MJIT tests.

  Modified files:
    trunk/mjit_worker.c
    trunk/test/ruby/test_jit.rb
Index: mjit_worker.c
===================================================================
--- mjit_worker.c	(revision 64944)
+++ mjit_worker.c	(revision 64945)
@@ -756,8 +756,16 @@ compile_c_to_so(const char *c_file, cons https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L756
     free(args);
 
     if (exit_code == 0) {
-        /* remove never-used .obj file. XXX: Is there any way not to generate this? */
-        if (!mjit_opts.save_temps) remove_file(obj_file);
+        /* remove never-used files (.obj, .lib, .exp, .pdb). XXX: Is there any way not to generate this? */
+        if (!mjit_opts.save_temps) {
+            char *before_dot;
+            remove_file(obj_file);
+
+            before_dot = obj_file + strlen(obj_file) - rb_strlen_lit(".obj");
+            append_lit(before_dot, ".lib"); remove_file(obj_file);
+            append_lit(before_dot, ".exp"); remove_file(obj_file);
+            append_lit(before_dot, ".pdb"); remove_file(obj_file);
+        }
     }
     else {
         verbose(2, "compile_c_to_so: compile error: %d", exit_code);
Index: test/ruby/test_jit.rb
===================================================================
--- test/ruby/test_jit.rb	(revision 64944)
+++ test/ruby/test_jit.rb	(revision 64945)
@@ -552,7 +552,6 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L552
   end
 
   def test_unload_units
-    skip_on_mswin
     Dir.mktmpdir("jit_test_unload_units_") do |dir|
       # MIN_CACHE_SIZE is 10
       out, err = eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~'end;'}", verbose: 1, min_calls: 1, max_cache: 10)
@@ -717,7 +716,6 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L716
   end
 
   def test_clean_so
-    skip_on_mswin
     Dir.mktmpdir("jit_test_clean_so_") do |dir|
       code = "x = 0; 10.times {|i|x+=i}"
       eval_with_jit({"TMPDIR"=>dir}, code)
@@ -797,13 +795,6 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L795
 
   private
 
-  # Some tests are stil failing on VC++.
-  def skip_on_mswin
-    if RUBY_PLATFORM.match?(/mswin/)
-      skip 'This test does not succeed on mswin yet.'
-    end
-  end
-
   def skip_on_mingw
     if RUBY_PLATFORM.match?(/mingw/)
       skip 'This test does not succeed on mingw yet.'

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

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