Update to ActiveSupport 6.0.3.1

also enhance .spec file.
Resolves: rhbz#1742797
f38
Pavel Valena 5 years ago
parent 3144928494
commit 60be59131a

3
.gitignore vendored

@ -1,2 +1,3 @@
/activesupport-*.gem /activesupport-*.gem
/activesupport-*-tests.tgz /activesupport-*-tests.txz
/rails-*-tools.txz

@ -1,54 +0,0 @@
From 4f4f8a705a8e713bceee8cacca52e9bce22e28dc Mon Sep 17 00:00:00 2001
From: "yuuji.yaginuma" <yuuji.yaginuma@gmail.com>
Date: Wed, 18 Dec 2019 19:00:29 +0900
Subject: [PATCH] Make `LoadInterlockAwareMonitor` work in Ruby 2.7
Currently `LoadInterlockAwareMonitorTest` does not pass with Ruby 2.7 [1].
This is due to the refactoring of the `monitor` done in Ruby 2.7 [2].
With this refactoring, the behavior of the method has changed from the
expected behavior in `LoadInterlockAwareMonitor`.
This patch also overwrites `synchronize` so that
`LoadInterlockAwareMonitor` works as expected.
[1]: https://buildkite.com/rails/rails/builds/65877#eec47af5-7595-47cb-97c0-30c589716176/996-2743
[2]: https://bugs.ruby-lang.org/issues/16255
---
.../load_interlock_aware_monitor.rb | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb b/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb
index a8455c00483f..480c34c64017 100644
--- a/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb
+++ b/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb
@@ -7,11 +7,29 @@ module Concurrency
# A monitor that will permit dependency loading while blocked waiting for
# the lock.
class LoadInterlockAwareMonitor < Monitor
+ EXCEPTION_NEVER = { Exception => :never }.freeze
+ EXCEPTION_IMMEDIATE = { Exception => :immediate }.freeze
+ private_constant :EXCEPTION_NEVER, :EXCEPTION_IMMEDIATE
+
# Enters an exclusive section, but allows dependency loading while blocked
def mon_enter
mon_try_enter ||
ActiveSupport::Dependencies.interlock.permit_concurrent_loads { super }
end
+
+ def synchronize
+ Thread.handle_interrupt(EXCEPTION_NEVER) do
+ mon_enter
+
+ begin
+ Thread.handle_interrupt(EXCEPTION_IMMEDIATE) do
+ yield
+ end
+ ensure
+ mon_exit
+ end
+ end
+ end
end
end
end

@ -54,7 +54,7 @@ index 3be5f6f7b595..9a4c33ab0f19 100644
end end
# Returns a string of the object's date, time, zone, and offset from UTC. # Returns a string of the object's date, time, zone, and offset from UTC.
@@ -514,6 +514,16 @@ def method_missing(sym, *args, &block) @@ -524,6 +524,16 @@ def method_missing(sym, *args, &block)
end end
private private
@ -91,7 +91,7 @@ index 90830b89bda3..2e5d9d3e9d4c 100644
- create(tz_id, nil, TZInfo::Timezone.new(tz_id)) - create(tz_id, nil, TZInfo::Timezone.new(tz_id))
+ create(tz_id, nil, TZInfo::Timezone.get(tz_id)) + create(tz_id, nil, TZInfo::Timezone.get(tz_id))
end end
end.flatten(1).sort! end.sort!
end end
@@ -302,11 +302,7 @@ def initialize(name, utc_offset = nil, tzinfo = nil) @@ -302,11 +302,7 @@ def initialize(name, utc_offset = nil, tzinfo = nil)
@ -106,7 +106,7 @@ index 90830b89bda3..2e5d9d3e9d4c 100644
end end
# Returns a formatted string of the offset from UTC, or an alternative # Returns a formatted string of the offset from UTC, or an alternative
@@ -498,7 +494,9 @@ def yesterday @@ -503,7 +499,9 @@ def yesterday
# represented by +self+. Returns a Time.utc() instance -- if you want an # represented by +self+. Returns a Time.utc() instance -- if you want an
# ActiveSupport::TimeWithZone instance, use Time#in_time_zone() instead. # ActiveSupport::TimeWithZone instance, use Time#in_time_zone() instead.
def utc_to_local(time) def utc_to_local(time)

