public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-activesupport] rawhide: Backport upstream fix for compatibility with json 2.20 / 3.0
@ 2026-09-22 3:30 Mamoru TASAKA
0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-09-22 3:30 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rubygem-activesupport
Branch : rawhide
Commit : ed45cc447dfa4ddc4862139b32ccaf639de704c0
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date : 2026-09-22T12:26:15+09:00
Stats : +84/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/rubygem-activesupport/c/ed45cc447dfa4ddc4862139b32ccaf639de704c0?branch=rawhide
Log:
Backport upstream fix for compatibility with json 2.20 / 3.0
---
diff --git a/rubygem-activesupport-pr57832-json2_20-allow-comments.patch b/rubygem-activesupport-pr57832-json2_20-allow-comments.patch
new file mode 100644
index 0000000..d3abe26
--- /dev/null
+++ b/rubygem-activesupport-pr57832-json2_20-allow-comments.patch
@@ -0,0 +1,43 @@
+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/activesupport/lib/active_support/messages/serializer_with_fallback.rb b/activesupport/lib/active_support/messages/serializer_with_fallback.rb
+index 2254237a917ac..f9a1f9ea0f6c7 100644
+--- a/activesupport/lib/active_support/messages/serializer_with_fallback.rb
++++ b/activesupport/lib/active_support/messages/serializer_with_fallback.rb
+@@ -88,7 +88,7 @@ def dump(object)
+ end
+
+ def _load(dumped)
+- ActiveSupport::JSON.decode(dumped)
++ ActiveSupport::JSON.decode(dumped, allow_comments: true)
+ end
+
+ JSON_START_WITH = /\A(?:[{\["]|-?\d|true|false|null)/
+
diff --git a/rubygem-activesupport-pr58601-json3-compat.patch b/rubygem-activesupport-pr58601-json3-compat.patch
new file mode 100644
index 0000000..e41d38c
--- /dev/null
+++ b/rubygem-activesupport-pr58601-json3-compat.patch
@@ -0,0 +1,29 @@
+From cc07aa3153e3bd47151b6bbaa0f39347b0feb4bc Mon Sep 17 00:00:00 2001
+From: Earlopain <14981592+Earlopain@users.noreply.github.com>
+Date: Fri, 28 Aug 2026 17:55:05 +0200
+Subject: [PATCH 1/2] Fix compatibility with json 3.0 in activesupport
+
+It needs keywords arguments now.
+
+I guess the method signature should really be `def decode(...)` and just pass stuff along
+but theres a test that a hash works and there's also the `encode` equivalent.
+
+Either way, this works with both versions.
+---
+ activesupport/lib/active_support/json/decoding.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
+index 420eef2485f9e..f19e5d8fbeeb1 100644
+--- a/activesupport/lib/active_support/json/decoding.rb
++++ b/activesupport/lib/active_support/json/decoding.rb
+@@ -22,7 +22,7 @@ class << self
+ # ActiveSupport::JSON.decode("2.39")
+ # # => 2.39
+ def decode(json, options = {})
+- data = ::JSON.parse(json, options)
++ data = ::JSON.parse(json, **options)
+
+ if ActiveSupport.parse_json_times
+ convert_dates_from(data)
+
diff --git a/rubygem-activesupport.spec b/rubygem-activesupport.spec
index 8011781..df5519a 100644
--- a/rubygem-activesupport.spec
+++ b/rubygem-activesupport.spec
@@ -5,7 +5,7 @@
Name: rubygem-%{gem_name}
Epoch: 1
Version: 8.1.3.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A support libraries and Ruby core extensions extracted from the Rails framework
License: MIT
URL: https://rubyonrails.org
@@ -21,6 +21,12 @@ Source2: https://raw.githubusercontent.com/rails/rails/refs/tags/v8.1.2/tools/st
Source3: https://raw.githubusercontent.com/rails/rails/e25d738430bdc6bdd04cd28be705484ea953e74e/tools/test_common.rb
# We don't always install railties with activesupport, so rescue this
Patch3: rubygem-activesupport-pr56202-minitest6-rescue-loaderror.patch
+# Fix compatibility with json 2.20 with allowing comments
+# https://github.com/rails/rails/pull/57832
+Patch4: rubygem-activesupport-pr57832-json2_20-allow-comments.patch
+# Fix compatibility with json 3.0
+# https://github.com/rails/rails/pull/58601
+Patch5: rubygem-activesupport-pr58601-json3-compat.patch
# Runtime dependency, lot of build failures in other packages.
# https://fedoraproject.org/wiki/Changes/AllowRemovalOfTzdata
@@ -69,6 +75,8 @@ Documentation for %{name}.
%setup -q -n %{gem_name}-%{version}%{?prerelease} -a 1
%patch 3 -p1
+%patch 4 -p2
+%patch 5 -p2
# lib/active_support/testing/method_call_assertions.rb
# always needs minitest/mock
@@ -129,6 +137,9 @@ kill -INT $(cat $VALKEY_DIR/valkey.pid)
%doc %{gem_instdir}/README.rdoc
%changelog
+* Fri Sep 11 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:8.1.3.1-2
+- Backport upstream fix for compatibility with json 2.20 / 3.0
+
* Mon Aug 03 2026 Vít Ondruch <vondruch@redhat.com> - 1:8.1.3.1-1
- Update to Active Support 8.1.3.1.
Related: rhzb#2405582
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-22 3:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 3:30 [rpms/rubygem-activesupport] rawhide: Backport upstream fix for compatibility with json 2.20 / 3.0 Mamoru TASAKA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox