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

ruby-changes:63189

From: Aaron <ko1@a...>
Date: Tue, 29 Sep 2020 01:45:46 +0900 (JST)
Subject: [ruby-changes:63189] 0767d387ec (master): Pass ASAN options to child environments

https://git.ruby-lang.org/ruby.git/commit/?id=0767d387ec

From 0767d387ecb9e9dd7ebd34cad46d86cfce13b9f5 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Mon, 28 Sep 2020 08:28:10 -0700
Subject: Pass ASAN options to child environments

I want to work with ASAN, but some child environments are not inheriting
the ASAN options I'm using.  This commit passes them to child
environments if specified

diff --git a/test/ruby/test_stack.rb b/test/ruby/test_stack.rb
index 8a78848..763aeb6 100644
--- a/test/ruby/test_stack.rb
+++ b/test/ruby/test_stack.rb
@@ -18,6 +18,7 @@ class TestStack < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_stack.rb#L18
     env = {}
     env['RUBY_FIBER_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size
     env['RUBY_FIBER_MACHINE_STACK_SIZE'] = machine_stack_size.to_s if machine_stack_size
+    env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
 
     stdout, stderr, status = EnvUtil.invoke_ruby([env, '-e', script], '', true, true, timeout: 30)
     assert(!status.signaled?, FailDesc[status, nil, stderr])
diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb
index d935039..323d710 100644
--- a/tool/lib/envutil.rb
+++ b/tool/lib/envutil.rb
@@ -150,6 +150,7 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/tool/lib/envutil.rb#L150
     if RUBYLIB and lib = child_env["RUBYLIB"]
       child_env["RUBYLIB"] = [lib, RUBYLIB].join(File::PATH_SEPARATOR)
     end
+    child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
     args = [args] if args.kind_of?(String)
     pid = spawn(child_env, *precommand, rubybin, *args, **opt)
     in_c.close
-- 
cgit v0.10.2


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

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