Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Pavel Valena
202466882b Update to activesupport 6.0.3.4.
Resolves: rhbz#1886136
2020-10-13 16:03:57 +02:00
Pavel Valena
5627aa7ab6 Update to activesupport 6.0.3.3.
Disable test_filename_max_size

which is failing in koji.

Properly fix flaky `FileStoreTest#test_filename_max_size` test case.

Fix evaluator test from web-console.

https://github.com/rails/rails/issues/40196
https://github.com/rails/web-console/issues/301

Resolves: rhbz#1877502
2020-09-29 12:42:03 +02:00
5 changed files with 122 additions and 6 deletions

View file

@ -0,0 +1,42 @@
From 3fed62cfb1f43d8df5a5ff31229a5ad03264186e Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@hawthorn.email>
Date: Fri, 17 Jan 2020 11:12:32 -0800
Subject: [PATCH] Reduce FILENAME_MAX_SIZE to accomodate large PIDs
The max size here is designed around Ruby's Dir::Tmpname.create which
creates temporary filenames in the format
$TIMESTAMP-$PID-$RANDOM
I believe the previous value of this field was based on the assumption
that PIDs are 1-65535, which isn't necessarily the case on 64 bit Linux
systems, which can be up to 2**22.
$ uname -a
Linux zergling 5.4.11-arch1-1 #1 SMP PREEMPT Sun, 12 Jan 2020 12:15:27 +0000 x86_64 GNU/Linux
$ cat /proc/sys/kernel/pid_max
4194304
I've chosen a new value based on what I believe the largest possible
tempname is:
255 - "20200117-4194304-#{0x100000000.to_s(36)}.lock".length #=> 226
(cherry picked from commit a98f330fb138fe4a78c270788218309849440026)
---
activesupport/lib/active_support/cache/file_store.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb
index cbce9d891533..8b248efd14de 100644
--- a/activesupport/lib/active_support/cache/file_store.rb
+++ b/activesupport/lib/active_support/cache/file_store.rb
@@ -16,7 +16,7 @@ class FileStore < Store
attr_reader :cache_path
DIR_FORMATTER = "%03X"
- FILENAME_MAX_SIZE = 228 # max filename size on file system is 255, minus room for timestamp and random characters appended by Tempfile (used by atomic write)
+ FILENAME_MAX_SIZE = 226 # max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write)
FILEPATH_MAX_SIZE = 900 # max is 1024, plus some room
GITKEEP_FILES = [".gitkeep", ".keep"].freeze

View file

@ -0,0 +1,28 @@
From 5611f4b430881bcfa788044ff3f42118370c61a2 Mon Sep 17 00:00:00 2001
From: Jonathan Hefner <jonathan@hefner.pro>
Date: Mon, 7 Sep 2020 16:44:21 -0500
Subject: [PATCH] Anchor BacktraceCleaner gem filter regexp
This ensures the default gem filter does not affect backtrace lines that
have a subpath incidentally matching a gem path.
Fixes #40196.
---
activesupport/test/clean_backtrace_test.rb | 6 ++++++
1 files changed, 6 insertions(+)
diff --git a/activesupport/test/clean_backtrace_test.rb b/activesupport/test/clean_backtrace_test.rb
index a846312d68f2..dd62ef359b73 100644
--- a/activesupport/test/clean_backtrace_test.rb
+++ b/activesupport/test/clean_backtrace_test.rb
@@ -124,4 +124,10 @@ def setup
result = @bc.clean(backtrace)
assert_empty result
end
+
+ test "should preserve lines that have a subpath matching a gem path" do
+ backtrace = [Gem.default_dir, *Gem.path].map { |path| "/parent#{path}/gems/nosuchgem-1.2.3/lib/foo.rb" }
+
+ assert_equal backtrace, @bc.clean(backtrace)
+ end
end

View file

