From af718aaf4b56aacbe38c20c298dad35a932c2019 Mon Sep 17 00:00:00 2001 From: git Date: Tue, 22 Jul 2025 07:07:16 +0000 Subject: [PATCH 1/3] Update bundled gems list as of 2025-07-22 --- NEWS.md | 2 +- gems/bundled_gems | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index b3f756632f61ab..48b9ab421c635b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -127,7 +127,7 @@ The following bundled gems are promoted from default gems. * rdoc 6.14.2 * win32ole 1.9.2 * irb 1.15.2 -* reline 0.6.1 +* reline 0.6.2 * readline 0.0.4 * fiddle 1.1.8 diff --git a/gems/bundled_gems b/gems/bundled_gems index a040f93a34db31..4fed6a994d8766 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -42,6 +42,6 @@ logger 1.7.0 https://github.com/ruby/logger rdoc 6.14.2 https://github.com/ruby/rdoc win32ole 1.9.2 https://github.com/ruby/win32ole irb 1.15.2 https://github.com/ruby/irb 331c4e851296b115db766c291e8cf54a2492fb36 -reline 0.6.1 https://github.com/ruby/reline +reline 0.6.2 https://github.com/ruby/reline readline 0.0.4 https://github.com/ruby/readline fiddle 1.1.8 https://github.com/ruby/fiddle From 4dec4fbdfaf69d647953f0993fedaeabd31094cf Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 22 Jul 2025 13:51:58 +0900 Subject: [PATCH 2/3] [rubygems/rubygems] Define dummy module for mise plugin https://github.com/rubygems/rubygems/commit/64bdff1e1e --- spec/bundler/support/hax.rb | 6 ++++++ test/rubygems/helper.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb index 772a125ec7e71f..46718f5fa43c43 100644 --- a/spec/bundler/support/hax.rb +++ b/spec/bundler/support/hax.rb @@ -66,3 +66,9 @@ def getaddrinfo(host, port) Socket.singleton_class.prepend FakeResolv end end + +# mise installed rubygems_plugin.rb to system wide `site_ruby` directory. +# This empty module avoid to call `mise` command. +module ReshimInstaller + def self.reshim; end +end diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index af78bab724a4b5..2f4abff1e84ca9 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -1578,3 +1578,9 @@ def stub(name, val_or_callable, *block_args) end require_relative "utilities" + +# mise installed rubygems_plugin.rb to system wide `site_ruby` directory. +# This empty module avoid to call `mise` command. +module ReshimInstaller + def self.reshim; end +end From 8541dec8c4f118d09a7dcb4b83540ec0cb0d02db Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 22 Jul 2025 11:27:15 +0200 Subject: [PATCH 3/3] encoding.c: check for autoload before checking index Otherwise we may be checking the index while the encoding is being autoloaded by another ractor. --- encoding.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/encoding.c b/encoding.c index 6fbb739bb631b7..7c54ba9177e10f 100644 --- a/encoding.c +++ b/encoding.c @@ -244,14 +244,14 @@ must_encindex(int index) rb_raise(rb_eEncodingError, "encoding index out of bound: %d", index); } - if (ENC_TO_ENCINDEX(enc) != (int)(index & ENC_INDEX_MASK)) { - rb_raise(rb_eEncodingError, "wrong encoding index %d for %s (expected %d)", - index, rb_enc_name(enc), ENC_TO_ENCINDEX(enc)); - } if (rb_enc_autoload_p(enc) && rb_enc_autoload(enc) == -1) { rb_loaderror("failed to load encoding (%s)", rb_enc_name(enc)); } + if (ENC_TO_ENCINDEX(enc) != (int)(index & ENC_INDEX_MASK)) { + rb_raise(rb_eEncodingError, "wrong encoding index %d for %s (expected %d)", + index, rb_enc_name(enc), ENC_TO_ENCINDEX(enc)); + } return enc; } @@ -792,26 +792,33 @@ enc_autoload_body(rb_encoding *enc) } } while (enc_table->list[i].enc != base && (++i, 1)); } - } - if (i == -1) return -1; + if (i != -1) { + if (base) { + bool do_register = true; + if (rb_enc_autoload_p(base)) { + if (rb_enc_autoload(base) < 0) { + do_register = false; + i = -1; + } + } - if (base) { - if (rb_enc_autoload_p(base)) { - if (rb_enc_autoload(base) < 0) return -1; - } - i = enc->ruby_encoding_index; + i = enc->ruby_encoding_index; + if (do_register) { + enc_register_at(enc_table, i & ENC_INDEX_MASK, rb_enc_name(enc), base); + ((rb_raw_encoding *)enc)->ruby_encoding_index = i; + } - GLOBAL_ENC_TABLE_LOCKING(enc_table) { - enc_register_at(enc_table, i & ENC_INDEX_MASK, rb_enc_name(enc), base); + i &= ENC_INDEX_MASK; + } + else { + i = -2; + } } - ((rb_raw_encoding *)enc)->ruby_encoding_index = i; - i &= ENC_INDEX_MASK; - return i; } - return -2; + return i; } int