From patchwork Mon Mar 20 17:22:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 48364 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3BF1216F34; Mon, 20 Mar 2023 17:31:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 298D516F1D for ; Mon, 20 Mar 2023 17:31:24 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peJLM-000258-8G; Mon, 20 Mar 2023 13:30:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peJKg-0000vi-Cm for guix-patches@gnu.org; Mon, 20 Mar 2023 13:30:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peJKg-0007Kw-1p for guix-patches@gnu.org; Mon, 20 Mar 2023 13:30:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peJKf-0004k3-Mi for guix-patches@gnu.org; Mon, 20 Mar 2023 13:30:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62196] [PATCH 133/223] gnu: ruby-puma: Update to 6.1.1 and enable test suite. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Mar 2023 17:30:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62196 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62196@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 62196-submit@debbugs.gnu.org id=B62196.167933339318078 (code B ref 62196); Mon, 20 Mar 2023 17:30:05 +0000 Received: (at 62196) by debbugs.gnu.org; 20 Mar 2023 17:29:53 +0000 Received: from localhost ([127.0.0.1]:56351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peJKS-0004hE-Sm for submit@debbugs.gnu.org; Mon, 20 Mar 2023 13:29:53 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:43586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peJKP-0004g4-8J for 62196@debbugs.gnu.org; Mon, 20 Mar 2023 13:29:49 -0400 Received: by mail-qt1-f178.google.com with SMTP id c10so2795041qtj.10 for <62196@debbugs.gnu.org>; Mon, 20 Mar 2023 10:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679333383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hmGKIqi2rhxmPqtWssiW35n5JDtXrWDh+UsBGKfNlek=; b=RI8g0TJKMrWu4owWLbYFSwnZvI+ybkVnGyA2W+qRGnj/tDSJLdS8f88PqEEjzkkH1V wu9s4KIUx1K1DHE37I7QcwFTUk7yTIqXAKbP5z4ulm6s1UHNfJ2kUFQK/4LtxTSOUxZ/ O/SmRenY0opCuxGUoqjugDy8Fn4eqlPuh+XEwMrmcaGuMecrTmVdU7X2VrqyCM0Sd+Bh eBnVYAu6LvCajmS2HhGsolWV/DGTVw1RSdDQQyrvkD1ow8qtmsebAZf9C4djG5cVziPW 2GLAwZiI7CKDJfD5CLezES8h9ChjzhJk1P4HpklU0tK97pig60VuJVcz0w5rrbPSJ5Mo sTzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679333383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hmGKIqi2rhxmPqtWssiW35n5JDtXrWDh+UsBGKfNlek=; b=q1lweQaYqcFL7tpexOIRX/1je9ol9KafyrOjnC7UqFqaCDy4ygZ7PpBF3VtaC4vgHH /uiyUmXNDvj2TyY1KYaiQiw6r4HRUDIYShAF4Hm6vVo4kiD5uQik8W93SR+MYgKGd6u9 Hs4CEW3kH/bIV9OXDv8/etrdtvy2lY7/MlImMlxFQdoevWg8aRVmchyXGgbyX37g6T+t JNnxo35g6DEO1haoR8y13LkdpFCPDoKrl2Pyc/ldOEhWRYVJ+3qVwmbYoDcdAY9+gblk rgZ3pbvEwwWu0Hi2iaezEi53+RjQovESI02aIOLalUgmrJak+n7zezhC0i1eOJ5b6mYy 4VYw== X-Gm-Message-State: AO0yUKX00+32epUQAfPf8TlHAXZCax1nm+O2D8wVuuken0YJkERji7lW YxpQ5KkCXKnbYlQwIpW8suQU+hpoquM= X-Google-Smtp-Source: AK7set9/G/mZ3rxMd4BVJfdhQ/fqDsJEmkB+6B9NSgrUtRalOVEDcfyK89ovHa66zurLnTtJm6omfQ== X-Received: by 2002:ac8:578e:0:b0:3bf:d0b1:433d with SMTP id v14-20020ac8578e000000b003bfd0b1433dmr29608607qta.60.1679333066084; Mon, 20 Mar 2023 10:24:26 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-46.b2b2c.ca. [72.10.128.46]) by smtp.gmail.com with ESMTPSA id i7-20020a378607000000b007422eee8058sm7769352qkd.125.2023.03.20.10.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 10:24:25 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 20 Mar 2023 13:22:19 -0400 Message-Id: <20230320172349.12752-32-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230320172349.12752-1-maxim.cournoyer@gmail.com> References: <20230320172349.12752-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/ruby.scm (ruby-puma): Update to 6.1.1. [source]: Use git. [arguments]: Remove #:tests? argument. Adjust fix-gemspec phase. Add the disable-rubocop, use-rack-2, increase-resource-limits, disable-problematic-tests, relax-test-case-timeout, set-home and set-paths phases. Override the check phase. [native-inputs]: New field. [inputs]: Add ruby-nio4r. --- gnu/packages/ruby.scm | 109 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 95 insertions(+), 14 deletions(-) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index ca8d381359..13d299fd3c 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -10804,28 +10804,109 @@ (define-public ruby-ttfunk (define-public ruby-puma (package (name "ruby-puma") - (version "3.9.1") + (version "6.1.1") (source (origin - (method git-fetch) - ;; Fetch from GitHub because distributed gem does not contain tests. + (method git-fetch) ;for tests (uri (git-reference - (url "https://github.com/puma/puma") - (commit (string-append "v" version)))) + (url "https://github.com/puma/puma") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 - "1kj75k81iik3aj73pkc9ixj9rwf95ipkyma65n28m64dgw02qi1f")))) + "0v4nn3z0bj0ry0gpx1hsf5mzkinsx9sv716j4jf2nb1x6hcwv993")))) (build-system ruby-build-system) (arguments - `(#:tests? #f ; Tests require an out-dated version of minitest. - #:phases - (modify-phases %standard-phases - (add-before 'build 'fix-gemspec - (lambda _ - (substitute* "puma.gemspec" - (("git ls-files") "find * |sort"))))))) - (inputs (list openssl)) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-rubocop + (lambda _ + (setenv "PUMA_NO_RUBOCOP" "1"))) + (add-after 'unpack 'use-rack-2 + (lambda _ + (setenv "PUMA_CI_RACK_2" "1"))) + (add-before 'build 'increase-resource-limits + (lambda _ + ;; The test suite requires a higher number of open files. Try + ;; increasing the soft resource limit of max open files to 2048, + ;; or equal to the hard limit, whichever is lower. + (call-with-values (lambda () (getrlimit 'nofile)) + (lambda (soft hard) + (when (and soft (< soft 2048)) + (if hard + (setrlimit 'nofile (min hard 2048) hard) + (setrlimit 'nofile 2048 #f)) + (format + #t "increased maximum number of open files from ~d to ~d~%" + soft (if hard (min hard 2048) 2048))))))) + (add-before 'build 'fix-gemspec + (lambda _ + (substitute* "puma.gemspec" + (("`git ls-files -- bin docs ext lib tools`") + "`find bin docs ext lib tools -type f |sort`")))) + (delete 'check) ;moved after install + (add-after 'install 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "bundle" "exec" "rake" "test")))) + (add-before 'check 'disable-problematic-tests + (lambda _ + (let-syntax ((skip-tests + (syntax-rules () + ((_ file test ...) + (substitute* file + (((string-append "def " test ".*") all) + (string-append + all " skip('fails on guix')\n")) ...))))) + ;; The test failures were reported at: + ;; https://github.com/puma/puma/issues/3093, but appear to be + ;; caused by the Guix build container, perhaps the lack of + ;; zombie process reaping (see: + ;; https://issues.guix.gnu.org/30948). + ;; All the tests in the 'test_worker_gem_independence.rb' + ;; module fail with "Expected false to be truthy.". + (delete-file "test/test_worker_gem_independence.rb") + (skip-tests "test/test_integration_ssl_session.rb" + ;; The TLS 1.2 test fails for unknown reasons. + "test_off_tls1_2") + (skip-tests "test/test_integration_cluster.rb" + "test_fork_worker_on_refork" + "test_culling_strategy_oldest_fork_worker" + "test_usr1_fork_worker") + (skip-tests "test/test_integration_pumactl.rb" + "test_refork_cluster")))) + (add-before 'check 'relax-test-case-timeout + (lambda _ + ;; The default value is 45 s and easily causes timeouts. + (setenv "TEST_CASE_TIMEOUT" "600"))) + (add-before 'check 'set-home + (lambda _ + ;; Some tests fail if the cannot write to HOME. + (setenv "HOME" "/tmp"))) + (add-before 'check 'set-paths + (lambda _ + ;; The test suite requires the 'puma' command to be on PATH. + (setenv "PATH" (string-append (getenv "PATH") ":" + #$output "/bin")) + (setenv "GEM_PATH" (string-append + (getenv "GEM_PATH") ":" + #$output "/lib/ruby/vendor_ruby"))))))) + (native-inputs + (list bundler + curl + ruby-json + ruby-localhost + ruby-m + ruby-minitest-proveit + ruby-minitest-retry + ruby-minitest-stub-const + ruby-rack + ruby-rake-compiler + ruby-webrick)) + (inputs + (list openssl + ruby-nio4r)) (synopsis "Simple, concurrent HTTP server for Ruby/Rack") (description "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server