@ -1,23 +1,25 @@
%global gem_name activesupport %global gem_name activesupport
#%%global prerelease .rc1
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Epoch: 1 Epoch: 1
Version: 5.2.3 Version: 6.0.3.1
Release: 5%{?dist} Release: 1%{?dist}
Summary: A support libraries and Ruby core extensions extracted from the Rails framework Summary: A support libraries and Ruby core extensions extracted from the Rails framework
License: MIT License: MIT
URL: http://rubyonrails.org URL: http://rubyonrails.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem
# The activesupport gem doesn't ship with the test suite.
# The activesupport gem doesn't ship with the test suite like the other # You may check it out like so
# Rails rpms, you may check it out like so
# git clone http://github.com/rails/rails.git # git clone http://github.com/rails/rails.git
# cd rails/activesupport/ # cd rails/activesupport && git archive -v -o activesupport-6.0.3.1-tests.txz v6.0.3.1 test/
# git checkout v5.2.3 && tar czvf activesupport-5.2.3-tests.tgz test/ Source1: %{gem_name}-%{version}%{?prerelease}-tests.txz
Source1: %{gem_name}-%{version}-tests.tgz # The tools are needed for the test suite, are however unpackaged in gem file.
# Make `LoadInterlockAwareMonitor` work in Ruby 2.7 # You may get them like so
# https://github.com/rails/rails/pull/38069 # git clone http://github.com/rails/rails.git --no-checkout
Patch0: rubygem-activesupport-6.1.0-Make-LoadInterlockAwareMonitor-work-in-Ruby-2.7.patch # cd rails && git archive -v -o rails-6.0.3.1-tools.txz v6.0.3.1 tools/
Source2: rails-%{version}%{?prerelease}-tools.txz
# Fix TZInfo 2.0 compatibility. # Fix TZInfo 2.0 compatibility.
# https://github.com/rails/rails/pull/34799 # https://github.com/rails/rails/pull/34799
# https://github.com/rails/rails/pull/38081 # https://github.com/rails/rails/pull/38081
@ -62,9 +64,8 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%prep %prep
%setup -q -n %{gem_name}-%{version} -b 1 %setup -q -n %{gem_name}-%{version}%{?prerelease} -b1 -b2
%patch0 -p2
%patch1 -p2 %patch1 -p2
pushd %{_builddir} pushd %{_builddir}
@ -75,8 +76,7 @@ popd
%gemspec_add_dep -g tzinfo [">= 1.1", "< 3"] %gemspec_add_dep -g tzinfo [">= 1.1", "< 3"]
%build %build
gem build ../%{gem_name}-%{version}.gemspec gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
%gem_install %gem_install
%install %install
@ -87,7 +87,8 @@ cp -a .%{gem_dir}/* \
%check %check
pushd .%{gem_instdir} pushd .%{gem_instdir}
# Move the tests into place # Move the tests into place
cp -a %{_builddir}/test test ln -s %{_builddir}/tools ..
mv %{_builddir}/test .
# These tests are really unstable, but they seems to be passing upstream :/ # These tests are really unstable, but they seems to be passing upstream :/
for f in \ for f in \
@ -126,6 +127,10 @@ popd
%doc %{gem_instdir}/README.rdoc %doc %{gem_instdir}/README.rdoc
%changelog %changelog
* Mon Aug 03 07:01:37 GMT 2020 Pavel Valena <pvalena@redhat.com> - 6.0.3.1-1
- Update to ActiveSupport 6.0.3.1.
Resolves: rhbz#1742797
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.2.3-5 * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.2.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

@ -1,2 +1,3 @@
SHA512 (activesupport-5.2.3.gem) = 8e0ab698f1b850c380ffc464fd48c942f4a46b9ca66055166949fa069740a4ff50f320d87f1040064a896c5ba1b8c00f0730592efec90d92a20c500d66b99589 SHA512 (activesupport-6.0.3.1.gem) = b4b80a2fd08f4dc62a22b8946a91e81116e07a275d2ab75cb7021aa8f3481816ce32b5a598eb532235fe2e686cb1a000fad1667ab4d9561cd01a7e682244f6f8
SHA512 (activesupport-5.2.3-tests.tgz) = 853650145304f21d37172097d8fa31866a33d754a61bcc4bebcb51e4ad4cda58d6757d2526ff073118cf3cd56494b93857050a9e2f1ea08ea0e361b7fec32be7 SHA512 (activesupport-6.0.3.1-tests.txz) = 38e34723040d209fb11aaf6b7c01a4e6bafceb1c6a53417dffc2f154996ba66cf80775b2e6f040548920537f27057c19bd3f09493a4de0bf99eb70be4ce2b6a3
SHA512 (rails-6.0.3.1-tools.txz) = e461674faf787a4f488e93b43747f829b9ea764167ac4782190ac469c4b0941e307e0a72b786a8392c00df1221d02622ffd4b29d7ea43e6c018daf463e092f6a

Loading…
Cancel
Save