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

ruby-changes:74378

From: Nobuyoshi <ko1@a...>
Date: Mon, 7 Nov 2022 15:56:10 +0900 (JST)
Subject: [ruby-changes:74378] ee86b57ee5 (master): Revert jobserver handling in spec

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

From ee86b57ee5df34390ba1d20343593adf8331c010 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 7 Nov 2022 15:51:04 +0900
Subject: Revert jobserver handling in spec

---
 spec/default.mspec                     | 14 +++-----------
 spec/ruby/optional/capi/spec_helper.rb | 14 +++-----------
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/spec/default.mspec b/spec/default.mspec
index 33ac691b94..0dba98306c 100644
--- a/spec/default.mspec
+++ b/spec/default.mspec
@@ -29,19 +29,11 @@ end https://github.com/ruby/ruby/blob/trunk/spec/default.mspec#L29
 
 module MSpecScript::JobServer
   def cores(max = 1)
-    if max > 1 and /(?:\A|\s)--jobserver-(?:auth|fds)=(?:(\d+),(\d+)|fifo:((?:\\.|\S)+))/ =~ ENV["MAKEFLAGS"]
+    if max > 1 and /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
       cores = 1
       begin
-        if fifo = $3
-          fifo.gsub!(/\\(?=.)/, '')
-          r = File.open(fifo, IO::RDONLY|IO::NONBLOCK|IO::BINARY)
-          w = File.open(fifo, IO::WRONLY|IO::NONBLOCK|IO::BINARY)
-        else
-          r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
-          w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
-        end
-        r.close_on_exec = true
-        w.close_on_exec = true
+        r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
+        w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
         jobtokens = r.read_nonblock(max - 1)
         cores = jobtokens.size
         if cores > 0
diff --git a/spec/ruby/optional/capi/spec_helper.rb b/spec/ruby/optional/capi/spec_helper.rb
index 9c85751974..ec6b909397 100644
--- a/spec/ruby/optional/capi/spec_helper.rb
+++ b/spec/ruby/optional/capi/spec_helper.rb
@@ -113,20 +113,12 @@ def setup_make https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/spec_helper.rb#L113
   end
 
   opts = {}
-  if /(?:\A|\s)--jobserver-(?:auth|fds)=(?:(\d+),(\d+)|fifo:((?:\\.|\S)+))/ =~ make_flags
+  if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ make_flags
     begin
-      if fifo = $3
-        fifo.gsub!(/\\(?=.)/, '')
-        r = File.open(fifo, IO::RDONLY|IO::NONBLOCK|IO::BINARY)
-        w = File.open(fifo, IO::WRONLY|IO::NONBLOCK|IO::BINARY)
-      else
-        r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
-        w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
-      end
+      r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
+      w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
     rescue Errno::EBADF
     else
-      r.close_on_exec = true
-      w.close_on_exec = true
       opts[r] = r
       opts[w] = w
     end
-- 
cgit v1.2.3


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

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