From c6997ddf3e7acf0f9d65837d2da591bc47afdaee Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Tue, 11 Nov 2025 21:56:43 +0900 Subject: [PATCH 01/11] [ruby/net-http] Replace Ruby 3.5 with Ruby 4.0 This commit updates the Ruby version to follow the commit in Ruby master branch. https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 https://github.com/ruby/net-http/commit/1e48cfaaf7 --- lib/net/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/http.rb b/lib/net/http.rb index c60649b8123c09..1a13299d202aa0 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -2587,7 +2587,7 @@ def debug(msg) alias_method :D, :debug end - # for backward compatibility until Ruby 3.5 + # for backward compatibility until Ruby 4.0 # https://bugs.ruby-lang.org/issues/20900 # https://github.com/bblimke/webmock/pull/1081 HTTPSession = HTTP From da114dfe0bd208ff986db87890481f1ff7391bbd Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Tue, 11 Nov 2025 21:37:56 +0900 Subject: [PATCH 02/11] [ruby/error_highlight] Replace Ruby 3.5 with Ruby 4.0 This commit updates the Ruby version to follow the commit in Ruby master branch. https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 https://github.com/ruby/error_highlight/commit/dcecf68d75 --- lib/error_highlight/core_ext.rb | 2 +- test/error_highlight/test_error_highlight.rb | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb index e6cacbaf9e832a..1cfc331582748e 100644 --- a/lib/error_highlight/core_ext.rb +++ b/lib/error_highlight/core_ext.rb @@ -24,7 +24,7 @@ module CoreExt _, _, snippet, highlight = ErrorHighlight.formatter.message_for(spot).lines out += "\n | #{ snippet } #{ highlight }" else - out += "\n (cannot highlight method definition; try Ruby 3.5 or later)" + out += "\n (cannot highlight method definition; try Ruby 4.0 or later)" end end ret << "\n" + out if out diff --git a/test/error_highlight/test_error_highlight.rb b/test/error_highlight/test_error_highlight.rb index 43e232071f9371..1276a0a0d93a7b 100644 --- a/test/error_highlight/test_error_highlight.rb +++ b/test/error_highlight/test_error_highlight.rb @@ -1468,7 +1468,7 @@ def test_wrong_number_of_arguments_for_method MethodDefLocationSupported ? "| def wrong_number_of_arguments_test(x, y) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1494,7 +1494,7 @@ def test_missing_keyword MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1515,7 +1515,7 @@ def test_missing_keywords # multiple missing keywords MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1536,7 +1536,7 @@ def test_unknown_keyword MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1557,7 +1557,7 @@ def test_unknown_keywords MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1587,7 +1587,7 @@ def test_wrong_number_of_arguments_for_method2 MethodDefLocationSupported ? "| def wrong_number_of_arguments_test2( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1609,7 +1609,7 @@ def test_wrong_number_of_arguments_for_lambda_literal MethodDefLocationSupported ? "| v = -> {} ^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1631,7 +1631,7 @@ def test_wrong_number_of_arguments_for_lambda_method MethodDefLocationSupported ? "| v = lambda { } ^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1657,7 +1657,7 @@ def test_wrong_number_of_arguments_for_define_method MethodDefLocationSupported ? "| define_method :define_method_test do |x, y| ^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END From bf970ed8a27abaa166fcbd04a769907af1554879 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 12 Nov 2025 09:09:14 +0900 Subject: [PATCH 03/11] Replace Ruby 3.5 with Ruby 4.0 --- lib/bundled_gems.rb | 20 ++++++++++---------- spec/bundled_gems_spec.rb | 14 +++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb index 914c8465032fdc..dd199098a376b2 100644 --- a/lib/bundled_gems.rb +++ b/lib/bundled_gems.rb @@ -20,16 +20,16 @@ module Gem::BUNDLED_GEMS # :nodoc: "resolv-replace" => "3.4.0", "rinda" => "3.4.0", "syslog" => "3.4.0", - "ostruct" => "3.5.0", - "pstore" => "3.5.0", - "rdoc" => "3.5.0", - "win32ole" => "3.5.0", - "fiddle" => "3.5.0", - "logger" => "3.5.0", - "benchmark" => "3.5.0", - "irb" => "3.5.0", - "reline" => "3.5.0", - # "readline" => "3.5.0", # This is wrapper for reline. We don't warn for this. + "ostruct" => "4.0.0", + "pstore" => "4.0.0", + "rdoc" => "4.0.0", + "win32ole" => "4.0.0", + "fiddle" => "4.0.0", + "logger" => "4.0.0", + "benchmark" => "4.0.0", + "irb" => "4.0.0", + "reline" => "4.0.0", + # "readline" => "4.0.0", # This is wrapper for reline. We don't warn for this. "tsort" => "3.6.0", }.freeze diff --git a/spec/bundled_gems_spec.rb b/spec/bundled_gems_spec.rb index 8014a48223c8cf..c2a655929ab7bf 100644 --- a/spec/bundled_gems_spec.rb +++ b/spec/bundled_gems_spec.rb @@ -113,7 +113,7 @@ def script(code, options = {}) require "active_support/all" RUBY - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/lib\/active_support\/all\.rb:1/) end @@ -159,7 +159,7 @@ def script(code, options = {}) bundle "exec ruby script.rb" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/script\.rb:8/) end @@ -177,7 +177,7 @@ def script(code, options = {}) bundle "exec ./script.rb" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/script\.rb:9/) end @@ -186,7 +186,7 @@ def script(code, options = {}) create_file("Gemfile", "source 'https://rubygems.org'") bundle "exec ruby -r./stub -ropenssl -e ''" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) end it "Show warning when warn is not the standard one in the current scope" do @@ -209,7 +209,7 @@ def my My.my RUBY - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/-e:19/) end @@ -251,7 +251,7 @@ def my require Gem::BUNDLED_GEMS::ARCHDIR + 'openssl' RUBY - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) # TODO: We should assert caller location like below: # test_warn_bootsnap.rb:14: warning: ... end @@ -320,7 +320,7 @@ def my create_file("Gemfile", "source 'https://rubygems.org'") bundle "exec ruby script.rb" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/script\.rb:13/) end From 429b8e2e1c95121880a078bf647dee302668604d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 12 Nov 2025 09:47:17 +0900 Subject: [PATCH 04/11] tsort will be extracted at 4.1, not 3.6 --- lib/bundled_gems.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb index dd199098a376b2..49fb90249dd6ae 100644 --- a/lib/bundled_gems.rb +++ b/lib/bundled_gems.rb @@ -30,7 +30,7 @@ module Gem::BUNDLED_GEMS # :nodoc: "irb" => "4.0.0", "reline" => "4.0.0", # "readline" => "4.0.0", # This is wrapper for reline. We don't warn for this. - "tsort" => "3.6.0", + "tsort" => "4.1.0", }.freeze EXACT = { From b33da0a6aa886d6a7d17a20dd88f4de35c7fe066 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 12 Nov 2025 10:35:34 +0900 Subject: [PATCH 05/11] Added email and name for `git pull --rebase` ``` Rebasing (1/3) Committer identity unknown *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. ``` --- .github/workflows/sync_default_gems.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml index 1a9b43ec5241a9..9ef89f89ff2b05 100644 --- a/.github/workflows/sync_default_gems.yml +++ b/.github/workflows/sync_default_gems.yml @@ -59,6 +59,10 @@ jobs: git pull --rebase origin ${GITHUB_REF#refs/heads/} git push origin ${GITHUB_REF#refs/heads/} if: ${{ steps.sync.outputs.update }} + env: + EMAIL: svn-admin@ruby-lang.org + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git - uses: ./.github/actions/slack with: From 9775d60222d5bbdbde662fd48f0273be65ff6cdb Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 11 Nov 2025 14:45:35 -0800 Subject: [PATCH 06/11] [ruby/rubygems] Shell out fewer times This is a follow up to #9053. We can avoid shelling out for generating the gem index. https://github.com/ruby/rubygems/commit/e40bafe9f1 --- spec/bundler/spec_helper.rb | 1 + spec/bundler/support/builders.rb | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb index d750218452ebcf..a3a7b57356c783 100644 --- a/spec/bundler/spec_helper.rb +++ b/spec/bundler/spec_helper.rb @@ -27,6 +27,7 @@ require "rspec/expectations" require "rspec/mocks" require "rspec/support/differ" +require "rubygems/indexer" require_relative "support/builders" require_relative "support/checksums" diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index 5ca227cf5b3aa3..1283dc4348821d 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -279,14 +279,8 @@ def update_repo(path, build_compact_index: true) @_build_path = "#{path}/gems" @_build_repo = File.basename(path) yield - with_gem_path_as scoped_base_system_gem_path do - Dir[scoped_base_system_gem_path.join("gems/rubygems-generate_index*/lib")].first || - raise("Could not find rubygems-generate_index lib directory in #{scoped_base_system_gem_path}") - - command = "generate_index" - command += " --no-compact" if !build_compact_index && gem_command(command + " --help").include?("--[no-]compact") - gem_command command, dir: path - end + options = { build_compact: build_compact_index } + Gem::Indexer.new(path, options).generate_index ensure @_build_path = nil @_build_repo = nil From ba1616fefb27845ecadb5a87b7a05a2212bd0541 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 11 Nov 2025 16:05:28 -0800 Subject: [PATCH 07/11] [ruby/rubygems] add rubygems-generate_index as a dev dep https://github.com/ruby/rubygems/commit/8df0e4e63e --- tool/bundler/dev_gems.rb | 1 + tool/bundler/dev_gems.rb.lock | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/tool/bundler/dev_gems.rb b/tool/bundler/dev_gems.rb index 0d4dbd7f2ee058..0039a42171aa41 100644 --- a/tool/bundler/dev_gems.rb +++ b/tool/bundler/dev_gems.rb @@ -12,6 +12,7 @@ gem "rspec-core", "~> 3.12" gem "rspec-expectations", "~> 3.12" gem "rspec-mocks", "~> 3.12" +gem "rubygems-generate_index", "~> 1.1" group :doc do gem "ronn-ng", "~> 0.10.1", platform: :ruby diff --git a/tool/bundler/dev_gems.rb.lock b/tool/bundler/dev_gems.rb.lock index bc1d2acfc98da8..7f73c43f4cc1dd 100644 --- a/tool/bundler/dev_gems.rb.lock +++ b/tool/bundler/dev_gems.rb.lock @@ -1,6 +1,7 @@ GEM remote: https://rubygems.org/ specs: + compact_index (0.15.0) diff-lcs (1.6.1) kramdown (2.5.1) rexml (>= 3.3.9) @@ -54,6 +55,8 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.2) + rubygems-generate_index (1.1.3) + compact_index (~> 0.15.0) test-unit (3.6.7) power_assert turbo_tests (2.2.5) @@ -83,10 +86,12 @@ DEPENDENCIES rspec-core (~> 3.12) rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) + rubygems-generate_index (~> 1.1) test-unit (~> 3.0) turbo_tests (~> 2.2.3) CHECKSUMS + compact_index (0.15.0) sha256=5c6c404afca8928a7d9f4dde9524f6e1610db17e675330803055db282da84a8b diff-lcs (1.6.1) sha256=12a5a83f3e37a8e2f4427268e305914d5f1879f22b4e73bb1a09f76a3dd86cd4 kramdown (2.5.1) sha256=87bbb6abd9d3cebe4fc1f33e367c392b4500e6f8fa19dd61c0972cf4afe7368c kramdown-parser-gfm (1.1.0) sha256=fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729 @@ -115,6 +120,7 @@ CHECKSUMS rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58 rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec + rubygems-generate_index (1.1.3) sha256=3571424322666598e9586a906485e1543b617f87644913eaf137d986a3393f5c test-unit (3.6.7) sha256=c342bb9f7334ea84a361b43c20b063f405c0bf3c7dbe3ff38f61a91661d29221 turbo_tests (2.2.5) sha256=3fa31497d12976d11ccc298add29107b92bda94a90d8a0a5783f06f05102509f From 30b3ccbbcd7bfa22319eb9419bc81e06870b3071 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 11 Nov 2025 16:16:17 -0800 Subject: [PATCH 08/11] [ruby/rubygems] maybe this will work? https://github.com/ruby/rubygems/commit/4d8b1c77f4 --- spec/bundler/spec_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb index a3a7b57356c783..96cd7be4720a66 100644 --- a/spec/bundler/spec_helper.rb +++ b/spec/bundler/spec_helper.rb @@ -27,6 +27,7 @@ require "rspec/expectations" require "rspec/mocks" require "rspec/support/differ" +gem "rubygems-generate_index" require "rubygems/indexer" require_relative "support/builders" From 090099b0c048c655c239a1cb81f551556f9bf2c5 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 12 Nov 2025 10:35:41 +0900 Subject: [PATCH 09/11] Development of 3.1.9 started. --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 5da0b4c9457a2e..17be72f71a8cb6 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -13,7 +13,7 @@ **********************************************************************/ static const char *const -STRINGIO_VERSION = "3.1.8.dev"; +STRINGIO_VERSION = "3.1.9.dev"; #include From c5937c1bca72f4fc2642d51bc90bd357d00d264c Mon Sep 17 00:00:00 2001 From: git Date: Wed, 12 Nov 2025 02:32:56 +0000 Subject: [PATCH 10/11] Update default gems list at 090099b0c048c655c239a1cb81f551 [ci skip] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3c2957d032579f..e33408054ea5e4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -206,7 +206,7 @@ The following default gems are updated. * prism 1.6.0 * psych 5.2.6 * resolv 0.6.3 -* stringio 3.1.8.dev +* stringio 3.1.9.dev * strscan 3.1.6.dev * timeout 0.4.4 * uri 1.1.1 From f4f728b319086eea3db6e9909fb9c849c276f813 Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Wed, 12 Nov 2025 13:58:38 +0900 Subject: [PATCH 11/11] [Bug #21680] Fix (base**power_of_two).digits(base) bug (#15144) Fix wrong condition in base multiplying loop. --- numeric.c | 2 +- test/ruby/test_bignum.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/numeric.c b/numeric.c index de5b02aaf9eb41..731a8095239107 100644 --- a/numeric.c +++ b/numeric.c @@ -5553,7 +5553,7 @@ rb_int_digits_bigbase(VALUE num, VALUE base) } bases = rb_ary_new(); - for (VALUE b = base; int_lt(b, num) == Qtrue; b = rb_int_mul(b, b)) { + for (VALUE b = base; int_le(b, num) == Qtrue; b = rb_int_mul(b, b)) { rb_ary_push(bases, b); } digits = rb_ary_new_from_args(1, num); diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index dd6f4baa4c292b..c366f794b2a1f5 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -821,6 +821,9 @@ def test_digits assert_equal([7215, 2413, 6242], T1024P.digits(10_000).first(3)) assert_equal([11], 11.digits(T1024P)) assert_equal([T1024P - 1, 1], (T1024P + T1024P - 1).digits(T1024P)) + bug21680 = '[ruby-core:123769] [Bug #21680]' + assert_equal([0] * 64 + [1], (2**512).digits(256), bug21680) + assert_equal([0] * 128 + [1], (123**128).digits(123), bug21680) end def test_digits_for_negative_numbers