From 3033fa9df07d78e499117d8386b18c0df573c725 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Sep 03 2019 09:44:16 +0000 Subject: Update to puma 4.1.0 and also add `bcond_with` for ragel to disable it temporarily. Current (7.0.0) ragel version does not support Ruby. --- diff --git a/rubygem-puma-3.12.0-TLS13-fix.patch b/rubygem-puma-3.12.0-TLS13-fix.patch deleted file mode 100644 index ccb552f..0000000 --- a/rubygem-puma-3.12.0-TLS13-fix.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 6a7112d51b3de3439c4be512f68a8d4e33e02665 Mon Sep 17 00:00:00 2001 -From: MSP-Greg -Date: Tue, 21 Aug 2018 20:08:06 -0500 -Subject: [PATCH] Update test files - -2. Stability changes ---- - test_puma_server_ssl.rb | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/test_puma_server_ssl.rb b/test/test_puma_server_ssl.rb -index d479203f..7ffecc36 100644 ---- a/test/test_puma_server_ssl.rb -+++ b/test/test_puma_server_ssl.rb -@@ -152,7 +162,7 @@ def assert_ssl_client_error_match(error, subject=nil, &blk) - req = Net::HTTP::Get.new "/", {} - http.request(req) - end -- rescue OpenSSL::SSL::SSLError -+ rescue OpenSSL::SSL::SSLError, EOFError - client_error = true - end - -@@ -165,7 +175,7 @@ def assert_ssl_client_error_match(error, subject=nil, &blk) - assert_equal host, events.addr if error - assert_equal subject, events.cert.subject.to_s if subject - end -- -+ ensure - server.stop(true) - end - diff --git a/rubygem-puma-3.6.0-fedora-crypto-policy-cipher-list.patch b/rubygem-puma-3.6.0-fedora-crypto-policy-cipher-list.patch index b4e8a2c..d5593df 100644 --- a/rubygem-puma-3.6.0-fedora-crypto-policy-cipher-list.patch +++ b/rubygem-puma-3.6.0-fedora-crypto-policy-cipher-list.patch @@ -2,7 +2,7 @@ diff --git a/ext/puma_http11/mini_ssl.c b/ext/puma_http11/mini_ssl.c index 7e0fd5e..88c4652 100644 --- a/ext/puma_http11/mini_ssl.c +++ b/ext/puma_http11/mini_ssl.c -@@ -183,7 +183,7 @@ VALUE engine_init_server(VALUE self, VALUE mini_ssl_ctx) { +@@ -196,7 +196,7 @@ VALUE engine_init_server(VALUE self, VALUE mini_ssl_ctx) { SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(ssl_cipher_filter)); } else { diff --git a/rubygem-puma-4.1.0-fix-no-zombie-test.patch b/rubygem-puma-4.1.0-fix-no-zombie-test.patch new file mode 100644 index 0000000..55a9640 --- /dev/null +++ b/rubygem-puma-4.1.0-fix-no-zombie-test.patch @@ -0,0 +1,74 @@ +From d9196df80e3d4b71988fdb088b1d2a0d34ede80e Mon Sep 17 00:00:00 2001 +From: Nate Berkopec +Date: Sat, 17 Aug 2019 12:21:08 +0000 +Subject: [PATCH] Msp greg zombie test fix intermittent (#1915) + +* test_integration.rb - fix intermittent test_no_zombie_children + +even with fix, Ruby 2.2 is still intermittent, skipped + +When run with other parallel tests, previous code would inteermittently return pid's not related to the test. + +* Cleanup + nosleep +--- + test/test_integration.rb | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +diff --git a/test/test_integration.rb b/test/test_integration.rb +index fa131424..ae7774d8 100644 +--- a/test/test_integration.rb ++++ b/test/test_integration.rb +@@ -84,17 +84,13 @@ def restart_server_and_listen(argv) + [initial_reply, read_body(connect)] + end + +- def signal(which) +- Process.kill which, @server.pid +- end +- + def wait_booted + @wait.sysread 1 + end + + # reuses an existing connection to make sure that works + def restart_server(server, connection) +- signal :USR2 ++ Process.kill :USR2, @server.pid + + connection.write "GET / HTTP/1.1\r\n\r\n" # trigger it to start by sending a new request + +@@ -377,6 +373,7 @@ def test_not_accepts_new_connections_after_term_signal + + def test_no_zombie_children + skip NO_FORK_MSG unless HAS_FORK ++ skip "Intermittent failure on Ruby 2.2" if RUBY_VERSION < '2.3' + + worker_pids = [] + server = server("-w 2 test/rackup/hello.ru") +@@ -385,11 +382,22 @@ def test_no_zombie_children + next unless line = server.gets.match(/pid: (\d+)/) + worker_pids << line.captures.first.to_i + end ++ + # Signal the workers to terminate, and wait for them to die. +- worker_pids.each { |pid| Process.kill :TERM, pid } +- sleep 2 ++ Process.kill :TERM, @server.pid ++ Process.wait @server.pid ++ @server = nil # prevent `#teardown` from killing already killed server + +- # Should return nil if Puma has correctly cleaned up +- assert_nil Process.waitpid(-1, Process::WNOHANG) ++ # Check if the worker processes remain in the process table. ++ # Process.kill should raise the Errno::ESRCH exception, ++ # indicating the process is dead and has been reaped. ++ zombies = worker_pids.map do |pid| ++ begin ++ pid if Process.kill 0, pid ++ rescue Errno::ESRCH ++ nil ++ end ++ end.compact ++ assert_empty zombies, "Process ids #{zombies} became zombies" + end + end diff --git a/rubygem-puma.spec b/rubygem-puma.spec index 654faed..6960dc3 100644 --- a/rubygem-puma.spec +++ b/rubygem-puma.spec @@ -1,33 +1,41 @@ # Generated from puma-3.6.0.gem by gem2rpm -*- rpm-spec -*- %global gem_name puma +%bcond_with ragel + Name: rubygem-%{gem_name} -Version: 3.12.0 -Release: 3%{?dist} +Version: 4.1.0 +Release: 1%{?dist} Summary: A simple, fast, threaded, and highly concurrent HTTP 1.1 server License: BSD URL: http://puma.io Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # The puma gem doesn't ship with the test suite. # git clone https://github.com/puma/puma.git && cd puma -# git checkout v3.12.0 && tar czvf puma-3.12.0-tests.tgz test/ +# git checkout v4.1.0 && tar czvf puma-4.1.0-tests.tgz test/ Source1: %{gem_name}-%{version}-tests.tgz # The puma gem doesn't ship with the examples used in test suite. -# tar czvf puma-3.12.0-examples.tgz examples/ +# tar czvf puma-4.1.0-examples.tgz examples/ Source3: %{gem_name}-%{version}-examples.tgz # Set the default cipher list "PROFILE=SYSTEM". # https://fedoraproject.org/wiki/Packaging:CryptoPolicies Patch2: rubygem-puma-3.6.0-fedora-crypto-policy-cipher-list.patch -# TLS 1.3 makes some test behave a bit differently. -# https://github.com/puma/puma/commit/6a7112d51b3de3439c4be512f68a8d4e33e02665 -Patch3: rubygem-puma-3.12.0-TLS13-fix.patch +# Fix test_no_zombie_children test +# https://github.com/puma/puma/pull/1915 +Patch3: rubygem-puma-4.1.0-fix-no-zombie-test.patch + BuildRequires: openssl-devel BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby-devel BuildRequires: rubygem(rack) BuildRequires: rubygem(minitest) +BuildRequires: rubygem(nio4r) +# The support for ruby was temporarily dropped +# https://github.com/whitequark/parser/issues/317 +%if %{with ragel} BuildRequires: %{_bindir}/ragel +%endif # Compiler is required for build of gem binary extension. # https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires BuildRequires: gcc @@ -50,15 +58,13 @@ Documentation for %{name}. %patch2 -p1 -pushd %{_builddir} -%patch3 -p1 -popd - +%if %{with ragel} # Regenarate the parser. # https://fedoraproject.org/wiki/Packaging:Guidelines#Use_of_pregenerated_code rm -f ext/puma_http11/http11_parser.c ragel ext/puma_http11/http11_parser.rl -C -G2 -I ext/puma_http11 \ -o ext/puma_http11/http11_parser.c +%endif %build # Create the gem as gem install only works on a gem file @@ -92,12 +98,17 @@ find %{buildroot}%{gem_instdir}/bin -type f | \ # Run the test suite %check pushd .%{gem_instdir} -ln -s %{_builddir}/test test -ln -s %{_builddir}/examples examples +ln -s %{_builddir}/test . +ln -s %{_builddir}/examples . -# We do not ship minitest-retry. -sed -i "/require 'minitest\/retry'/ s/^/#/" test/helper.rb +pushd test +cat %{PATCH3} | patch -p2 +popd + +# We do not ship minitest-retry or minitest-proveit. +sed -i -e "/require..minitest\/\(retry\|proveit\)./ s/^/#/" test/helper.rb sed -i "/Minitest::Retry/ s/^/#/" test/helper.rb +sed -i '/prove_it!/ s/^/#/' test/helper.rb # Skip unstable tests. sed -i '/^ def test_timeout_in_data_phase$/a\ @@ -105,6 +116,8 @@ sed -i '/^ def test_timeout_in_data_phase$/a\ # https://github.com/puma/puma/issues/1615 sed -i '/^ def test_control_url$/a\ skip "Unstable test"' test/test_pumactl.rb +sed -i '/^ def test_bad_client/ a\ + skip "Unstable test"' test/test_web_server.rb # Not sure how to enable SSLv3 on client side, which is by default disabled # on Fedora, to test the server :/ @@ -146,6 +159,9 @@ popd %{gem_instdir}/tools %changelog +* Wed Aug 21 2019 Pavel Valena - 4.1.0-1 +- Update to puma 4.1.0. + * Fri Jul 26 2019 Fedora Release Engineering - 3.12.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index 5be4f87..8b02e3a 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (puma-3.12.0-examples.tgz) = b106ef8fc6f9e81e545bace4f63a1ba15bf294e68b15cd705fa2f9c585d109ff30c07ab1d5175abce097885f27227a1ca87356eccc2346787942c1bc254c7a47 -SHA512 (puma-3.12.0-tests.tgz) = edd1b7f63447bc5b134a80f574126170605309eb5e95597fb301b38ded06328f1c1fbc63b649d44966107368865c0946b97931beea7c6094b415d3871057a849 -SHA512 (puma-3.12.0.gem) = d940675c488830a2a656b3f86483226cc2cfaefea87e763280a1a831fea033f75e54b8c15d3609d041814b095288a73a44d32d9ec05831f3e9aeac6b01ddd1ff +SHA512 (puma-4.1.0.gem) = 57aa55ad5cdecca4a44df44f1b50143e84306b907bf85ca32939c54acfcc3939beb29fe8e4a459c5dc7cd03fc0db1c95d31ed822cb0b1407ad924f5f627e84a8 +SHA512 (puma-4.1.0-tests.tgz) = 14d45e6c0cdddc249c742b551ebd05559c02dfaf73fb9b79bcb3f125435161f4a356b7026e00f38575ba23a9053ef142e156c083374afcc29f8744c8a4331755 +SHA512 (puma-4.1.0-examples.tgz) = 732cb35ccce872fbe438be229cf6dc712074996d88241ef77bf95a691e4b0db4bef787b7565cb6db440eaf616acd8ec5daaf54191a3324a941054189b234c102