rubyspec: jobserver fd may not be available
* spec/rubyspec/optional/capi/spec_helper.rb (compile_extension): rescue possible EBADF as jobserver fd may not be available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3ce856a602
commit
92e3ffdf78
@ -57,18 +57,22 @@ def compile_extension(name)
|
|||||||
|
|
||||||
make = ENV['MAKE']
|
make = ENV['MAKE']
|
||||||
make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make")
|
make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make")
|
||||||
if File.basename(make, ".*") == "nmake"
|
if File.basename(make, ".*").casecmp?("nmake")
|
||||||
# suppress logo of nmake.exe to stderr
|
# suppress logo of nmake.exe to stderr
|
||||||
ENV["MAKEFLAGS"] = "l#{ENV["MAKEFLAGS"]}"
|
ENV["MAKEFLAGS"] = "l#{ENV["MAKEFLAGS"]}"
|
||||||
end
|
end
|
||||||
|
|
||||||
opts = {}
|
opts = {}
|
||||||
if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
|
if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
|
||||||
|
begin
|
||||||
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
|
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
|
||||||
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
|
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
|
||||||
|
rescue Errno::EBADF
|
||||||
|
else
|
||||||
opts[r] = r
|
opts[r] = r
|
||||||
opts[w] = w
|
opts[w] = w
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# Do not capture stderr as we want to show compiler warnings
|
# Do not capture stderr as we want to show compiler warnings
|
||||||
output = IO.popen([make, "V=1", "DESTDIR=", opts], &:read)
|
output = IO.popen([make, "V=1", "DESTDIR=", opts], &:read)
|
||||||
raise "#{make} failed:\n#{output}" unless $?.success?
|
raise "#{make} failed:\n#{output}" unless $?.success?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user