1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

GNU make 4.4 now uses a fifo for the jobserver

This commit is contained in:
Nobuyoshi Nakada 2022-11-06 23:39:55 +09:00
parent fc842c9ccc
commit 12883f8fa6
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -286,10 +286,15 @@ module Test
@jobserver = nil
makeflags = ENV.delete("MAKEFLAGS")
if !options[:parallel] and
/(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ makeflags
/(?:\A|\s)--jobserver-(?:auth|fds)=(?:(\d+),(\d+)|fifo:(.*))/ =~ makeflags
begin
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
if fifo = $3
r = File.open(fifo, IO::RDONLY|IO::NONBLOCK|IO::BINARY, autoclose: false)
w = File.open(fifo, IO::WRONLY|IO::NONBLOCK|IO::BINARY, autoclose: false)
else
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
end
rescue
r.close if r
nil