public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-actionview] rawhide: Backport upstream patch to make testsuite compatible with ruby4.1 Prism change
@ 2026-11-13  7:40 Mamoru TASAKA
  0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-11-13  7:40 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rubygem-actionview
Branch : rawhide
Commit : 449c2f205a10214d4958569f603844753cbb2494
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-11-13T16:40:23+09:00
Stats  : +60/-4 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-actionview/c/449c2f205a10214d4958569f603844753cbb2494?branch=rawhide

Log:
Backport upstream patch to make testsuite compatible with ruby4.1 Prism change

---
diff --git a/actionview-pr59034-prism-ruby41-compat.patch b/actionview-pr59034-prism-ruby41-compat.patch
new file mode 100644
index 0000000..1310e06
--- /dev/null
+++ b/actionview-pr59034-prism-ruby41-compat.patch
@@ -0,0 +1,48 @@
+From cec2fc2892ec968f736d68bff54fc5fc262efe70 Mon Sep 17 00:00:00 2001
+From: Yasuo Honda <yasuo.honda@gmail.com>
+Date: Sun, 11 Oct 2026 12:17:37 +0900
+Subject: [PATCH 2/2] Use Ruby::Prism in ActionView::Template#spot when
+ available
+
+Ruby 4.1 builds prism into the interpreter as Ruby::Prism [Feature #22379],
+and error_highlight now spots nodes with it, accepting only Ruby::Prism
+nodes (ruby/error_highlight#85). Template#spot parsed the compiled source
+with the prism gem, so ErrorHighlight.spot raised
+`TypeError: Exception is expected` while building the debug page, and the
+public 500 page was shown instead without logging the cause.
+
+Parse with Ruby::Prism when it is defined. It is the parser that compiled
+the template, so its node ids always match the backtrace location. Older
+Rubies keep using the prism gem.
+
+Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
+---
+ actionview/CHANGELOG.md                |  8 ++++++++
+ actionview/lib/action_view/template.rb | 13 +++++++++----
+ 2 files changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
+index 2429f68f474a5..e8a781e62e46f 100644
+--- a/actionview/lib/action_view/template.rb
++++ b/actionview/lib/action_view/template.rb
+@@ -255,11 +255,16 @@ def spot(location) # :nodoc:
+       node_id = RubyVM::AbstractSyntaxTree.node_id_for_backtrace_location(location)
+       found =
+         if RubyVM::InstructionSequence.compile("").to_a[4][:parser] == :prism
+-          require "prism"
+-
+-          if Prism::VERSION >= "1.0.0"
+-            result = Prism.parse(compiled_source).value
++          if defined?(Ruby::Prism)
++            result = Ruby::Prism.parse(compiled_source).value
+             result.breadth_first_search { |node| node.node_id == node_id }
++          else
++            require "prism"
++
++            if Prism::VERSION >= "1.0.0"
++              result = Prism.parse(compiled_source).value
++              result.breadth_first_search { |node| node.node_id == node_id }
++            end
+           end
+         else
+           node = RubyVM::AbstractSyntaxTree.parse(compiled_source, keep_script_lines: true)

diff --git a/rubygem-actionview.spec b/rubygem-actionview.spec
index 8258eeb..ae6c953 100644
--- a/rubygem-actionview.spec
+++ b/rubygem-actionview.spec
@@ -5,7 +5,7 @@
 
 Name: rubygem-%{gem_name}
 Version: 8.1.3.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: Rendering framework putting the V in MVC (part of Rails)
 License: MIT
 URL: https://rubyonrails.org
@@ -15,6 +15,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem
 # git clone http://github.com/rails/rails.git && cd rails/actionview
 # git archive -v -o actionview-8.1.3.1-tests.tar.gz v8.1.3.1 test/
 Source1: %{gem_name}-%{version}%{?prerelease}-tests.tar.gz
+# https://github.com/rails/rails/pull/59034
+# Use Ruby::Prism for ruby4.1
+Patch0:  %{gem_name}-pr59034-prism-ruby41-compat.patch
 BuildRequires: ruby(release)
 BuildRequires: rubygems-devel
 %if %{without bootstrap}
@@ -42,7 +45,8 @@ BuildArch: noarch
 Documentation for %{name}.
 
 %prep
-%setup -q -n %{gem_name}-%{version}%{?prerelease} -b1
+%setup -q -n %{gem_name}-%{version}%{?prerelease} -a 1
+%patch 0 -p2
 
 %build
 gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
@@ -59,8 +63,9 @@ cp -a .%{gem_dir}/* \
 # This requires activerecord in rails git structure
 ln -s %{gem_dir}/gems/activerecord-%{version}%{?prerelease}/ .%{gem_dir}/gems/activerecord
 
-( cd .%{gem_instdir}
-cp -a %{builddir}/test .
+( 
+cp -a test .%{gem_instdir}
+cd .%{gem_instdir}
 
 mkdir ../tools
 # Fake test_common.rb. It does not provide any functionality besides
@@ -96,6 +101,9 @@ find test -type f -name '*_test.rb' -print0 | \
 %doc %{gem_instdir}/README.rdoc
 
 %changelog
+* Fri Nov 13 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 8.1.3.1-2
+- Backport upstream patch to make testsuite compatible with ruby4.1 Prism change
+
 * Mon Aug 03 2026 Vít Ondruch <vondruch@redhat.com> - 8.1.3.1-1
 - Update to Action View 8.1.3.1.
   Related: rhzb#2405582

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13  7:40 [rpms/rubygem-actionview] rawhide: Backport upstream patch to make testsuite compatible with ruby4.1 Prism change Mamoru TASAKA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox