aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-03 00:53:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-03 00:53:25 +0000
commit0f571ba42760372f533d2d809653745edf826bde (patch)
tree8f9e3b72a87433fa0144617c9d71283808a721ec /spec
parent30331259830885834780d46e51969dff2002c89b (diff)
downloadruby-0f571ba42760372f533d2d809653745edf826bde.tar.gz
spec_helper.rb: pass jobserver fds
* spec/rubyspec/optional/capi/spec_helper.rb (compile_extension): pass jobserver fds explicitly, because other specs might have set close_on_exec flags on these fds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r--spec/rubyspec/optional/capi/spec_helper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/rubyspec/optional/capi/spec_helper.rb b/spec/rubyspec/optional/capi/spec_helper.rb
index 5dcb6aceac..90ed86d391 100644
--- a/spec/rubyspec/optional/capi/spec_helper.rb
+++ b/spec/rubyspec/optional/capi/spec_helper.rb
@@ -62,8 +62,15 @@ def compile_extension(name)
ENV["MAKEFLAGS"] = "l#{ENV["MAKEFLAGS"]}"
end
+ opts = {}
+ if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
+ r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
+ w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
+ opts[r] = r
+ opts[w] = w
+ end
# Do not capture stderr as we want to show compiler warnings
- output = IO.popen([make, "V=1", "DESTDIR=", close_others: false], &:read)
+ output = IO.popen([make, "V=1", "DESTDIR=", opts], &:read)
raise "#{make} failed:\n#{output}" unless $?.success?
$stderr.puts output if debug