public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-railties] rawhide: Backport upstream fix to support json 2.20
@ 2026-09-20 14:33 Mamoru TASAKA
0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-09-20 14:33 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rubygem-railties
Branch : rawhide
Commit : 9c34799a489aa4a4a65b162bddf2961edf3a221b
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date : 2026-09-20T23:33:22+09:00
Stats : +67/-6 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rubygem-railties/c/9c34799a489aa4a4a65b162bddf2961edf3a221b?branch=rawhide
Log:
Backport upstream fix to support json 2.20
---
diff --git a/rubygem-railties-pr57832-support-json-2_20.patch b/rubygem-railties-pr57832-support-json-2_20.patch
new file mode 100644
index 0000000..1080c89
--- /dev/null
+++ b/rubygem-railties-pr57832-support-json-2_20.patch
@@ -0,0 +1,55 @@
+From 9e61b1baa6ffbacacffcea7c9cb33217cb327a73 Mon Sep 17 00:00:00 2001
+From: Yasuo Honda <yasuo.honda@gmail.com>
+Date: Wed, 24 Jun 2026 08:45:57 +0900
+Subject: [PATCH] Bump json to 2.20.0 and pass `allow_comments: true`
+
+json 2.20.0 (ruby/json#1001, commit 138b9a2c) deprecates the parser's
+default support for JavaScript comments in favor of an `allow_comments: true`
+option. Parsing comment-bearing JSON without it now warns that it "will raise
+an error in json 3.0 unless enabled via `allow_comments: true`", which fails
+Active Support and Railties under the test suite's warnings-as-errors mode.
+
+Pass `allow_comments: true` at the parse sites that intentionally read
+comment-bearing JSON:
+
+- Active Support's JSON message serializer fallback `_load`, which is
+ documented to load irregular JSON (the test feeds it a leading
+ `/* comment */`).
+- Railties' devcontainer.json, which is JSONC by spec: the
+ `db:system:change` generator that re-reads it, and the generator test
+ helper that asserts on the generated file.
+
+Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
+---
+ Gemfile.lock | 4 ++--
+ .../lib/active_support/messages/serializer_with_fallback.rb | 2 +-
+ .../generators/rails/db/system/change/change_generator.rb | 2 +-
+ railties/test/generators/generators_test_helper.rb | 2 +-
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/railties/lib/rails/generators/rails/db/system/change/change_generator.rb b/railties/lib/rails/generators/rails/db/system/change/change_generator.rb
+index 7f3c001a53986..ab43a67239346 100644
+--- a/railties/lib/rails/generators/rails/db/system/change/change_generator.rb
++++ b/railties/lib/rails/generators/rails/db/system/change/change_generator.rb
+@@ -183,7 +183,7 @@ def update_devcontainer_db_feature
+ def devcontainer_json
+ return unless File.exist?(devcontainer_json_path)
+
+- @devcontainer_json ||= JSON.parse(File.read(devcontainer_json_path))
++ @devcontainer_json ||= JSON.parse(File.read(devcontainer_json_path), allow_comments: true)
+ end
+
+ def devcontainer_json_path
+diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb
+index 6447e185ceef0..a5a75cc7ece10 100644
+--- a/railties/test/generators/generators_test_helper.rb
++++ b/railties/test/generators/generators_test_helper.rb
+@@ -131,7 +131,7 @@ def assert_compose_file
+
+ def assert_devcontainer_json_file
+ assert_file ".devcontainer/devcontainer.json" do |content|
+- yield JSON.load(content)
++ yield JSON.load(content, allow_comments: true)
+ rescue JSON::ParserError
+ puts "Failed to parse JSON: #{content}"
+ raise
diff --git a/rubygem-railties.spec b/rubygem-railties.spec
index 8f31201..28eaed6 100644
--- a/rubygem-railties.spec
+++ b/rubygem-railties.spec
@@ -6,7 +6,7 @@
Name: rubygem-%{gem_name}
Version: 8.1.3.1
-Release: 2%{?dist}
+Release: 2.100%{?dist}
Summary: Tools for creating, working with, and running Rails applications
License: MIT
URL: https://rubyonrails.org
@@ -32,6 +32,9 @@ Patch0: rubygem-railties-8.1.3-Fix-test_precompile_shouldnt_use_the_digests_pres
# ~~~
# https://github.com/rails/rails/pull/58360
Patch1: rubygem-railties-8.1.3.1-Use-local-fixtures.patch
+# Support json 2.20 and above
+# https://github.com/rails/rails/pull/57832
+Patch2: rubygem-railties-pr57832-support-json-2_20.patch
# dbconsole requires the executable.
Suggests: %{_bindir}/sqlite3
@@ -103,12 +106,11 @@ BuildArch: noarch
Documentation for %{name}.
%prep
-%setup -q -n %{gem_name}-%{version}%{?prerelease} -b1
+%setup -q -n %{gem_name}-%{version}%{?prerelease} -a1
-( cd %{builddir}
%patch 0 -p2
%patch 1 -p2
-)
+%patch 2 -p2
%build
gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
@@ -132,8 +134,9 @@ find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x
ln -s %{gem_dir}/specifications/rails-%{version}%{?prerelease}.gemspec .%{gem_dir}/gems/rails.gemspec
ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/railties
-( cd .%{gem_dir}/gems/railties
-cp -a %{builddir}/test .
+(
+cp -a test .%{gem_dir}/gems/railties
+cd .%{gem_dir}/gems/railties
mkdir ../tools
# Fake test_common.rb. It does not provide any functionality besides
@@ -308,6 +311,9 @@ rm -rf ${PG_DIR}
%doc %{gem_instdir}/README.rdoc
%changelog
+* Sun Sep 20 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 8.1.3.1-3
+- Backport upstream fix to support json 2.20
+
* Wed Aug 05 2026 Vít Ondruch <vondruch@redhat.com> - 8.1.3.1-2
- Properly patch ActiveStorage analyzers integration tests.
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-20 14:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 14:33 [rpms/rubygem-railties] rawhide: Backport upstream fix to support json 2.20 Mamoru TASAKA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox