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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
894628ac02
commit
2acd50ed42
@ -46,8 +46,9 @@ module DTrace
|
||||
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
|
||||
|
||||
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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user