ruby-changes:51371
From: normal <ko1@a...>
Date: Wed, 6 Jun 2018 06:19:36 +0900 (JST)
Subject: [ruby-changes:51371] normal:r63577 (trunk): test/dtrace/helper: fix check for miniruby
normal 2018-06-06 06:19:31 +0900 (Wed, 06 Jun 2018) New Revision: 63577 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63577 Log: test/dtrace/helper: fix check for miniruby RbConfig::TOPDIR points to my installation prefix on my FreeBSD and GNU/Linux systems, so there's no way miniruby exists, there. In case we don't have miniruby, --disable=gems anyways to reduce dtrace overhead. Modified files: trunk/test/dtrace/helper.rb Index: test/dtrace/helper.rb =================================================================== --- test/dtrace/helper.rb (revision 63576) +++ test/dtrace/helper.rb (revision 63577) @@ -46,8 +46,9 @@ module DTrace https://github.com/ruby/ruby/blob/trunk/test/dtrace/helper.rb#L46 IO.popen(cmd, err: [:child, :out], &:readlines) end - miniruby = "#{RbConfig::TOPDIR}/miniruby#{RbConfig::CONFIG["EXEEXT"]}" - RUBYBIN = File.exist?(miniruby) ? miniruby : EnvUtil.rubybin + miniruby = "miniruby#{RbConfig::CONFIG["EXEEXT"]}" + miniruby = File.join(File.dirname(EnvUtil.rubybin), miniruby) + RUBYBIN = File.exist?(miniruby) ? miniruby : EnvUtil.rubybin def trap_probe d_program, ruby_program d = Tempfile.new(%w'probe .d') @@ -60,8 +61,8 @@ module DTrace https://github.com/ruby/ruby/blob/trunk/test/dtrace/helper.rb#L61 d_path = d.path rb_path = rb.path - - cmd = [*DTRACE_CMD, "-q", "-s", d_path, "-c", "#{RUBYBIN} -I#{INCLUDE} #{rb_path}"] + cmd = "#{RUBYBIN} --disable=gems -I#{INCLUDE} #{rb_path}" + cmd = [*DTRACE_CMD, "-q", "-s", d_path, "-c", cmd ] if sudo = @@sudo [RbConfig::CONFIG["LIBPATHENV"], "RUBY", "RUBYOPT"].each do |name| if name and val = ENV[name] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/