From 5a912670fb1c063a503ed5fd452c5e36da16b017 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 27 Nov 2025 11:09:07 +0900 Subject: [PATCH 1/5] Merge pull request #2718 from ruby/ruby-4 Run CI with "4.0.0-preview2" --- .github/workflows/c-check.yml | 2 +- .github/workflows/ruby.yml | 14 ++-- .github/workflows/typecheck.yml | 2 +- .github/workflows/windows.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 112 ++++++++++++++++------------ Rakefile | 9 ++- bin/benchmark-parse.rb | 1 - lib/rbs.rb | 2 +- steep/Gemfile.lock | 2 +- test/stdlib/Marshal_test.rb | 1 - test/stdlib/zlib/GzipReader_test.rb | 1 - 12 files changed, 84 insertions(+), 66 deletions(-) diff --git a/.github/workflows/c-check.yml b/.github/workflows/c-check.yml index b1bdc66cc..eb8b0be58 100644 --- a/.github/workflows/c-check.yml +++ b/.github/workflows/c-check.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version: "4.0.0-preview2" bundler-cache: none - name: Set working directory as safe run: git config --global --add safe.directory $(pwd) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 976c781c8..8b0d2df9b 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -13,24 +13,24 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', '3.4', head] + ruby: ['3.2', '3.3', '3.4', '4.0.0-preview2', head] rubyopt: [""] job: - test include: - ruby: head job: stdlib_test rubocop - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: stdlib_test - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: test rubyopt: "--enable-frozen-string-literal" - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: stdlib_test rubyopt: "--enable-frozen-string-literal" - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: rubocop validate test_doc build test_generate_stdlib raap - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: typecheck_test env: RANDOMIZE_STDLIB_TEST_ORDER: "true" @@ -94,7 +94,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.4', head] + ruby: ['4.0.0-preview2', head] steps: - uses: actions/checkout@v4 - name: Install dependencies diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 5f737028a..a3f7d630f 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "3.4" bundler: none - name: Set working directory as safe run: git config --global --add safe.directory $(pwd) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 75aa8a716..a249e8ede 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.2', '3.3', ucrt, mswin] + ruby: ['3.4', ucrt, mswin] steps: - uses: actions/checkout@v4 - name: load ruby diff --git a/Gemfile b/Gemfile index 7b03f739f..a04a1b352 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ gem "fileutils" gem "raap" gem "activesupport", "~> 7.0" gem "extconf_compile_commands_json" +gem "irb" group :libs do # Libraries required for stdlib test @@ -30,7 +31,6 @@ group :libs do gem "dbm" gem "mutex_m" gem "nkf" - gem "pathname" end group :profilers do diff --git a/Gemfile.lock b/Gemfile.lock index 2fd1d6279..890e0489a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,10 @@ PATH remote: . specs: - rbs (3.9.5) + rbs (4.0.0.dev.4) logger + prism (>= 1.3.0) + tsort PATH remote: test/assets/test-gem @@ -13,7 +15,7 @@ GEM remote: https://rubygems.org/ specs: abbrev (0.1.2) - activesupport (7.2.2.1) + activesupport (7.2.3) base64 benchmark (>= 0.3) bigdecimal @@ -28,20 +30,21 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) - base64 (0.2.0) - benchmark (0.4.0) + base64 (0.3.0) + benchmark (0.5.0) benchmark-ips (2.14.0) - bigdecimal (3.1.9) + bigdecimal (3.3.1) concurrent-ruby (1.3.5) - connection_pool (2.5.3) - csv (3.3.4) + connection_pool (2.5.5) + csv (3.3.5) dbm (1.1.0) - diff-lcs (1.6.1) - digest (3.2.0) - drb (2.2.1) + diff-lcs (1.6.2) + digest (3.2.1) + drb (2.2.3) + erb (6.0.0) extconf_compile_commands_json (0.0.7) ffi (1.17.2) - fileutils (1.7.3) + fileutils (1.8.0) goodcheck (3.1.0) marcel (>= 1.0, < 2.0) psych (>= 3.1, < 5.0) @@ -49,70 +52,80 @@ GEM strong_json (>= 1.1, < 2.2) i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.10.2) - json-schema (5.1.1) + io-console (0.8.1) + irb (1.15.3) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.16.0) + json-schema (6.0.0) addressable (~> 2.8) bigdecimal (~> 3.1) - language_server-protocol (3.17.0.4) + language_server-protocol (3.17.0.5) lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - marcel (1.0.4) + marcel (1.1.0) memory_profiler (1.1.0) - mini_portile2 (2.8.8) - minitest (5.25.5) + mini_portile2 (2.8.9) + minitest (5.26.2) mutex_m (0.3.0) net-protocol (0.2.2) timeout net-smtp (0.5.1) net-protocol nkf (0.2.0) - nokogiri (1.18.8) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) - ostruct (0.6.1) + ostruct (0.6.3) parallel (1.27.0) - parser (3.3.8.0) + parser (3.3.10.0) ast (~> 2.4.1) racc - pathname (0.4.0) - power_assert (2.0.5) - prism (1.4.0) + power_assert (3.0.1) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.6.0) pstore (0.2.0) psych (4.0.6) stringio public_suffix (6.0.2) - raap (1.2.0) - rbs (~> 3.0) + raap (1.3.0) + rbs (~> 3.9.0) timeout (~> 0.4) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.1) rake-compiler (1.3.0) rake rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.16.0) + rdoc (6.15.1) erb psych (>= 4.0.0) - regexp_parser (2.10.0) - rspec (3.13.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.3) + rspec-core (3.13.6) rspec-support (~> 3.13.0) - rspec-expectations (3.13.4) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.4) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.3) - rubocop (1.75.5) + rspec-support (3.13.6) + rubocop (1.81.7) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -120,13 +133,13 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.48.0) parser (>= 3.3.7.2) prism (~> 1.4) - rubocop-on-rbs (1.6.0) + rubocop-on-rbs (1.8.0) lint_roller (~> 1.1) rbs (~> 3.5) rubocop (>= 1.72.1, < 2.0) @@ -156,22 +169,23 @@ GEM strscan (>= 1.0.0) terminal-table (>= 2, < 5) uri (>= 0.12.0) - stringio (3.1.7) + stringio (3.1.8) strong_json (2.1.2) strscan (3.1.5) tempfile (0.3.1) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.6.8) + test-unit (3.7.1) power_assert - timeout (0.4.3) + timeout (0.4.4) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - uri (1.0.3) - zlib (3.2.1) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.1) + zlib (3.2.2) PLATFORMS ruby @@ -188,7 +202,8 @@ DEPENDENCIES extconf_compile_commands_json fileutils goodcheck - json (~> 2.10.2) + irb + json json-schema memory_profiler minitest @@ -196,14 +211,13 @@ DEPENDENCIES net-smtp nkf ostruct - pathname pstore raap rake rake-compiler rbs! rbs-amber! - rdoc (~> 6.16) + rdoc rspec rubocop rubocop-on-rbs @@ -215,4 +229,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.6.3 + 4.0.0.dev diff --git a/Rakefile b/Rakefile index 06792575d..343704e8a 100644 --- a/Rakefile +++ b/Rakefile @@ -212,7 +212,14 @@ task :validate => :compile do end libs.each do |lib| - sh "#{ruby} #{rbs} -r #{lib} validate --exit-error-on-syntax-error" + args = ["-r", lib] + + if lib == "rbs" + args << "-r" + args << "prism" + end + + sh "#{ruby} #{rbs} #{args.join(' ')} validate --exit-error-on-syntax-error" end end diff --git a/bin/benchmark-parse.rb b/bin/benchmark-parse.rb index 98e4ce16d..64d4fd530 100644 --- a/bin/benchmark-parse.rb +++ b/bin/benchmark-parse.rb @@ -1,7 +1,6 @@ require "rbs" require "benchmark/ips" require "csv" -require "pathname" files = {} ARGV.each do |file| diff --git a/lib/rbs.rb b/lib/rbs.rb index d0b8d24d4..02bb50e4b 100644 --- a/lib/rbs.rb +++ b/lib/rbs.rb @@ -4,7 +4,7 @@ require "set" require "json" -require "pathname" +require "pathname" unless defined?(Pathname) require "pp" require "ripper" require "logger" diff --git a/steep/Gemfile.lock b/steep/Gemfile.lock index 4ca31fc47..a60d87257 100644 --- a/steep/Gemfile.lock +++ b/steep/Gemfile.lock @@ -80,4 +80,4 @@ DEPENDENCIES steep (~> 1.10.pre) BUNDLED WITH - 2.6.3 + 4.0.0.dev diff --git a/test/stdlib/Marshal_test.rb b/test/stdlib/Marshal_test.rb index 945ffa78a..f0d03fa0f 100644 --- a/test/stdlib/Marshal_test.rb +++ b/test/stdlib/Marshal_test.rb @@ -1,5 +1,4 @@ require_relative "test_helper" -require "pathname" require "tmpdir" class MarshalSingletonTest < Test::Unit::TestCase diff --git a/test/stdlib/zlib/GzipReader_test.rb b/test/stdlib/zlib/GzipReader_test.rb index d105a797c..6d2e288b6 100644 --- a/test/stdlib/zlib/GzipReader_test.rb +++ b/test/stdlib/zlib/GzipReader_test.rb @@ -1,7 +1,6 @@ require_relative "../test_helper" require "zlib" require "tempfile" -require "pathname" class ZlibGzipReaderSingletonTest < Test::Unit::TestCase include TestHelper From 79ad72220628b0fb8d9f5003b14aba0375464e78 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 11 Dec 2025 11:57:14 +0900 Subject: [PATCH 2/5] Fixup `Gemfile` for 3.10 --- Gemfile | 2 +- Gemfile.lock | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index a04a1b352..033a820f4 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem "json-schema" gem "goodcheck" gem 'digest' gem 'tempfile' -gem "rdoc", "~> 6.16" +gem "rdoc", "~> 6.16.0" gem "fileutils" gem "raap" gem "activesupport", "~> 7.0" diff --git a/Gemfile.lock b/Gemfile.lock index 890e0489a..2c64c708b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,8 @@ PATH remote: . specs: - rbs (4.0.0.dev.4) + rbs (3.9.5) logger - prism (>= 1.3.0) - tsort PATH remote: test/assets/test-gem @@ -57,7 +55,7 @@ GEM pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.16.0) + json (2.10.2) json-schema (6.0.0) addressable (~> 2.8) bigdecimal (~> 3.1) @@ -105,7 +103,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.15.1) + rdoc (6.16.1) erb psych (>= 4.0.0) tsort @@ -203,7 +201,7 @@ DEPENDENCIES fileutils goodcheck irb - json + json (~> 2.10.2) json-schema memory_profiler minitest @@ -217,7 +215,7 @@ DEPENDENCIES rake-compiler rbs! rbs-amber! - rdoc + rdoc (~> 6.16.0) rspec rubocop rubocop-on-rbs From 59eaf52fb4d373d9f51d68e185685e5e0b516dba Mon Sep 17 00:00:00 2001 From: Yuki Kurihara Date: Sat, 21 Jun 2025 12:55:25 +0000 Subject: [PATCH 3/5] Merge pull request #2559 from ksss/rbs-lint-duplicate_overload-argument Avoid overloading where arguments are identical --- core/encoding.rbs | 5 +++-- core/range.rbs | 3 +-- stdlib/ripper/0/ripper.rbs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/encoding.rbs b/core/encoding.rbs index 499ae039e..1cb2f41d3 100644 --- a/core/encoding.rbs +++ b/core/encoding.rbs @@ -923,8 +923,9 @@ class Encoding::Converter < Object # p ec.primitive_convert(src, dst, nil, 1) #=> :destination_buffer_full # p ec.last_error #=> nil # - def last_error: () -> Encoding::InvalidByteSequenceError? - | () -> Encoding::UndefinedConversionError? + def last_error: () -> ( Encoding::InvalidByteSequenceError + | Encoding::UndefinedConversionError + | nil ) # # - def to_a: () -> [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State, String ] - | () -> [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State ] + def to_a: () -> ( [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State, String ] + | [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State ] ) end class State From 6a1f0173c11f44d52df0c0f0fb826086e91aa56d Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Mon, 19 May 2025 06:25:21 +0000 Subject: [PATCH 4/5] Merge pull request #2496 from ruby/update-rubocop-on-rbs Update rubocop-on-rbs --- stdlib/ripper/0/ripper.rbs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/ripper/0/ripper.rbs b/stdlib/ripper/0/ripper.rbs index 0dd0bfed6..87e978275 100644 --- a/stdlib/ripper/0/ripper.rbs +++ b/stdlib/ripper/0/ripper.rbs @@ -911,6 +911,7 @@ class Ripper class CompileError < Error end + class Error < StandardError end @@ -927,6 +928,7 @@ class Ripper def match: (?untyped n) -> untyped end + class MatchError < Error end alias self.compile self.new @@ -949,6 +951,7 @@ class Ripper def map_tokens: (untyped tokens) -> untyped end + interface _Gets def gets: (?String sep, ?Integer limit) -> String? end From be46cf538d7b26e20575ebd67b5861a2ad0ee885 Mon Sep 17 00:00:00 2001 From: Yuki Kurihara Date: Fri, 7 Nov 2025 02:02:59 +0000 Subject: [PATCH 5/5] Merge pull request #2700 from ksss/update-fileutils-1.8.0 Update FileUtils to v1.8.0 --- test/stdlib/FileUtils_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/stdlib/FileUtils_test.rb b/test/stdlib/FileUtils_test.rb index d617aafce..437616c3f 100644 --- a/test/stdlib/FileUtils_test.rb +++ b/test/stdlib/FileUtils_test.rb @@ -360,8 +360,8 @@ def test_ln_sr FileUtils, :ln_sr, ToStr.new("src"), ToStr.new("dest"), noop: true assert_send_type "(ToPath, ToPath, noop: bool) -> void", FileUtils, :ln_sr, ToPath.new("src"), ToPath.new("dest"), noop: true - assert_send_type "(Array[String | ToStr | ToPath], String, noop: bool, verbose: bool, target_directory: false) -> void", - FileUtils, :ln_sr, ["src", ToStr.new("src"), ToStr.new("src")], "dest_dir", noop: true, verbose: false, target_directory: false + assert_send_type "(Array[String | ToStr | ToPath], String, noop: bool, verbose: bool, target_directory: true) -> void", + FileUtils, :ln_sr, ["src", ToStr.new("src"), ToStr.new("src")], "dest_dir", noop: true, verbose: false, target_directory: true end end