From 49a98e6442983b25e392913aad6eb187480a9aa9 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 13 Apr 2026 21:27:07 +0200 Subject: [PATCH] Because truffleruby now uses prism itself for its ripper implementation, the templates need to be created beforehand. So, move the ripper require inside the tasks itself, after which the templates have been created. Example failure: https://github.com/ruby/prism/actions/runs/24358711087/job/71132405299 ``` LoadError: cannot load such file -- /home/runner/work/prism/prism/lib/prism/node (LoadError) /home/runner/work/prism/prism/lib/prism.rb:127:in '' /home/runner/work/prism/prism/rakelib/lex.rake:4:in '' /home/runner/work/prism/prism/vendor/bundle/truffleruby/34.0.0.1/gems/rake-13.3.1/exe/rake:27:in '' /home/runner/.rubies/truffleruby-34.0.0/bin/bundle:25:in '
' (See full trace by running task with --trace) ``` `lex.rake:4` is `require "ripper"` --- rakelib/lex.rake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rakelib/lex.rake b/rakelib/lex.rake index 60cb4f87b9..a88589a593 100644 --- a/rakelib/lex.rake +++ b/rakelib/lex.rake @@ -1,8 +1,6 @@ # frozen_string_literal: true # typed: ignore -require "ripper" - module Prism # This class is responsible for lexing files with both prism and # ripper and ensuring they match up. It keeps track of the files which @@ -150,6 +148,7 @@ TARGETS.each do |name, target| task "lex:#{name}" => [dirpath, :compile] do $:.unshift(File.expand_path("../lib", __dir__)) require "prism" + require "ripper" plain_text = ENV.fetch("CI", false) warn_failing = ENV.fetch("VERBOSE", false) @@ -192,6 +191,7 @@ desc "Lex files and compare with lex_compat" task lex: :compile do $:.unshift(File.expand_path("../lib", __dir__)) require "prism" + require "ripper" plain_text = ENV.fetch("CI", false) warn_failing = ENV.fetch("VERBOSE", false) @@ -225,6 +225,7 @@ task "lex:rubygems": [:compile, "tmp/failing"] do require "rubygems/package" require "tmpdir" require "prism" + require "ripper" items = [] Gem::SpecFetcher.new.available_specs(:latest).first.each do |source, gems| @@ -366,6 +367,7 @@ task "lex:topgems": ["download:topgems", :compile] do require "rubygems/package" require "tmpdir" require "prism" + require "ripper" gem_names = YAML.safe_load_file(TOP_100_GEM_FILENAME) failing_files = {}