summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-04-06 08:04:55 +0100
committerSam James <sam@gentoo.org>2023-04-07 03:47:56 +0100
commitfb30c593d58df4146f1f01be62ab3af26c291b49 (patch)
tree087de330851fbc94e63ebe13d752b367b7b49970 /dev-ruby/activesupport
parentdev-ruby/activestorage: adapt to slotted dev-ruby/minitest (diff)
downloadgentoo-fb30c593d58df4146f1f01be62ab3af26c291b49.tar.gz
gentoo-fb30c593d58df4146f1f01be62ab3af26c291b49.tar.bz2
gentoo-fb30c593d58df4146f1f01be62ab3af26c291b49.zip
dev-ruby/activesupport: enable ruby32 for 6.1.x
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-ruby/activesupport')
-rw-r--r--dev-ruby/activesupport/activesupport-6.1.7.3-r1.ebuild6
-rw-r--r--dev-ruby/activesupport/files/activesupport-6.1.7.3-ruby-thread-noise.patch41
2 files changed, 46 insertions, 1 deletions
diff --git a/dev-ruby/activesupport/activesupport-6.1.7.3-r1.ebuild b/dev-ruby/activesupport/activesupport-6.1.7.3-r1.ebuild
index 268c519f718c..2e4c315427ab 100644
--- a/dev-ruby/activesupport/activesupport-6.1.7.3-r1.ebuild
+++ b/dev-ruby/activesupport/activesupport-6.1.7.3-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-USE_RUBY="ruby27 ruby30 ruby31"
+USE_RUBY="ruby27 ruby30 ruby31 ruby32"
RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.rdoc"
@@ -45,6 +45,10 @@ ruby_add_bdepend "test? (
dev-ruby/mocha
)"
+PATCHES=(
+ "${FILESDIR}"/${PN}-6.1.7.3-ruby-thread-noise.patch
+)
+
all_ruby_prepare() {
# Set the secure permissions that tests expect.
chmod 0755 "${HOME}" || die "Failed to fix permissions on home"
diff --git a/dev-ruby/activesupport/files/activesupport-6.1.7.3-ruby-thread-noise.patch b/dev-ruby/activesupport/files/activesupport-6.1.7.3-ruby-thread-noise.patch
new file mode 100644
index 000000000000..dabe1331a307
--- /dev/null
+++ b/dev-ruby/activesupport/files/activesupport-6.1.7.3-ruby-thread-noise.patch
@@ -0,0 +1,41 @@
+https://github.com/rails/rails/commit/60fc40ea58de8b6faf98081d659e7f5b232aa25e
+
+From 60fc40ea58de8b6faf98081d659e7f5b232aa25e Mon Sep 17 00:00:00 2001
+From: Jonathan Hefner <jonathan@hefner.pro>
+Date: Thu, 22 Jul 2021 13:45:57 -0500
+Subject: [PATCH] Isolate descendants garbage collection test
+
+This prevents the test from being affected by Ruby-internal thread
+locals set by other tests.
+
+Example failure: https://buildkite.com/rails/rails/builds/79505#cb261462-8e40-4adc-99fc-81708a473cc6/1076-1085
+
+Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
+--- a/test/descendants_tracker_test_cases.rb
++++ b/test/descendants_tracker_test_cases.rb
+@@ -28,11 +28,23 @@ def test_descendants
+ end
+
+ def test_descendants_with_garbage_collected_classes
+- 1.times do
++ # The Ruby GC (and most other GCs for that matter) are not fully precise.
++ # When GC is run, the whole stack is scanned to mark any object reference
++ # in registers. But some of these references might simply be leftovers from
++ # previous method calls waiting to be overridden, and there's no definite
++ # way to clear them. By executing this code in a distinct thread, we ensure
++ # that such references are on a stack that will be entirely garbage
++ # collected, effectively working around the problem.
++ Thread.new do
+ child_klass = Class.new(Parent)
+ assert_equal_sets [Child1, Grandchild1, Grandchild2, Child2, child_klass], Parent.descendants
++ end.join
++
++ # Calling `GC.start` 4 times should trigger a full GC run
++ 4.times do
++ GC.start
+ end
+- GC.start
++
+ assert_equal_sets [Child1, Grandchild1, Grandchild2, Child2], Parent.descendants
+ end
+