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

ruby-changes:70521

From: Yusuke <ko1@a...>
Date: Fri, 24 Dec 2021 16:04:44 +0900 (JST)
Subject: [ruby-changes:70521] 71e85ec9b5 (master): [rubygems/rubygems] Do not use IO#flock on Solaris

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

From 71e85ec9b5944238e14ac4e651247ecd0a98d27b Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Fri, 24 Dec 2021 14:24:09 +0900
Subject: [rubygems/rubygems] Do not use IO#flock on Solaris

`io.flock(File::LOCK_EX)` fails on Solaris when the io is opened as
read-only. Due to this issue, `make install` of the ruby package failed
on Solaris.

https://github.com/rubygems/rubygems/commit/5905d17ab2
---
 lib/rubygems.rb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 762ecdf857b..ddadd0f7978 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -788,7 +788,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L788
 
   def self.open_with_flock(path, flags, &block)
     File.open(path, flags) do |io|
-      unless java_platform?
+      if !java_platform? && !solaris_platform?
         begin
           io.flock(File::LOCK_EX)
         rescue Errno::ENOSYS, Errno::ENOTSUP
@@ -1015,6 +1015,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L1015
     RUBY_PLATFORM == "java"
   end
 
+  ##
+  # Is this platform Solaris?
+
+  def self.solaris_platform?
+    RUBY_PLATFORM =~ /solaris/
+  end
+
   ##
   # Load +plugins+ as Ruby files
 
-- 
cgit v1.2.1


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

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