From ca2fffd3a7c6cf138fd60e73320cfc8a87c5ff35 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Tue, 11 Nov 2025 21:49:36 +0900 Subject: [PATCH 1/5] [ruby/openssl] Replace Ruby 3.5 with Ruby 4.0 This commit updates the Ruby version in the error message to follow the commit in Ruby master branch. https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 https://github.com/ruby/openssl/commit/5a50a4d793 --- test/openssl/test_ssl.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index e700e53e3b58c0..5082dadd1b7971 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -2325,12 +2325,12 @@ def test_export_keying_material end end - # OpenSSL::Buffering requires $/ accessible from non-main Ractors (Ruby 3.5) + # OpenSSL::Buffering requires $/ accessible from non-main Ractors (Ruby 4.0) # https://bugs.ruby-lang.org/issues/21109 # # Hangs on Windows # https://bugs.ruby-lang.org/issues/21537 - if respond_to?(:ractor) && RUBY_VERSION >= "3.5" && RUBY_PLATFORM !~ /mswin|mingw/ + if respond_to?(:ractor) && RUBY_VERSION >= "4.0" && RUBY_PLATFORM !~ /mswin|mingw/ ractor def test_ractor_client start_server { |port| From e451b3debd69651640a952489dd12a27012c995b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 10 Nov 2025 19:32:45 -0500 Subject: [PATCH 2/5] Remove useless cast in rb_managed_id_table_type --- id_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/id_table.c b/id_table.c index eb8477237ea622..4629af553505b7 100644 --- a/id_table.c +++ b/id_table.c @@ -353,7 +353,7 @@ const rb_data_type_t rb_managed_id_table_type = { .wrap_struct_name = "VM/managed_id_table", .function = { .dmark = NULL, // Nothing to mark - .dfree = (RUBY_DATA_FUNC)managed_id_table_free, + .dfree = managed_id_table_free, .dsize = managed_id_table_memsize, }, .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE, From 1577db908671be93db8277501445c5fc2c6052fc Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 12 Nov 2025 00:51:40 +0900 Subject: [PATCH 3/5] [ruby/erb] Replace Ruby 3.5 with Ruby 4.0 (https://github.com/ruby/erb/pull/94) 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/erb/commit/a5d42484e4 --- lib/erb/util.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/erb/util.rb b/lib/erb/util.rb index 9c3d186edefb62..adeb695aa81fec 100644 --- a/lib/erb/util.rb +++ b/lib/erb/util.rb @@ -2,8 +2,8 @@ # Load CGI.escapeHTML and CGI.escapeURIComponent. # CRuby: -# cgi.gem v0.1.0+ (Ruby 2.7-3.4) and Ruby 3.5+ stdlib have 'cgi/escape' and CGI.escapeHTML. -# cgi.gem v0.3.3+ (Ruby 3.2-3.4) and Ruby 3.5+ stdlib have CGI.escapeURIComponent. +# cgi.gem v0.1.0+ (Ruby 2.7-3.4) and Ruby 4.0+ stdlib have 'cgi/escape' and CGI.escapeHTML. +# cgi.gem v0.3.3+ (Ruby 3.2-3.4) and Ruby 4.0+ stdlib have CGI.escapeURIComponent. # JRuby: cgi.gem has a Java extension 'cgi/escape'. # TruffleRuby: lib/truffle/cgi/escape.rb requires 'cgi/util'. require 'cgi/escape' From 50c97e1c7807724a87341302b20c3c3bcb46e1db Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 12 Nov 2025 00:58:44 +0900 Subject: [PATCH 4/5] Update Ruby version to 4.0 for the cgi warnings (#15141) This commit updates the Ruby version in the error message to follow the commit in Ruby master branch. https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 --- lib/cgi.rb | 2 +- lib/cgi/util.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cgi.rb b/lib/cgi.rb index b041c1bed13b1c..bb306d2e0644cf 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -2,6 +2,6 @@ require "cgi/escape" warn <<-WARNING, uplevel: Gem::BUNDLED_GEMS.uplevel if $VERBOSE -CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features. +CGI library is removed from Ruby 4.0. Please use cgi/escape instead for CGI.escape and CGI.unescape features. If you need to use the full features of CGI library, Please install cgi gem. WARNING diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb index 389a04acd21f05..50a2e91665e000 100644 --- a/lib/cgi/util.rb +++ b/lib/cgi/util.rb @@ -2,6 +2,6 @@ require "cgi/escape" warn <<-WARNING, uplevel: Gem::BUNDLED_GEMS.uplevel if $VERBOSE -CGI::Util is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features. +CGI::Util is removed from Ruby 4.0. Please use cgi/escape instead for CGI.escape and CGI.unescape features. If you are using CGI.parse, please install and use the cgi gem instead. WARNING From ade2b51a3b3ccdd9fe97d541c3dbb51339838d44 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 11 Nov 2025 10:00:10 -0500 Subject: [PATCH 5/5] Don't GC unprotect hash in Coverage.peek_result The call to unprotect the coverages hash was introduced in commit 99093e1 where we used the raw ST table and st_foreach. We now use rb_hash_foreach which no longer requires GC unprotecting the coverages hash. --- ext/coverage/coverage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c index 1519b559cdafc1..74d9f3ea4655fe 100644 --- a/ext/coverage/coverage.c +++ b/ext/coverage/coverage.c @@ -352,7 +352,6 @@ rb_coverage_peek_result(VALUE klass) if (!RTEST(coverages)) { rb_raise(rb_eRuntimeError, "coverage measurement is not enabled"); } - OBJ_WB_UNPROTECT(coverages); rb_hash_foreach(coverages, coverage_peek_result_i, ncoverages);