ruby-changes:60990
From: Takashi <ko1@a...>
Date: Sun, 3 May 2020 16:37:12 +0900 (JST)
Subject: [ruby-changes:60990] e0c023d1c8 (master): Skip only .dSYM cleanup on macOS
https://git.ruby-lang.org/ruby.git/commit/?id=e0c023d1c8 From e0c023d1c8a22533b6cd3a5fa4bbcd4145f635b5 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sun, 3 May 2020 00:33:56 -0700 Subject: Skip only .dSYM cleanup on macOS Fix https://github.com/ruby/ruby/runs/636020145 without skipping too many tests. It seems that .c -> .o with debug flags and .o -> .so without debug flags did not generate .dSYM but now .c -> .so with debug flags seems to generate a .dSYM directory. As --jit-debug should not be used by normal users, let me skip implementing the removal for now. diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index a5d5fb4..af96a78 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -720,7 +720,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L720 skip 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.' else # verify .c files are deleted on unload_units - assert_send([Dir, :empty?, dir], debug_info) + assert_send([Dir, :empty?, dir], debug_info) unless leave_dsym? end end end @@ -939,7 +939,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L939 Dir.mktmpdir("jit_test_clean_so_") do |dir| code = "x = 0; 10.times {|i|x+=i}" eval_with_jit({"TMPDIR"=>dir}, code) - assert_send([Dir, :empty?, dir]) + assert_send([Dir, :empty?, dir]) unless leave_dsym? eval_with_jit({"TMPDIR"=>dir}, code, save_temps: true) assert_not_send([Dir, :empty?, dir]) end @@ -957,7 +957,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L957 exec "true" end; error_message = "Undeleted files:\n #{Dir.glob("#{dir}/*").join("\n ")}\n" - assert_send([Dir, :empty?, dir], error_message) + assert_send([Dir, :empty?, dir], error_message) unless leave_dsym? end end @@ -1083,7 +1083,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L1083 assert_equal("Successful MJIT finish\n" * 2, err.gsub(/^#{JIT_SUCCESS_PREFIX}:[^\n]+\n/, ''), debug_info) # ensure objects are deleted - assert_send([Dir, :empty?, dir], debug_info) + assert_send([Dir, :empty?, dir], debug_info) unless leave_dsym? end end if defined?(fork) @@ -1178,4 +1178,10 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L1178 end insns end + + # `clang -g` on macOS creates a .dSYM file. Because it's only created on --jit-debug, + # we're ignoring it for now. TODO: remove .dSYM file + def leave_dsym? + /darwin/ =~ RUBY_PLATFORM && @jit_debug + end end diff --git a/test/ruby/test_jit_debug.rb b/test/ruby/test_jit_debug.rb index 0d357ee..179512f 100644 --- a/test/ruby/test_jit_debug.rb +++ b/test/ruby/test_jit_debug.rb @@ -5,7 +5,6 @@ return if ENV.key?('APPVEYOR') https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit_debug.rb#L5 return if ENV.key?('RUBYCI_NICKNAME') return if ENV['RUBY_DEBUG']&.include?('ci') # ci.rvm.jp return if /mswin/ =~ RUBY_PLATFORM -return if /darwin/ =~ RUBY_PLATFORM # TODO: remove this after investigation class TestJITDebug < TestJIT def setup -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/