From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KPYJCo7uq2LqYwAAbAwnHQ (envelope-from ) for ; Fri, 17 Jun 2022 05:01:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IKDgCY7uq2IQkgAAauVa8A (envelope-from ) for ; Fri, 17 Jun 2022 05:01:34 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 63F7C3F6C7 for ; Fri, 17 Jun 2022 05:01:33 +0200 (CEST) Received: from localhost ([::1]:48964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o22Ej-0001h0-M5 for larch@yhetil.org; Thu, 16 Jun 2022 23:01:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o22EI-0001gg-Qz for guix-patches@gnu.org; Thu, 16 Jun 2022 23:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o22EI-00047R-I9 for guix-patches@gnu.org; Thu, 16 Jun 2022 23:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o22EI-0006hw-E1 for guix-patches@gnu.org; Thu, 16 Jun 2022 23:01:02 -0400 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) 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 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> 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-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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655434893; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9crkGcw/1+G91TPKEsAt+Upb1uWR/GyRQSJ4dTMABVo=; b=o4J3lh4cydS5gdfLDu5Gnref/JhHvpxAeK/XBftU6SHblIgWZHaTI0cn/XB+TWn1pCx1qn dZNawHCKgi71UYVJsvB1J5nBudQGMDhGMWM2fbVzX/EfU6PjxUMQUvIao9P62Wf+UOB+rD Wf65q/+B8x5w2wTdqogB0EwiNYyY9BQU0W/+lcZBV5Mjb3WShg5ntm3g3k4L0OQ0ArL8q3 +8zBizNatlVKaZRUI9zZBq91vjkshaXYpDADXbqXb+82hdcih4fGDZA1ufkIoqRT9B6IlU SoyS4C5VTPHtNQEa8rvIvBE6O+cLp58tDn46mvWRuyujU6lVS6XNbBE0s5yVKA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655434893; a=rsa-sha256; cv=none; b=QNdmk5zxLg+/ey208QhvleWfvfN52HvRr12XRXx2txBKO72PwbzOMjV9mbXSz4FuvV/W4n u34bK4gLpsABhZY5cGiXET0TRmQ5+GWf52IekH74EIcpTWkOV/2JdbyVgxQikyV6W3i+77 ICbLO9OofYvNtGbcSHnh7JQ171fXNUh/OKEf5EO+ffJ8Bqom/IIebeqjArRx8xEdSg4A4a EI8g0shYDb6TQNk09d+2+HG+TCLsGHmu8OwJa+jGgO1S1dI5X/GwJF+xoA4xe713qwGIj/ wo9bGu/KHJqzSLYaTQvk7wieT59Cc05PGiVR7/7M6FMyC76nIeR/cj5g5tchRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=AVjw6wud; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.59 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=AVjw6wud; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 63F7C3F6C7 X-Spam-Score: -5.59 X-Migadu-Scanner: scn0.migadu.com X-TUID: yU4C+MuKlA6v 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