From unknown Mon Aug 18 09:08:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#55954] [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 14 Jun 2022 03:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55954 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55954@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165517757429968 (code B ref -1); Tue, 14 Jun 2022 03:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jun 2022 03:32:54 +0000 Received: from localhost ([127.0.0.1]:60838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0xIT-0007nH-Q1 for submit@debbugs.gnu.org; Mon, 13 Jun 2022 23:32:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:49740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0xIO-0007n3-4U for submit@debbugs.gnu.org; Mon, 13 Jun 2022 23:32:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0xIN-00044R-HI for guix-patches@gnu.org; Mon, 13 Jun 2022 23:32:47 -0400 Received: from mx.kolabnow.com ([212.103.80.155]:30266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0xII-0003uj-Op for guix-patches@gnu.org; Mon, 13 Jun 2022 23:32:45 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id E2A951483 for ; Tue, 14 Jun 2022 05:32:37 +0200 (CEST) Authentication-Results: ext-mx-out001.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1655177557; x=1656991958; bh=UxkeSKhhBq9XcWPTa6++cSPO7rHbDInIwfW/AOyb95o=; b=wiN88u2uKCRN ghef82trMJiom0dtB66ZTpClAWS2xjIFmu26CjTYc1kfthz5lYafFQoqGbykp80N VMLI/XMaK5PBJloUh6BzKcs+LWbaDr8ZFV5wBQr8OlnxeTscHwRr7+tXbBuhfPSB pJ0kRFlusNEc9QnQOfZmMe8zeexRpGGu6E2egPWaaKMTpkLp0G7Ontn9jQEJDDaV 4MW256VsjuO8HCkHNz0QqT0KyreJ0gr0jj4NyvoRXADhz7FDrv95Y5AlBcj2AlBF JTLGUxvTgZiGtaQdkdYGPzGf7toSLDTfLugQSUHpCgCA34GY67HKrbWsr7HOgXHK LYcR94oDn+12jESap8EN6QNAXW09GlebQmmlZHfN6MzmeHpE5+2eR+2yg1B2yqUU O8dgFV+jhg+P5P2Fp5sFKRKcyw+CpVs0/9u52hKr+fxowGD6tQfe/nLKe9ai4j9q 5T+N3/UbrcaWDJE0obxQ2qC7+PiEC6UQAsmLlhBJwVtSyNON1ZnqrP04nd0/Sv1Y qrFQ3vheuHZ4FbIobGTHYO2CH0B8nGOCOy5u2schUybZfxfiEUwUeAXdJDoWTTXD 41mNxu5iVatzkTebXH2AZdo4KbKh2NQn4Fr/J9CGD1io/8iU5kYrJBH15nuTOWw9 Sdrj1ozTosmHClZQKAPryk2SyMiEtac= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UNUtXu91OlXJ for ; Tue, 14 Jun 2022 05:32:37 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by mx.kolabnow.com (Postfix) with ESMTPS id 6AE50660 for ; Tue, 14 Jun 2022 05:32:36 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 028ED3279; Tue, 14 Jun 2022 05:32:35 +0200 (CEST) From: Thiago Jung Bauermann Date: Tue, 14 Jun 2022 00:32:23 -0300 Message-Id: <20220614033223.377744-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.103.80.155; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) This patch makes the public-inbox testsuite pass. Some tests are skipped, so the test coverage could likely be increased with more massaging. Perhaps the most significant change is using tini to run the testsuite so that the testsuite's sub-processes are reaped. The ‘check’ phase is based on the one from the mutter package. Thanks to Maxim Cournoyer for pointing out this solution. * gnu/packages/patches/public-inbox-fix-spawn-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Add new patch. * gnu/packages/mail.scm (public-inbox)[source]: Add new patch. [arguments]<#:tests?>: Remove argument. <#:imported-modules>: Add argument. <#:modules>: Likewise. <#:phases>{qualify-paths}: Substitute path for ‘/bin/cp’. {pre-check}: Don't skip httpd-unix.t test. Remove unnecessary path substitutions for “env” and “/bin/sh”. {check}: Replace with custom version that launches the tests under tini. [native-inputs]: Add tini. --- gnu/local.mk | 1 + gnu/packages/mail.scm | 60 +++++++++++++++---- .../patches/public-inbox-fix-spawn-test.patch | 43 +++++++++++++ 3 files changed, 91 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/public-inbox-fix-spawn-test.patch diff --git a/gnu/local.mk b/gnu/local.mk index 03e180cc8508..0653cbb3bc16 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1650,6 +1650,7 @@ dist_patch_DATA = \ %D%/packages/patches/psm-disable-memory-stats.patch \ %D%/packages/patches/psm-ldflags.patch \ %D%/packages/patches/psm-repro.patch \ + %D%/packages/patches/public-inbox-fix-spawn-test.patch \ %D%/packages/patches/pulseaudio-fix-mult-test.patch \ %D%/packages/patches/pulseaudio-longer-test-timeout.patch \ %D%/packages/patches/pulseview-qt515-compat.patch \ diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 8596d0808beb..6f44c6c0f56a 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -87,6 +87,7 @@ (define-module (gnu packages mail) #:use-module (gnu packages django) #:use-module (gnu packages dns) #:use-module (gnu packages docbook) + #:use-module (gnu packages docker) #:use-module (gnu packages documentation) #:use-module (gnu packages emacs) #:use-module (gnu packages enchant) @@ -4084,10 +4085,16 @@ (define-public public-inbox (sha256 (base32 "0xni1l54v1z3p0zb52807maay0yqabp8jgf5iras5zmhgjyk3swz")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (patches (search-patches "public-inbox-fix-spawn-test.patch")))) (build-system perl-build-system) (arguments - '(#:tests? #f + `(#:imported-modules (,@%perl-build-system-modules + (guix build syscalls)) + #:modules ((guix build perl-build-system) + (guix build syscalls) + (guix build utils) + (ice-9 match)) #:phases (modify-phases %standard-phases (add-before 'configure 'qualify-paths @@ -4096,18 +4103,45 @@ (define-public public-inbox (substitute* "lib/PublicInbox/Xapcmd.pm" (("'xapian-compact'") (format #f "'~a'" (search-input-file inputs - "/bin/xapian-compact")))))) + "/bin/xapian-compact")))) + (substitute* "lib/PublicInbox/TestCommon.pm" + ;; This is only used for tests, but get it from ‘inputs’ so + ;; that cross builds won't hold a reference to a package built + ;; for another architecture. + (("/bin/cp") (search-input-file inputs "/bin/cp"))))) (add-before 'check 'pre-check (lambda _ - (substitute* "t/spawn.t" - (("\\['env'\\]") (string-append "['" (which "env") "']"))) - (substitute* "t/ds-leak.t" - (("/bin/sh") (which "sh"))) - (invoke "./certs/create-certs.perl") - ;; XXX: This test fails due to zombie process is not reaped by - ;; the builder. - (substitute* "t/httpd-unix.t" - (("^SKIP: \\{") "SKIP: { skip('Guix');")))) + (invoke "./certs/create-certs.perl"))) + (replace 'check + (lambda* (#:key target + (tests? (not target)) (test-flags '()) + #:allow-other-keys) + (if tests? + (match (primitive-fork) + (0 ;child process + ;; lei tests build UNIX domain sockets in the temporary + ;; directory, but the path of those sockets can be at most + ;; 108 chars and Guix' default value for the variables + ;; below already use 47 chars. Use the shortest temporary + ;; path possible to avoid hitting the limit. + (setenv "TEMP" "/tmp") + (setenv "TEMPDIR" "/tmp") + (setenv "TMP" "/tmp") + (setenv "TMPDIR" "/tmp") + + ;; Use tini so that signals are properly handled and + ;; doubly-forked processes get reaped; otherwise, + ;; lei-daemon is kept as a zombie and the testsuite + ;; fails thinking that it didn't quit as it should. + (set-child-subreaper!) + (apply execlp "tini" "--" + "make" "check" test-flags)) + (pid + (match (waitpid pid) + ((_ . status) + (unless (zero? status) + (error "`make check' exited with status" status)))))) + (format #t "test suite not run~%")))) (add-after 'install 'wrap-programs (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -4126,7 +4160,7 @@ (define-public public-inbox (find-files (string-append out "/bin"))))))))) (native-inputs (list ;; For testing. - lsof openssl)) + lsof openssl tini)) (inputs (list bash-minimal curl diff --git a/gnu/packages/patches/public-inbox-fix-spawn-test.patch b/gnu/packages/patches/public-inbox-fix-spawn-test.patch new file mode 100644 index 000000000000..2739b1974de8 --- /dev/null +++ b/gnu/packages/patches/public-inbox-fix-spawn-test.patch @@ -0,0 +1,43 @@ +From 5593489d9c3ce22b1942f35c7ebb0e06fcf2bfa8 Mon Sep 17 00:00:00 2001 +From: Thiago Jung Bauermann +Date: Fri, 10 Jun 2022 12:39:18 -0300 +Subject: [PATCH] t/spawn: Find invalid PID to try to join its process group + +In the container used to build packages of the GNU Guix distribution, PID 1 +runs as the same user as the test so this spawn that should fail actually +succeeds. + +Fix the problem by going through different PIDs and picking one that +either doesn't exist or we aren't allowed to signal. +--- + +This patch is taken from the public-inbox repository and will appear in the +release after v1.8. + + t/spawn.t | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/t/spawn.t b/t/spawn.t +index 6168c1f6171c..5fc99a2a101c 100644 +--- a/t/spawn.t ++++ b/t/spawn.t +@@ -24,7 +24,18 @@ SKIP: { + is(waitpid($pid, 0), $pid, 'waitpid succeeds on spawned process'); + is($?, 0, 'true exited successfully'); + pipe(my ($r, $w)) or BAIL_OUT; +- $pid = eval { spawn(['true'], undef, { pgid => 1, 2 => $w }) }; ++ ++ # Find invalid PID to try to join its process group. ++ my $wrong_pgid = 1; ++ for (my $i=0x7fffffff; $i >= 2; $i--) { ++ if (kill(0, $i) == 0) { ++ $wrong_pgid = $i; ++ last; ++ } ++ } ++ ++ # Test spawn behavior when it can't join the requested process group. ++ $pid = eval { spawn(['true'], undef, { pgid => $wrong_pgid, 2 => $w }) }; + close $w; + my $err = do { local $/; <$r> }; + # diag "$err ($@)"; base-commit: 965d54e344dcd19adf3c32f8b9d2dcab62b91e6a From unknown Mon Aug 18 09:08:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#55954] [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Jun 2022 09:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55954 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Thiago Jung Bauermann Cc: 55954@debbugs.gnu.org Received: via spool by 55954-submit@debbugs.gnu.org id=B55954.16553716909402 (code B ref 55954); Thu, 16 Jun 2022 09:29:01 +0000 Received: (at 55954) by debbugs.gnu.org; 16 Jun 2022 09:28:10 +0000 Received: from localhost ([127.0.0.1]:40753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1lnL-0002RX-9f for submit@debbugs.gnu.org; Thu, 16 Jun 2022 05:28:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1ln9-0002QM-OH for 55954@debbugs.gnu.org; Thu, 16 Jun 2022 05:28:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1ln3-00029G-8k; Thu, 16 Jun 2022 05:27:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=dZ+rNvOdEuQfuQ6MoY+q4kiAYS66gD9OY+zJHSvELuE=; b=YN5h+nkp4ursuuOlwPG/ L8J4PaPK/r3ULmNvNU5yuksL+cy9LsDFUH5I0wtV0/fk8j97t7Bp5vp112qtXH1GElr5rTdHSHDEE Idw6p7EJZHOyhjNj2vvmkXH2pKdksXXUtBAKRawBx5A22f1w0cv6yA62wFqZtpCNeSy0qtRNduMOg oGSwzhlMtaYu5KVhhpqyO8XE5PLSJ1z3+9VMN3dfLzEvFhgm6XZtuL8CkDLZpbju7ZDko5JFtYHSr TYaMQhYhiAbKs08/zBUQ1a9YELDdW0jpJqpck+wj0SDPzZYU8tBfQk6qqJ4ev1hrXuaC3eIUijo6A fKA0asjJIFa9xA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55629 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1ln1-0000rh-1a; Thu, 16 Jun 2022 05:27:49 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220614033223.377744-1-bauermann@kolabnow.com> Date: Thu, 16 Jun 2022 11:27:44 +0200 In-Reply-To: <20220614033223.377744-1-bauermann@kolabnow.com> (Thiago Jung Bauermann's message of "Tue, 14 Jun 2022 00:32:23 -0300") Message-ID: <87a6adlzzj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Thiago Jung Bauermann skribis: > This patch makes the public-inbox testsuite pass. Some tests are skipped, > so the test coverage could likely be increased with more massaging. > > Perhaps the most significant change is using tini to run the testsuite so > that the testsuite's sub-processes are reaped. The =E2=80=98check=E2=80= =99 phase is based on > the one from the mutter package. Thanks to Maxim Cournoyer for pointing o= ut > this solution. > > * gnu/packages/patches/public-inbox-fix-spawn-test.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add new patch. > * gnu/packages/mail.scm (public-inbox)[source]: Add new patch. > [arguments]<#:tests?>: Remove argument. > <#:imported-modules>: Add argument. > <#:modules>: Likewise. > <#:phases>{qualify-paths}: Substitute path for =E2=80=98/bin/cp=E2=80=99. > {pre-check}: Don't skip httpd-unix.t test. Remove unnecessary path > substitutions for =E2=80=9Cenv=E2=80=9D and =E2=80=9C/bin/sh=E2=80=9D. > {check}: Replace with custom version that launches the tests under tini. > [native-inputs]: Add tini. Applied, thanks! [...] > + (replace 'check > + (lambda* (#:key target > + (tests? (not target)) (test-flags '()) > + #:allow-other-keys) > + (if tests? > + (match (primitive-fork) > + (0 ;child process > + ;; lei tests build UNIX domain sockets in the tempor= ary > + ;; directory, but the path of those sockets can be a= t most > + ;; 108 chars and Guix' default value for the variabl= es > + ;; below already use 47 chars. Use the shortest temp= orary > + ;; path possible to avoid hitting the limit. > + (setenv "TEMP" "/tmp") > + (setenv "TEMPDIR" "/tmp") > + (setenv "TMP" "/tmp") > + (setenv "TMPDIR" "/tmp") > + > + ;; Use tini so that signals are properly handled and > + ;; doubly-forked processes get reaped; otherwise, > + ;; lei-daemon is kept as a zombie and the testsuite > + ;; fails thinking that it didn't quit as it should. > + (set-child-subreaper!) > + (apply execlp "tini" "--" > + "make" "check" test-flags)) > + (pid > + (match (waitpid pid) > + ((_ . status) > + (unless (zero? status) > + (error "`make check' exited with status" status= )))))) It=E2=80=99s a bummer that we have to do all this. Would this work: (replace 'check (lambda _ (sigaction SIGINT SIG_DFL) (sigaction SIGTERM SIG_DFL) (sigaction SIGCHLD (lambda _ (waitpid WAIT_ANY WNOHANG))) ;; Ugly hack to make sure signal handler asyncs get a chance ;; to run while we=E2=80=99re in =E2=80=98waitpid=E2=80=99 during the= =E2=80=9Cmake check=E2=80=9D ;; invocation. (sigaction SIGALRM (lambda _ (alarm 1))) (alarm 1))) ? If not, the solution you propose LGTM. Thanks, Ludo=E2=80=99. From unknown Mon Aug 18 09:08:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#55954] [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Jun 2022 03:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55954 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 55954@debbugs.gnu.org Received: via spool by 55954-submit@debbugs.gnu.org id=B55954.165543481825724 (code B ref 55954); Fri, 17 Jun 2022 03:01:02 +0000 Received: (at 55954) by debbugs.gnu.org; 17 Jun 2022 03:00:18 +0000 Received: from localhost ([127.0.0.1]:43475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o22Da-0006gp-EM for submit@debbugs.gnu.org; Thu, 16 Jun 2022 23:00:18 -0400 Received: from mx.kolabnow.com ([212.103.80.153]:63276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o22DX-0006gU-AX for 55954@debbugs.gnu.org; Thu, 16 Jun 2022 23:00:17 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 2414540671; Fri, 17 Jun 2022 05:00:09 +0200 (CEST) Authentication-Results: ext-mx-out003.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:in-reply-to:date:date:subject:subject:from:from :references:received:received:received; s=dkim20160331; t= 1655434808; x=1657249209; bh=9crkGcw/1+G91TPKEsAt+Upb1uWR/GyRQSJ 4dTMABVo=; b=AVjw6wudrI39HKkjm1RqVze1ZjEdZ30Jo0B0ESYWi65r+3mK9kU xMofoSDuXUlrkhexIKMk7Tq4wp/fCpjZ/UEBtIiSD27pSBmWhjCATChrB3qZ+m32 +pAYgmVKBirZUkvG2uvdpPySPtP9A4wDZuoAzhJadvPu+TPMpYX0Ly3v0Ubn2Jw3 XWjg9i7sOZv2251YO94Cmr79qHlf8LTJbjJ8/GfJo/Vi0qjEa0YbJ0wdD/um1KZ9 X97dK63SnxqDOOBn6JBrw0YR+wkjsZ8cHeaqRIlodTk1n3mcLQwNPrZxCniqg+rY 9HWWTsXUhVNUk/eS4Vyuo1sNRVOVvP6qbhfPoYHM9meoR9r9tSUkoO0neC70M1ti xCua9jNJYSidtfLcIf/VlgxxOw07TzRtpQSOttAeWAvB8aRjl1AAJQ5q6VfvQTpq 9qDHKA7L3k1P0JbXvQ9/h5tr2/l+ILIb6SPO6q96vQPGeWoG3ZsB3IIueoFBlh6r yA2llMlSUaiNRnwrYMWRC97HgRFJ7FjjBpA/4Qcvtgh1MLksqSimvo60EwjLcdv0 1HWBkUwNQStS9mGtg2sa/K+4mUVbnqc90GKMhOQLdjT1SkyTAkAzz25Q2AGUFoI3 vmBB7y9ziVSYuZBVj6wLGjmG3XSERhYJcYW885g/OpncRV4uaL0D0AcI= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zRTgwWjEokfh; Fri, 17 Jun 2022 05:00:08 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by mx.kolabnow.com (Postfix) with ESMTPS id AFC9E403E1; Fri, 17 Jun 2022 05:00:07 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 29A2AE7C; Fri, 17 Jun 2022 05:00:07 +0200 (CEST) References: <20220614033223.377744-1-bauermann@kolabnow.com> <87a6adlzzj.fsf@gnu.org> From: Thiago Jung Bauermann Date: Thu, 16 Jun 2022 23:38:50 -0300 In-reply-to: <87a6adlzzj.fsf@gnu.org> Message-ID: <87bkushu4v.fsf@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ludo, Thank you for your review! Ludovic Court=C3=A8s writes: > Hi, > > Thiago Jung Bauermann skribis: > >> This patch makes the public-inbox testsuite pass. Some tests are skipped, >> so the test coverage could likely be increased with more massaging. >> >> Perhaps the most significant change is using tini to run the testsuite so >> that the testsuite's sub-processes are reaped. The =E2=80=98check=E2=80= =99 phase is based on >> the one from the mutter package. Thanks to Maxim Cournoyer for pointing = out >> this solution. >> >> * gnu/packages/patches/public-inbox-fix-spawn-test.patch: New file. >> * gnu/local.mk (dist_patch_DATA): Add new patch. >> * gnu/packages/mail.scm (public-inbox)[source]: Add new patch. >> [arguments]<#:tests?>: Remove argument. >> <#:imported-modules>: Add argument. >> <#:modules>: Likewise. >> <#:phases>{qualify-paths}: Substitute path for =E2=80=98/bin/cp=E2=80=99. >> {pre-check}: Don't skip httpd-unix.t test. Remove unnecessary path >> substitutions for =E2=80=9Cenv=E2=80=9D and =E2=80=9C/bin/sh=E2=80=9D. >> {check}: Replace with custom version that launches the tests under tini. >> [native-inputs]: Add tini. > > Applied, thanks! I guess you had second thoughts. :-) >> + (replace 'check >> + (lambda* (#:key target >> + (tests? (not target)) (test-flags '()) >> + #:allow-other-keys) >> + (if tests? >> + (match (primitive-fork) >> + (0 ;child process >> + ;; lei tests build UNIX domain sockets in the tempo= rary >> + ;; directory, but the path of those sockets can be = at most >> + ;; 108 chars and Guix' default value for the variab= les >> + ;; below already use 47 chars. Use the shortest tem= porary >> + ;; path possible to avoid hitting the limit. >> + (setenv "TEMP" "/tmp") >> + (setenv "TEMPDIR" "/tmp") >> + (setenv "TMP" "/tmp") >> + (setenv "TMPDIR" "/tmp") >> + >> + ;; Use tini so that signals are properly handled and >> + ;; doubly-forked processes get reaped; otherwise, >> + ;; lei-daemon is kept as a zombie and the testsuite >> + ;; fails thinking that it didn't quit as it should. >> + (set-child-subreaper!) >> + (apply execlp "tini" "--" >> + "make" "check" test-flags)) >> + (pid >> + (match (waitpid pid) >> + ((_ . status) >> + (unless (zero? status) >> + (error "`make check' exited with status" statu= s)))))) > > It=E2=80=99s a bummer that we have to do all this. Would this work: > > (replace 'check > (lambda _ > (sigaction SIGINT SIG_DFL) > (sigaction SIGTERM SIG_DFL) > (sigaction SIGCHLD (lambda _ (waitpid WAIT_ANY WNOHANG))) > > ;; Ugly hack to make sure signal handler asyncs get a chance > ;; to run while we=E2=80=99re in =E2=80=98waitpid=E2=80=99 during t= he =E2=80=9Cmake check=E2=80=9D > ;; invocation. > (sigaction SIGALRM (lambda _ (alarm 1))) > (alarm 1))) > > ? I assume there should be a "make check" in there somewhere. :-) Unfortunately, it didn't work. This is the check phase I tried: --8<---------------cut here---------------start------------->8--- (replace 'check (lambda _ (setenv "TEMP" "/tmp") (setenv "TEMPDIR" "/tmp") (setenv "TMP" "/tmp") (setenv "TMPDIR" "/tmp") (sigaction SIGINT SIG_DFL) (sigaction SIGTERM SIG_DFL) (sigaction SIGCHLD (lambda _ (waitpid WAIT_ANY WNOHANG))) ;; Ugly hack to make sure signal handler asyncs get a chance ;; to run while we=E2=80=99re in =E2=80=98waitpid=E2=80=99 during the= =E2=80=9Cmake check=E2=80=9D ;; invocation. (sigaction SIGALRM (lambda _ (alarm 1))) (alarm 1) (unless (zero? (status:exit-val (system* "make" "check"))) (error "`make check' exited with error")))) --8<---------------cut here---------------end--------------->8--- And this was the end of the output of the phase: --8<---------------cut here---------------start------------->8--- =E2=8B=AE Bailout called. Further testing stopped: daemon still running (PID:5282) FAILED--Further testing stopped: daemon still running (PID:5282) make: *** [Makefile:4141: check-each] Error 255 error: in phase 'check': uncaught exception: misc-error #f "~A" ("`make check' exited with error") #f phase `check' failed after 27.7 seconds --8<---------------cut here---------------end--------------->8--- =E2=80=9Cdaemon still running=E2=80=9D means that lei's daemon process wasn= 't reaped. > If not, the solution you propose LGTM. Thanks. Hopefully this can be fixed in Guix's build machinery itself in the core-updates branch and all the packages that are using this hack can drop it then. --=20 Thanks Thiago From unknown Mon Aug 18 09:08:56 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Thiago Jung Bauermann Subject: bug#55954: closed (Re: bug#55954: [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run) Message-ID: References: <87v8szh33a.fsf@gnu.org> <20220614033223.377744-1-bauermann@kolabnow.com> X-Gnu-PR-Message: they-closed 55954 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 55954@debbugs.gnu.org Date: Fri, 17 Jun 2022 12:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1655469902-22276-1" This is a multi-part message in MIME format... ------------=_1655469902-22276-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #55954: [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 55954@debbugs.gnu.org. --=20 55954: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D55954 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1655469902-22276-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 55954-done) by debbugs.gnu.org; 17 Jun 2022 12:44:21 +0000 Received: from localhost ([127.0.0.1]:44206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2BKn-0005m8-54 for submit@debbugs.gnu.org; Fri, 17 Jun 2022 08:44:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2BKj-0005ls-L8 for 55954-done@debbugs.gnu.org; Fri, 17 Jun 2022 08:44:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2BKe-0008Mj-2G; Fri, 17 Jun 2022 08:44:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=i+zHqRI/vV25FBKSRYYcQYzEWyo+H51Lzs0/Ks2wKhk=; b=RNqMPoCUA31p1GYQGwMM xR6rMo5VieELYbUs7lGEO+VomYmB8jA4P8WjxATjRAOsxAveRv0mnCKq9nHVSPrqQz/QCXAFccaal Eae9h+wxhljMqkKYSUQG0KKtVUUDbkJSZPCYy/Bg7Ui1ax85sePe1gA4MJ/YoVdbC8dfWaSqhKtVv f81yl3ITI13hKqwBUYcK64IxiBSnijfpghp9Cgl/J1GyxE+QFvEC64tubqDi6OjtFo3KBbRqh21XU Kf2rA96vBX4wmLVrFJHpvzLMObPuZa0bQSAf2qqn0dmQYLTSoLws1PVc9i0mMasAp3bh/xq775TP7 DXoQ5OVlAhoB5w==; Received: from [193.50.110.205] (port=39738 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2BKd-0003vV-MH; Fri, 17 Jun 2022 08:44:11 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Thiago Jung Bauermann Subject: Re: bug#55954: [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run References: <20220614033223.377744-1-bauermann@kolabnow.com> <87a6adlzzj.fsf@gnu.org> <87bkushu4v.fsf@kolabnow.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 29 Prairial an 230 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour de la Pivoine X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 17 Jun 2022 14:44:09 +0200 In-Reply-To: <87bkushu4v.fsf@kolabnow.com> (Thiago Jung Bauermann's message of "Thu, 16 Jun 2022 23:38:50 -0300") Message-ID: <87v8szh33a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55954-done Cc: 55954-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, Thiago Jung Bauermann skribis: > Ludovic Court=C3=A8s writes: [...] >> Applied, thanks! > > I guess you had second thoughts. :-) Yes, sorry; I wasn=E2=80=99t sure whether bothering you was a good idea, bu= t I was also dissatisfied with that whole situation (which is not public-inbox=E2=80=99s fault!). >> It=E2=80=99s a bummer that we have to do all this. Would this work: >> >> (replace 'check >> (lambda _ >> (sigaction SIGINT SIG_DFL) >> (sigaction SIGTERM SIG_DFL) >> (sigaction SIGCHLD (lambda _ (waitpid WAIT_ANY WNOHANG))) >> >> ;; Ugly hack to make sure signal handler asyncs get a chance >> ;; to run while we=E2=80=99re in =E2=80=98waitpid=E2=80=99 during = the =E2=80=9Cmake check=E2=80=9D >> ;; invocation. >> (sigaction SIGALRM (lambda _ (alarm 1))) >> (alarm 1))) >> >> ? > > I assume there should be a "make check" in there somewhere. :-) > > Unfortunately, it didn't work. This is the check phase I tried: > > (replace 'check > (lambda _ > (setenv "TEMP" "/tmp") > (setenv "TEMPDIR" "/tmp") > (setenv "TMP" "/tmp") > (setenv "TMPDIR" "/tmp") > > (sigaction SIGINT SIG_DFL) > (sigaction SIGTERM SIG_DFL) > (sigaction SIGCHLD (lambda _ (waitpid WAIT_ANY WNOHANG))) > > ;; Ugly hack to make sure signal handler asyncs get a chance > ;; to run while we=E2=80=99re in =E2=80=98waitpid=E2=80=99 during t= he =E2=80=9Cmake check=E2=80=9D > ;; invocation. > (sigaction SIGALRM (lambda _ (alarm 1))) > (alarm 1) > (unless (zero? (status:exit-val (system* "make" "check"))) > (error "`make check' exited with error")))) > > > And this was the end of the output of the phase: > > =E2=8B=AE > Bailout called. Further testing stopped: daemon still running (PID:5282) > FAILED--Further testing stopped: daemon still running (PID:5282) > make: *** [Makefile:4141: check-each] Error 255 > error: in phase 'check': uncaught exception: > misc-error #f "~A" ("`make check' exited with error") #f > phase `check' failed after 27.7 seconds > > =E2=80=9Cdaemon still running=E2=80=9D means that lei's daemon process wa= sn't reaped. Damnit, I wonder how that can happen. >> If not, the solution you propose LGTM. > > Thanks. Hopefully this can be fixed in Guix's build machinery itself in > the core-updates branch and all the packages that are using this hack > can drop it then. Yeah. Anyway, applied for good this time, thanks for taking extra time on this! Ludo=E2=80=99. ------------=_1655469902-22276-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Jun 2022 03:32:54 +0000 Received: from localhost ([127.0.0.1]:60838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0xIT-0007nH-Q1 for submit@debbugs.gnu.org; Mon, 13 Jun 2022 23:32:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:49740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0xIO-0007n3-4U for submit@debbugs.gnu.org; Mon, 13 Jun 2022 23:32:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0xIN-00044R-HI for guix-patches@gnu.org; Mon, 13 Jun 2022 23:32:47 -0400 Received: from mx.kolabnow.com ([212.103.80.155]:30266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0xII-0003uj-Op for guix-patches@gnu.org; Mon, 13 Jun 2022 23:32:45 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id E2A951483 for ; Tue, 14 Jun 2022 05:32:37 +0200 (CEST) Authentication-Results: ext-mx-out001.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1655177557; x=1656991958; bh=UxkeSKhhBq9XcWPTa6++cSPO7rHbDInIwfW/AOyb95o=; b=wiN88u2uKCRN ghef82trMJiom0dtB66ZTpClAWS2xjIFmu26CjTYc1kfthz5lYafFQoqGbykp80N VMLI/XMaK5PBJloUh6BzKcs+LWbaDr8ZFV5wBQr8OlnxeTscHwRr7+tXbBuhfPSB pJ0kRFlusNEc9QnQOfZmMe8zeexRpGGu6E2egPWaaKMTpkLp0G7Ontn9jQEJDDaV 4MW256VsjuO8HCkHNz0QqT0KyreJ0gr0jj4NyvoRXADhz7FDrv95Y5AlBcj2AlBF JTLGUxvTgZiGtaQdkdYGPzGf7toSLDTfLugQSUHpCgCA34GY67HKrbWsr7HOgXHK LYcR94oDn+12jESap8EN6QNAXW09GlebQmmlZHfN6MzmeHpE5+2eR+2yg1B2yqUU O8dgFV+jhg+P5P2Fp5sFKRKcyw+CpVs0/9u52hKr+fxowGD6tQfe/nLKe9ai4j9q 5T+N3/UbrcaWDJE0obxQ2qC7+PiEC6UQAsmLlhBJwVtSyNON1ZnqrP04nd0/Sv1Y qrFQ3vheuHZ4FbIobGTHYO2CH0B8nGOCOy5u2schUybZfxfiEUwUeAXdJDoWTTXD 41mNxu5iVatzkTebXH2AZdo4KbKh2NQn4Fr/J9CGD1io/8iU5kYrJBH15nuTOWw9 Sdrj1ozTosmHClZQKAPryk2SyMiEtac= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UNUtXu91OlXJ for ; Tue, 14 Jun 2022 05:32:37 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by mx.kolabnow.com (Postfix) with ESMTPS id 6AE50660 for ; Tue, 14 Jun 2022 05:32:36 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 028ED3279; Tue, 14 Jun 2022 05:32:35 +0200 (CEST) From: Thiago Jung Bauermann To: guix-patches@gnu.org Subject: [PATCH] gnu: public-inbox: Fixes to allow the testsuite to run Date: Tue, 14 Jun 2022 00:32:23 -0300 Message-Id: <20220614033223.377744-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.103.80.155; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Thiago Jung Bauermann X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) This patch makes the public-inbox testsuite pass. Some tests are skipped, so the test coverage could likely be increased with more massaging. Perhaps the most significant change is using tini to run the testsuite so that the testsuite's sub-processes are reaped. The ‘check’ phase is based on the one from the mutter package. Thanks to Maxim Cournoyer for pointing out this solution. * gnu/packages/patches/public-inbox-fix-spawn-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Add new patch. * gnu/packages/mail.scm (public-inbox)[source]: Add new patch. [arguments]<#:tests?>: Remove argument. <#:imported-modules>: Add argument. <#:modules>: Likewise. <#:phases>{qualify-paths}: Substitute path for ‘/bin/cp’. {pre-check}: Don't skip httpd-unix.t test. Remove unnecessary path substitutions for “env” and “/bin/sh”. {check}: Replace with custom version that launches the tests under tini. [native-inputs]: Add tini. --- gnu/local.mk | 1 + gnu/packages/mail.scm | 60 +++++++++++++++---- .../patches/public-inbox-fix-spawn-test.patch | 43 +++++++++++++ 3 files changed, 91 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/public-inbox-fix-spawn-test.patch diff --git a/gnu/local.mk b/gnu/local.mk index 03e180cc8508..0653cbb3bc16 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1650,6 +1650,7 @@ dist_patch_DATA = \ %D%/packages/patches/psm-disable-memory-stats.patch \ %D%/packages/patches/psm-ldflags.patch \ %D%/packages/patches/psm-repro.patch \ + %D%/packages/patches/public-inbox-fix-spawn-test.patch \ %D%/packages/patches/pulseaudio-fix-mult-test.patch \ %D%/packages/patches/pulseaudio-longer-test-timeout.patch \ %D%/packages/patches/pulseview-qt515-compat.patch \ diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 8596d0808beb..6f44c6c0f56a 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -87,6 +87,7 @@ (define-module (gnu packages mail) #:use-module (gnu packages django) #:use-module (gnu packages dns) #:use-module (gnu packages docbook) + #:use-module (gnu packages docker) #:use-module (gnu packages documentation) #:use-module (gnu packages emacs) #:use-module (gnu packages enchant) @@ -4084,10 +4085,16 @@ (define-public public-inbox (sha256 (base32 "0xni1l54v1z3p0zb52807maay0yqabp8jgf5iras5zmhgjyk3swz")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (patches (search-patches "public-inbox-fix-spawn-test.patch")))) (build-system perl-build-system) (arguments - '(#:tests? #f + `(#:imported-modules (,@%perl-build-system-modules + (guix build syscalls)) + #:modules ((guix build perl-build-system) + (guix build syscalls) + (guix build utils) + (ice-9 match)) #:phases (modify-phases %standard-phases (add-before 'configure 'qualify-paths @@ -4096,18 +4103,45 @@ (define-public public-inbox (substitute* "lib/PublicInbox/Xapcmd.pm" (("'xapian-compact'") (format #f "'~a'" (search-input-file inputs - "/bin/xapian-compact")))))) + "/bin/xapian-compact")))) + (substitute* "lib/PublicInbox/TestCommon.pm" + ;; This is only used for tests, but get it from ‘inputs’ so + ;; that cross builds won't hold a reference to a package built + ;; for another architecture. + (("/bin/cp") (search-input-file inputs "/bin/cp"))))) (add-before 'check 'pre-check (lambda _ - (substitute* "t/spawn.t" - (("\\['env'\\]") (string-append "['" (which "env") "']"))) - (substitute* "t/ds-leak.t" - (("/bin/sh") (which "sh"))) - (invoke "./certs/create-certs.perl") - ;; XXX: This test fails due to zombie process is not reaped by - ;; the builder. - (substitute* "t/httpd-unix.t" - (("^SKIP: \\{") "SKIP: { skip('Guix');")))) + (invoke "./certs/create-certs.perl"))) + (replace 'check + (lambda* (#:key target + (tests? (not target)) (test-flags '()) + #:allow-other-keys) + (if tests? + (match (primitive-fork) + (0 ;child process + ;; lei tests build UNIX domain sockets in the temporary + ;; directory, but the path of those sockets can be at most + ;; 108 chars and Guix' default value for the variables + ;; below already use 47 chars. Use the shortest temporary + ;; path possible to avoid hitting the limit. + (setenv "TEMP" "/tmp") + (setenv "TEMPDIR" "/tmp") + (setenv "TMP" "/tmp") + (setenv "TMPDIR" "/tmp") + + ;; Use tini so that signals are properly handled and + ;; doubly-forked processes get reaped; otherwise, + ;; lei-daemon is kept as a zombie and the testsuite + ;; fails thinking that it didn't quit as it should. + (set-child-subreaper!) + (apply execlp "tini" "--" + "make" "check" test-flags)) + (pid + (match (waitpid pid) + ((_ . status) + (unless (zero? status) + (error "`make check' exited with status" status)))))) + (format #t "test suite not run~%")))) (add-after 'install 'wrap-programs (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -4126,7 +4160,7 @@ (define-public public-inbox (find-files (string-append out "/bin"))))))))) (native-inputs (list ;; For testing. - lsof openssl)) + lsof openssl tini)) (inputs (list bash-minimal curl diff --git a/gnu/packages/patches/public-inbox-fix-spawn-test.patch b/gnu/packages/patches/public-inbox-fix-spawn-test.patch new file mode 100644 index 000000000000..2739b1974de8 --- /dev/null +++ b/gnu/packages/patches/public-inbox-fix-spawn-test.patch @@ -0,0 +1,43 @@ +From 5593489d9c3ce22b1942f35c7ebb0e06fcf2bfa8 Mon Sep 17 00:00:00 2001 +From: Thiago Jung Bauermann +Date: Fri, 10 Jun 2022 12:39:18 -0300 +Subject: [PATCH] t/spawn: Find invalid PID to try to join its process group + +In the container used to build packages of the GNU Guix distribution, PID 1 +runs as the same user as the test so this spawn that should fail actually +succeeds. + +Fix the problem by going through different PIDs and picking one that +either doesn't exist or we aren't allowed to signal. +--- + +This patch is taken from the public-inbox repository and will appear in the +release after v1.8. + + t/spawn.t | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/t/spawn.t b/t/spawn.t +index 6168c1f6171c..5fc99a2a101c 100644 +--- a/t/spawn.t ++++ b/t/spawn.t +@@ -24,7 +24,18 @@ SKIP: { + is(waitpid($pid, 0), $pid, 'waitpid succeeds on spawned process'); + is($?, 0, 'true exited successfully'); + pipe(my ($r, $w)) or BAIL_OUT; +- $pid = eval { spawn(['true'], undef, { pgid => 1, 2 => $w }) }; ++ ++ # Find invalid PID to try to join its process group. ++ my $wrong_pgid = 1; ++ for (my $i=0x7fffffff; $i >= 2; $i--) { ++ if (kill(0, $i) == 0) { ++ $wrong_pgid = $i; ++ last; ++ } ++ } ++ ++ # Test spawn behavior when it can't join the requested process group. ++ $pid = eval { spawn(['true'], undef, { pgid => $wrong_pgid, 2 => $w }) }; + close $w; + my $err = do { local $/; <$r> }; + # diag "$err ($@)"; base-commit: 965d54e344dcd19adf3c32f8b9d2dcab62b91e6a ------------=_1655469902-22276-1--