@ -0,0 +1,26 @@
From 5611f4b430881bcfa788044ff3f42118370c61a2 Mon Sep 17 00:00:00 2001
From: Jonathan Hefner <jonathan@hefner.pro>
Date: Mon, 7 Sep 2020 16:44:21 -0500
Subject: [PATCH] Anchor BacktraceCleaner gem filter regexp
This ensures the default gem filter does not affect backtrace lines that
have a subpath incidentally matching a gem path.
Fixes #40196.
---
activesupport/lib/active_support/backtrace_cleaner.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletion(-)
diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb
index ad80b8855f3f..405db9a6fe6c 100644
--- a/activesupport/lib/active_support/backtrace_cleaner.rb
+++ b/activesupport/lib/active_support/backtrace_cleaner.rb
@@ -91,7 +91,7 @@ def add_gem_filter
gems_paths = (Gem.path | [Gem.default_dir]).map { |p| Regexp.escape(p) }
return if gems_paths.empty?
- gems_regexp = %r{(#{gems_paths.join('|')})/(bundler/)?gems/([^/]+)-([\w.]+)/(.*)}
+ gems_regexp = %r{\A(#{gems_paths.join('|')})/(bundler/)?gems/([^/]+)-([\w.]+)/(.*)}
gems_result = '\3 (\4) \5'
add_filter { |line| line.sub(gems_regexp, gems_result) }
end

View file

@ -4,7 +4,7 @@
Name: rubygem-%{gem_name}
Epoch: 1
Version: 6.0.3.1
Version: 6.0.3.4
Release: 1%{?dist}
Summary: A support libraries and Ruby core extensions extracted from the Rails framework
License: MIT
@ -13,18 +13,25 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem
# The activesupport gem doesn't ship with the test suite.
# You may check it out like so
# git clone http://github.com/rails/rails.git
# cd rails/activesupport && git archive -v -o activesupport-6.0.3.1-tests.txz v6.0.3.1 test/
# cd rails/activesupport && git archive -v -o activesupport-6.0.3.4-tests.txz v6.0.3.4 test/
Source1: %{gem_name}-%{version}%{?prerelease}-tests.txz
# The tools are needed for the test suite, are however unpackaged in gem file.
# You may get them like so
# git clone http://github.com/rails/rails.git --no-checkout
# cd rails && git archive -v -o rails-6.0.3.1-tools.txz v6.0.3.1 tools/
# cd rails && git archive -v -o rails-6.0.3.4-tools.txz v6.0.3.4 tools/
Source2: rails-%{version}%{?prerelease}-tools.txz
# Fix TZInfo 2.0 compatibility.
# https://github.com/rails/rails/pull/34799
# https://github.com/rails/rails/pull/38081
Patch1: rubygem-activesupport-6.1.0-Update-to-TZInfo-v2.0.0.patch
Patch2: rubygem-activesupport-6.1.0-Update-to-TZInfo-v2.0.0-tests.patch
# Fix flaky `FileStoreTest#test_filename_max_size` test.
# https://github.com/rails/rails/pull/40085
Patch3: rubygem-activesupport-6.0.4-Reduce-FILENAME_MAX_SIZE-to-accomodate-large-PIDs.patch
# Fix evaluator test from web-console.
# https://github.com/rails/rails/pull/40198
Patch4: rubygem-activesupport-6.1.0-Anchor-BacktraceCleaner-gem-filter-regexp.patch
Patch5: rubygem-activesupport-6.1.0-Anchor-BacktraceCleaner-gem-filter-regexp-test.patch
# ruby package has just soft dependency on rubygem({bigdecimal,json}), while
# ActiveSupport always requires them.
@ -67,9 +74,12 @@ Documentation for %{name}.
%setup -q -n %{gem_name}-%{version}%{?prerelease} -b1 -b2
%patch1 -p2
%patch3 -p2
%patch4 -p2
pushd %{_builddir}
%patch2 -p2
%patch5 -p2
popd
%gemspec_remove_dep -g tzinfo "~> 1.1"
@ -127,6 +137,16 @@ popd
%doc %{gem_instdir}/README.rdoc
%changelog
* Thu Oct 8 10:45:37 CEST 2020 Pavel Valena <pvalena@redhat.com> - 1:6.0.3.4-1
- Update to activesupport 6.0.3.4.
Resolves: rhbz#1886136
* Fri Sep 18 17:58:30 CEST 2020 Pavel Valena <pvalena@redhat.com> - 1:6.0.3.3-1
- Update to activesupport 6.0.3.3.
Resolves: rhbz#1877502
- Fix evaluator test from web-console.
- Properly fix flaky `FileStoreTest#test_filename_max_size` test case.
* 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

View file

@ -1,3 +1,3 @@
SHA512 (activesupport-6.0.3.1.gem) = b4b80a2fd08f4dc62a22b8946a91e81116e07a275d2ab75cb7021aa8f3481816ce32b5a598eb532235fe2e686cb1a000fad1667ab4d9561cd01a7e682244f6f8
SHA512 (activesupport-6.0.3.1-tests.txz) = 38e34723040d209fb11aaf6b7c01a4e6bafceb1c6a53417dffc2f154996ba66cf80775b2e6f040548920537f27057c19bd3f09493a4de0bf99eb70be4ce2b6a3
SHA512 (rails-6.0.3.1-tools.txz) = e461674faf787a4f488e93b43747f829b9ea764167ac4782190ac469c4b0941e307e0a72b786a8392c00df1221d02622ffd4b29d7ea43e6c018daf463e092f6a
SHA512 (activesupport-6.0.3.4.gem) = 98668d420f2b3d207ae1513bf9736089b51becb3e9272d5f30e2ca616ee69ee47ce91e30f5e76ada7e9711f08d0acb513697686a7b83fa9582064c280c634117
SHA512 (activesupport-6.0.3.4-tests.txz) = 483cdb18696eb8e5a4a65e31e98256f0add1081800c8f7a85dede2a96ec8e42b5f6a5bf89e238cf46cc68435ec8e26031e364e13086ff9a1578d15b0eba08890
SHA512 (rails-6.0.3.4-tools.txz) = b40d90e55da9c31462bd21c62394198900aa42f161d30f8edd32f7217d904fbdd98d2cfba7c5d542d5b89578424669fcaffbe0006f6efd62cc676065100daac3