From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 26 07:17:01 2018 Received: (at submit) by debbugs.gnu.org; 26 Mar 2018 11:17:01 +0000 Received: from localhost ([127.0.0.1]:53668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0Q7Y-0005xD-VD for submit@debbugs.gnu.org; Mon, 26 Mar 2018 07:17:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0Q7W-0005wy-NY for submit@debbugs.gnu.org; Mon, 26 Mar 2018 07:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Q7P-000476-TD for submit@debbugs.gnu.org; Mon, 26 Mar 2018 07:16:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58291) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0Q7P-00043T-Lw for submit@debbugs.gnu.org; Mon, 26 Mar 2018 07:16:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Q7O-0002Ah-5V for guix-patches@gnu.org; Mon, 26 Mar 2018 07:16:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Q7K-0003tJ-Vz for guix-patches@gnu.org; Mon, 26 Mar 2018 07:16:50 -0400 Received: from mail-pl0-x22b.google.com ([2607:f8b0:400e:c01::22b]:35851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0Q7K-0003rU-Oo for guix-patches@gnu.org; Mon, 26 Mar 2018 07:16:46 -0400 Received: by mail-pl0-x22b.google.com with SMTP id 91-v6so3919942pld.3 for ; Mon, 26 Mar 2018 04:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:user-agent:from:to:subject:date:message-id:mime-version; bh=7BU8qg1xP8FyMbihUYSSkxFhBGuqSLAZG4pCWK/0h9c=; b=c0mH5bKthuKG83wm1qct+0QLOZibUvY5kp368Afbe8Npc1Oj0oXSIuxpPKogQA/p72 yVFUC4WkwoZ00BaR8HfFWSNHxxLrmBqCj9RASthWIXBf2kExj9VHPweeehLnyewiXnoT eFLmu8jO+j+AFKDedykQbYuB7Ut3KJD02zMbPGFwuAGOjX72kntu5oCJwD1qMApTcVoF wylurfybngZrd5OcGhL34pY+OvvoVdFlcW8SyBYVQA37DtcxabbLq8amolbFilMISTPE EqNZ9cO7SyhNtr6K+4agR2ZrY/mehQdLZ4Kao2MroT+/0y454xi/39cGHMbGWuNdzzhX mIXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:user-agent:from:to:subject:date :message-id:mime-version; bh=7BU8qg1xP8FyMbihUYSSkxFhBGuqSLAZG4pCWK/0h9c=; b=KnnModVUwNghzhTMRtLTXp26Bvo/FAcXR+7pf0J2R4GXXxLhyC2O3h9k2qwgfglKUZ Aw64SPuvljviSe0Dhb4zGYBeBnHvelQVp9DxI1H2Be2T31ddjpJ1rTvzA4QcJHTfidc7 WX5eEHnvYF1ZGM2fq3SQt9o/L3EzAs5B3vjWsLFcPKaWSdjq11HxIGr6kG2efjiOzDv4 Y0E/+x9CMkpnvEpSr6HlkoNoIJ0JMcZ7cJFBO2s9p+17zYcwE5UhfecndtgSFbrgHpX1 9YCOIfvmi0xmB+cRCQgIHdd1+nCbJXK/EIeYVWoWabI/As0o5JvSfVv0+Gj2o72PHLHO NpeQ== X-Gm-Message-State: AElRT7E3iI3+Ouzwg2K5GLOz81KHEm4YrYIjXbbRDNo+7FPR2qSUlghx uot//ZRkhQBXAlltbA6olktFi1JH X-Google-Smtp-Source: AG47ELu4I+68a0xyOYrxXZZLuxpFFdZ4cEx0yNXiWmRTqxScXu0ozymIcE00MrvlcojFwn4kASre6w== X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr39305678plr.361.1522063005236; Mon, 26 Mar 2018 04:16:45 -0700 (PDT) Received: from pidgey (210-1-202-160-cpe.spintel.net.au. [210.1.202.160]) by smtp.gmail.com with ESMTPSA id t1sm25792799pgs.47.2018.03.26.04.16.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 04:16:44 -0700 (PDT) User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro To: guix-patches@gnu.org Subject: [PATCH core-updates] guix: Reap finished child processes in build containers. Date: Mon, 26 Mar 2018 22:16:34 +1100 Message-ID: <87muyvulwt.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit 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.5 (---) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed When working on the Shepherd, I found that in the build containers processes don't get reaped by pid 1. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30637#29. This caused (and will cause) the Shepherd's tests to fail on some systems. Our guile-builder script should handle SIGCHLD and then use waitpid to reap the child processes. Here's my attempt at a patch to do that. I haven't been able to build anything with it because the computer I'm currently on is laughably slow. If someone else can check that you can still build with it I'd really appreciate it. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-guix-Reap-finished-child-processes-in-build-containe.patch Content-Transfer-Encoding: quoted-printable From=207c66818570a139fc4e7b11de34d07c76ebdc6bac Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 26 Mar 2018 22:08:26 +1100 Subject: [PATCH] guix: Reap finished child processes in build containers. * guix/derivations (build-expression->derivation)[prologue]: Handle SIGCHLD and reap child processes when they finish. =2D-- guix/derivations.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/guix/derivations.scm b/guix/derivations.scm index da686e89e..80787e99e 100644 =2D-- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -1180,6 +1180,17 @@ ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUI= LD?, and SUBSTITUTABLE?." (filter module-form? exp)) (_ `(,exp))) =20 + ;; The root process in the build container should re= ap + ;; processes that die, so handle SIGCHLD. + (sigaction SIGCHLD + (lambda () + (let loop () + (match (waitpid WAIT_ANY WNOHANG) + ((0 . _) #f) + ((pid . _) (loop)) + (_ #f)))) + SA_NOCLDSTOP) + (define %output (getenv "out")) (define %outputs (map (lambda (o) =2D-=20 2.16.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq41pIACgkQqdyPv9aw IbwkIBAAsY1CkKoTi0SFmbjGNXXx+PQQmvKBYn94UCRIl6VdhAFiShvNqo0wlDn3 EaRBhyJfC6ZPVTBGhJkdKY1Ar8xiL/9XYE/GpWKzCpITaccTpS1PwLO6A5dmXwUp 5jhhVOfVT1cQb7jSEWlDzee2gcnMUEWwoxM259/tJX3bJeYROnuhfQwZ4PFqBNWq 8njF6cdPVKh059A0Lvp4VUas7HnskHosdzoRzAsFjiwuQMtXX4eO4Vpb1fUsNocA 90JrgJZayu0PfvF3BG8qbkQJixSsgkbBB478L3kk/XUJJsjDCEAA0JYyXPEAWzE7 tmC6DQeZvxl9N7gVYFLk0gWdXXaFWwPieLYR7CvQwk+r9s9bY5b0/904cdx6ZcbY UARtItvXJM3raYuFdG69Dtw/xkj906ljRr+USTcB5kBgrl6oZWh27bVKNVVefdOs TNUFjx7gRUvuFPU6N5foxoJ5+STP4DEg75zqYleLVHhJ/kX7TprviA+aOik+uiN3 /C/WpoWPBxvb++2TYD0VML97OHZa8MML9DswhZvchY2PHHkFfmCrJAYjTj/gHje+ FfRODwEj+EiqTNRnATyFFKzcIRPQkpWyytPbk6T/tq5HonzfD1bmTDTeZY7A4Orh 5gC3Z711PvfLe+N/9JZHBAwSel8sFHyrGw8cv161vxtn2llQlSY= =XRYr -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 26 19:39:58 2018 Received: (at 30948) by debbugs.gnu.org; 26 Mar 2018 23:39:58 +0000 Received: from localhost ([127.0.0.1]:54927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0biX-0004OR-G6 for submit@debbugs.gnu.org; Mon, 26 Mar 2018 19:39:58 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:40409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0biU-0004OB-1R for 30948@debbugs.gnu.org; Mon, 26 Mar 2018 19:39:55 -0400 Received: by mail-pf0-f178.google.com with SMTP id v66so5680096pfv.7 for <30948@debbugs.gnu.org>; Mon, 26 Mar 2018 16:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:subject:in-reply-to:date :message-id:mime-version; bh=JH42JLREWHcDGcHQfuMWpLGydG/QAXtfUzEZ+Pv0DpY=; b=Aev745OA8qfwc+GiafRrK9HAHtWO5pV2wji6CHyUpzMpgsuUMFZpd+jhxCP0qPC7Qb oQ3P/d4rawueenzO3/O5PAz9xin22UK1dy5QNk7Jd34VvraGO+DOlCknYCaT2wTkFq16 zL4qY5qosro8Gpmxl2tphRXucOstxxAXnZIGh07I/cX6eNKptx4Gg2AMPK2x+GnTlSol LTpAFwLXscNJDIrJ4hljdXyHlNXibonyqI5YRXZrajVHU1/53mfbOtyEk1YMql3z7/bU 59RzwsynJP/sngy2l661RoAV6CeO/8EYUM1EUs33PWHYU50hQXHJmye+uMfs2qOKM4ww wKiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:subject :in-reply-to:date:message-id:mime-version; bh=JH42JLREWHcDGcHQfuMWpLGydG/QAXtfUzEZ+Pv0DpY=; b=HZOxdZIwfWmhl5mESdXfQzObTSI98Nm52RVnbNQNtUn/QLKFYkfpB995nn77503Gm3 Eaq+/ma/HivQidrnM2tAW+4Net8/93YQfWObzraJA4v0jU9kquHZ7epK+gN+0rbe1Ld3 Cf3Dz+nwpmpFV/M/cueNjEmJWrJNpZWqgO09vBbWE+AY0I0l9FlV8rG6YLfytV3hJKqv 3ZyZLjHUYYsbY1OVTYAxEZtBhl2i496ZacxsDDdvWRPwxDrA8fn1WwB2SQFjWkqk2i0H iQ1byjMU0Yp5v+qWOrhWWwsN7K+gf8jiMqajkkqBvDwQ9veSrnHiM4Q1yioqBCuSv9AQ fuaQ== X-Gm-Message-State: AElRT7H0RQXmsctL6IX/0NO6RJ6nMZqJD0Nl/WccVDWix1mo8VCnVglo b8XO3tJIjhNSC8CzlYqwS2E7h7W4 X-Google-Smtp-Source: AG47ELsTSVkJBhBBQNuf+uIbG2XbfvJ+/kQa+WZ0g7nhx3xmiqkFxreR2CU2pV2qcZig5d8qZkl+pw== X-Received: by 10.99.49.19 with SMTP id x19mr15921473pgx.250.1522107587741; Mon, 26 Mar 2018 16:39:47 -0700 (PDT) Received: from pidgey ([210.1.202.160]) by smtp.gmail.com with ESMTPSA id o88sm23591061pfk.53.2018.03.26.16.39.45 for <30948@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 16:39:46 -0700 (PDT) References: <87muyvulwt.fsf@zancanaro.id.au> User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro To: 30948@debbugs.gnu.org Subject: Re: [PATCH core-updates] guix: Reap finished child processes in build containers. In-reply-to: <87muyvulwt.fsf@zancanaro.id.au> Date: Tue, 27 Mar 2018 10:39:41 +1100 Message-ID: <878tae76f6.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 30948 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: 0.5 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed Okay, it turns out my previous patch was very wrong. I tried to start a build and it broke pretty significantly. I've attached a new patch that at least starts building. My computer takes too long to actually build anything, but I'm slightly more confident that my change won't break everything. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-guix-Reap-finished-child-processes-in-build-containe.patch Content-Transfer-Encoding: quoted-printable From=20c57b2fe19865afc21fd1fd9a7cad3286b05a9b22 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 26 Mar 2018 22:08:26 +1100 Subject: [PATCH] guix: Reap finished child processes in build containers. * guix/derivations (build-expression->derivation)[prologue]: Handle SIGCHLD and reap child processes when they finish. =2D-- guix/derivations.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/guix/derivations.scm b/guix/derivations.scm index da686e89e..27ab3e420 100644 =2D-- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -1201,6 +1201,21 @@ ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUI= LD?, and SUBSTITUTABLE?." (else drv)))))) inputs)) =20 + ;; The root process in the build container should re= ap + ;; processes that die, so handle SIGCHLD. + (use-modules (ice-9 match)) + (sigaction SIGCHLD + (lambda _ + (let loop () + (match (catch 'system-error + (lambda () + (waitpid WAIT_ANY WNOHANG)) + (lambda args + '(0 . -))) + ((0 . _) #f) + ((pid . _) (loop))))) + SA_NOCLDSTOP) + ,@(if (null? modules) '() ;; Remove our own settings. =2D-=20 2.16.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq5hL0ACgkQqdyPv9aw Ibw7AA//fT/jMaBcVfGr2W+AN+nsndZ5kJyFAh+y+IbSah3QFYX4FThNTMn0vxLB Wk2lB84ry+jRk5v8P/SFJSrgf6QkoU50psNwd/rkH9fUjjVfLlSGyV5qMwxybNoj QbT2YL/e0xDt1RNN92wuAOQv8PrsBS2ZLqow2fU9H9tPrEb9SBr8ej1oyeGcLs/z ybJlk1KcXpJ79Er716r7tEJxTyiAWOu/PTwvetfsvohUoSoIMgIofBYYudWVP2xr 1ABOASzEITWO2/0Y+XkoN3J8SZTVWjLssw9aaHLdE+7PD7DkDA/qvlzpbLM48SzK eTsmRxXU8li5Sif6wHZ9Y0snWKs4tS1QbExFXJL2dnKOOpltp6ddsrvFq4SX4lMX dQ8l85KWvJDOjnPJ1VaU5OjNUcAGpcHrLvcZ17ePCwDOiuZNZFA1CBhxD5RbH+0B 1usyMd8PvVUo+H8HGC2cbhlwiuZjn6Id4kgn7j9ozaMaRfbUt8yP++EIt/+8GEvo V3uTNVVNXL8omBIXrZH3zOcznqZE/X5yAswcWINShHiWI9Hm6xspspdJp4bPu8+U hFRaW7+Zf1TFbJkg4aDTxpORzP4WOCkzqXb1Kz6gS1qa2PwqzSdLZGq6h5Ep6xmk 3F312fAFpAP03uOKuwVdtHrsH/e+nfVfKk5b2EIBgze8E5N96TQ= =AsO6 -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 29 16:07:12 2018 Received: (at 30948) by debbugs.gnu.org; 29 Mar 2018 20:07:12 +0000 Received: from localhost ([127.0.0.1]:59069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1dpH-0005Ah-U2 for submit@debbugs.gnu.org; Thu, 29 Mar 2018 16:07:12 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:45870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1dpF-0005AY-Fc for 30948@debbugs.gnu.org; Thu, 29 Mar 2018 16:07:10 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8725D12BD8; Thu, 29 Mar 2018 22:07:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lnfDb7iQa_FT; Thu, 29 Mar 2018 22:07:07 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9C6F212BD7; Thu, 29 Mar 2018 22:07:06 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> Date: Thu, 29 Mar 2018 22:07:05 +0200 In-Reply-To: <87muyvulwt.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Mon, 26 Mar 2018 22:16:34 +1100") Message-ID: <87bmf6ve6u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30948 Cc: 30948@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: 1.0 (+) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Carlo, Carlo Zancanaro skribis: > When working on the Shepherd, I found that in the build containers > processes don't get reaped by pid 1. See > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30637#29. This caused > (and will cause) the Shepherd's tests to fail on some systems. > > Our guile-builder script should handle SIGCHLD and then use waitpid to > reap the child processes. Here's my attempt at a patch to do that. I would rather install the handler as a phase in gnu-build-system: this leaves =E2=80=98build-expression->derivation=E2=80=99 generic, and also giv= es us more flexibility (e.g., we can disable that phase without doing a full rebuild if needed.) See the patch below. WDYT? On my first attempt with: ./pre-inst-env guix build -e '(@@ (gnu packages commencement) findutils-b= oot0)' quickly failed: --8<---------------cut here---------------start------------->8--- checking for vfork.h... no checking for fork... yes checking for vfork... yes checking for working fork... Backtrace: In ice-9/boot-9.scm: yes checking for working vfork... (cached) yes checking for strcasecmp... 157: 13 [catch #t # ...] In unknown file: ?: 12 [apply-smob/1 #] In ice-9/boot-9.scm: 63: 11 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 432: 10 [eval # #] In ice-9/boot-9.scm: 2320: 9 [save-module-excursion #] 3966: 8 [#] 1645: 7 [%start-stack load-stack #] 1650: 6 [#] In unknown file: ?: 5 [primitive-load "/gnu/store/pz3jy89ax5jg0j6fnp5n42x4vznga8s3-make-b= oot0-4.2.1-guile-builder"] In ice-9/eval.scm: 387: 4 [eval # ()] In srfi/srfi-1.scm: 619: 3 [for-each # ...] In /gnu/store/hf8xflikhgsd4hfy9h8s0cjzfqm8f3yb-module-import/guix/build/gnu= -build-system.scm: 819: 2 [# #] In /gnu/store/hf8xflikhgsd4hfy9h8s0cjzfqm8f3yb-module-import/guix/build/uti= ls.scm: 614: 1 [invoke "/gnu/store/g34swjqyw205d15pyra39j56qvyxq9w9-bootstrap-bina= ries-0/bin/bash" ...] In unknown file: ?: 0 [system* "/gnu/store/g34swjqyw205d15pyra39j56qvyxq9w9-bootstrap-bin= aries-0/bin/bash" ...] ERROR: In procedure system*: ERROR: In procedure system*: Interrupted system call builder for `/gnu/store/hc96d5dcshbdgavpp0j01qnsjf0yf9z5-make-boot0-4.2.1.d= rv' failed with exit code 1 --8<---------------cut here---------------end--------------->8--- This is why =E2=80=98install-SIGCHLD-handler=E2=80=99 in the patch does not= hing on Guile <=3D 2.0.9. Now, we=E2=80=99d need to test it for real with Guile 2.2. I suppose one w= ay to test without rebuilding it all would be to add this phase explicitly in a package and try building it with --rounds=3D10 or something. Would you like to try that? Note that we have only a couple of days left before the =E2=80=98core-updat= es=E2=80=99 freeze. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index be5ad78b9..2c6cb4ad2 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -51,6 +51,28 @@ (define time-monotonic time-tai)) (else #t)) +(define* (install-SIGCHLD-handler #:rest _) + "Handle SIGCHLD signals. Since this code is usually running as PID 1 in the +build daemon, it has to reap dead processes, hence this procedure." + ;; In Guile <= 2.0.9, syscalls could throw EINTR. With these versions, + ;; installing a SIGCHLD handler is not safe because we could have uncaught + ;; 'system-error' exceptions at any time. + (when (or (not (string=? (effective-version) "2.0")) + (> (string->number (micro-version)) 9)) + (format #t "installing SIGCHLD handler in PID ~a\n" (getpid)) + (sigaction SIGCHLD + (lambda _ + (let loop () + (match (catch 'system-error + (lambda () + (waitpid WAIT_ANY WNOHANG)) + (lambda args + '(0 . -))) + ((0 . _) #f) + ((pid . _) (loop))))) + SA_NOCLDSTOP)) + #t) + (define* (set-SOURCE-DATE-EPOCH #:rest _) "Set the 'SOURCE_DATE_EPOCH' environment variable. This is used by tools that incorporate timestamps as a way to tell them to use a fixed timestamp. @@ -758,7 +780,8 @@ which cannot be found~%" ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () ((_ p ...) `((p . ,p) ...))))) - (phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack + (phases install-SIGCHLD-handler + set-SOURCE-DATE-EPOCH set-paths install-locale unpack bootstrap patch-usr-bin-file patch-source-shebangs configure patch-generated-file-shebangs --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 29 17:16:12 2018 Received: (at 30948) by debbugs.gnu.org; 29 Mar 2018 21:16:12 +0000 Received: from localhost ([127.0.0.1]:59099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1eu3-0006mH-UV for submit@debbugs.gnu.org; Thu, 29 Mar 2018 17:16:12 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:43320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1eu2-0006m5-Oq for 30948@debbugs.gnu.org; Thu, 29 Mar 2018 17:16:11 -0400 Received: by mail-pf0-f182.google.com with SMTP id j2so4087100pff.10 for <30948@debbugs.gnu.org>; Thu, 29 Mar 2018 14:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=V/KMDxHzv22SM0bTAkM9xBVJO5jDcUAYelQSXqwoJr0=; b=Eyxzf6TfPQHNqSmS+roCWw/Rw8Q0Pk9dTPq1KJu0MHL/FsDVELiRIZhe8B9psLtq5T g/ozUu9Q/vJNtka00mLiS48jBM3nzxB9z2mj8D7qCDM3SzXndEiGJtaYZmOwCSue4cFT L/01WFE6TjKKf7t3BIDB8LLY2NMSZoXlJY6NAOpkNCidxQcok7aYt9RsvdbcsovdkGMs qLmhZgDsHQ9GiBOmAzHNbGaqjvhnljeHSdOSDELv38/DHbJ7WmIzTkk4sh2wAwwew6xH d46IHLg3e+oHCQLAVpby052W9nRvq5AQ2fLSj9/o7ItRHegb74ryEptOlkj+qgrlsrab y2Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=V/KMDxHzv22SM0bTAkM9xBVJO5jDcUAYelQSXqwoJr0=; b=apLbIrvBxkJbPjhksdL0G+asAuXzPep/UrU4IzoaRh0Edc4ZeSRkKwO2krQfBYi5gk BI4Xo2dzWulTGkQ2gqmmvvo6UJlksy1/uWusS5o1s1lk+DsjzgMLKBj0NSlvGT9k7Uet 7dMKotXQDkpBX2L44U6fdK1JsGs6Luf/+RIrZvVv1Z28XxCtJuDoqbECdU/VlY7uGYpI tgvVn1cAE8kIHs8XHIju85VjLWHYE+pSMvN/C4fEZEhzPqCyq/7zZFoFJ1sTZwewZZVg 0ASBGv8v7k87LX2H9580YZO7q2v6SiYXqwbVpCTVESVj9jNSDDQ9epIHjD/I3/BW6KI9 wf6w== X-Gm-Message-State: AElRT7EmsGEpnheSt4P2/SddVuz1rUCt8N/BQRT+QTFsFXVzZ2VJNZHY Dd5XSzgLoNVqSbx+1I0tJe1Kwx/A X-Google-Smtp-Source: AIpwx48XDYd4oA3WFdSXSKt7f1Yd2nZWmZgcsIgq7jOMuoZn6sq8kNC0iqG8GEoHTEgH6AsEafVrKw== X-Received: by 2002:a17:902:8282:: with SMTP id y2-v6mr4759084pln.7.1522358164214; Thu, 29 Mar 2018 14:16:04 -0700 (PDT) Received: from pidgey (210-1-202-160-cpe.spintel.net.au. [210.1.202.160]) by smtp.gmail.com with ESMTPSA id k24sm13482544pff.77.2018.03.29.14.16.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Mar 2018 14:16:02 -0700 (PDT) References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child processes in build containers. In-reply-to: <87bmf6ve6u.fsf@gnu.org> Date: Fri, 30 Mar 2018 08:15:51 +1100 Message-ID: <87sh8id1mg.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@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: 0.5 (/) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hey Ludo, On Thu, Mar 29 2018, Ludovic Court=C3=A8s wrote: > I would rather install the handler as a phase in=20 > gnu-build-system: this leaves =E2=80=98build-expression->derivation=E2=80= =99=20 > generic, and also gives us more flexibility (e.g., we can=20 > disable that phase without doing a full rebuild if needed.) See=20 > the patch below. > > WDYT? What do you mean by "generic"? From what I can understand it's one=20 of pid 1's responsiblities to reap child processes, so I would=20 expect this to be set up for every builder, before the builder is=20 run. Given it's not specific to the gnu-build-system, I don't=20 think it really fits there. > On my first attempt with: > > ./pre-inst-env guix build -e '(@@ (gnu packages commencement)=20 > findutils-boot0)' > > quickly failed: > > ... > > This is why =E2=80=98install-SIGCHLD-handler=E2=80=99 in the patch does n= othing=20 > on Guile <=3D 2.0.9. From=20what I understand, Guix depends on Guile 2.0.13 or later, so=20 I didn't think it needed to work with 2.0.9. From my quick check,=20 though, our bootstrap binaries are Guile 2.0.9? I can see how that=20 might cause a problem. In what sense does Guix require 2.0.13 (as=20 the manual claims) rather than 2.0.9? > Now, we=E2=80=99d need to test it for real with Guile 2.2. I suppose=20 > one way to > test without rebuilding it all would be to add this phase=20 > explicitly in > a package and try building it with --rounds=3D10 or something.=20 > Would you > like to try that? Yeah, I'll give it a go. Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq9V4gACgkQqdyPv9aw IbwfFA/6A+eIjcEhtb6obaSPl1hhiZj/bPIftEpE5m/DS0AHqxsAfwejLA6I/av6 jJdswbSER/nQanDO5u685G0pvQLmJL5NlFCrjC4Ji/vi0FlTtVOOI8xaUsQFrXrb eu+HhWg891VvI1hKSfrQm8ZOYzi+SyayCatontP4M4rUFbzY4UQFJZNf8IPtUAY/ N7YVv3UJ2nGGGOMU89u52idSpVxBRBesdUyszvLTW4yLKXM7wjpDP4jq1W+MJ8j+ kXEn7iNNG8L1jOTgCNPOrD0j+pnlyh4hCstaDx8AcJsbJO7cUCM3/t86Nogo27R2 nY8M+ayYUZ3mpoU4PfTDQZ4dVUoxFPqJ+mAqZ3NtYLrRZLlQQots+qLWTSIsUqoz MI8+yaMbQej7sEGrU6pJUmwKggEpMbKdHrTsUPXAXHupBylyoXnboIzCh0aJ9kAR 4u0djoW/eAJo6Z7AuxCuO023z0mTqeAgI5dkPUx4C0S8Zl3csaFP/rO9SzFvehSy +iWgD8BCJTZEMtgX+WUWyO37FyvvCCvOtrcLgizBJ3m2OdYZ/U1kbS3HqFaxgtvp pEuwPWNnYNk5mM09dl/l7aV9TCbJRuryZV5Ued5pP9P9JCRcHIaz756AW98uZs3C b9r2Bc6xVhkWiEv0SXv42HFCUJcfHhOS2e/BJO6F4Q/xufEnj8Y= =3nBj -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 30 04:16:44 2018 Received: (at 30948) by debbugs.gnu.org; 30 Mar 2018 08:16:44 +0000 Received: from localhost ([127.0.0.1]:59336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1pDH-0000i1-VX for submit@debbugs.gnu.org; Fri, 30 Mar 2018 04:16:44 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:49988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1pDF-0000hs-8H for 30948@debbugs.gnu.org; Fri, 30 Mar 2018 04:16:42 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 96C8612CE2; Fri, 30 Mar 2018 10:16:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TWmZrQqpJ-Yt; Fri, 30 Mar 2018 10:16:39 +0200 (CEST) Received: from ribbon (unknown [193.50.110.67]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 8560112CBC; Fri, 30 Mar 2018 10:16:39 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Germinal an 226 de la =?utf-8?Q?R=C3=A9volution?= 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, 30 Mar 2018 10:16:39 +0200 In-Reply-To: <87sh8id1mg.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Fri, 30 Mar 2018 08:15:51 +1100") Message-ID: <87vadeou54.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30948 Cc: 30948@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: 1.0 (+) Heya, Carlo Zancanaro skribis: > On Thu, Mar 29 2018, Ludovic Court=C3=A8s wrote: >> I would rather install the handler as a phase in gnu-build-system: >> this leaves =E2=80=98build-expression->derivation=E2=80=99 generic, and = also gives >> us more flexibility (e.g., we can disable that phase without doing a >> full rebuild if needed.) See the patch below. >> >> WDYT? > > What do you mean by "generic"? I want as little magic as possible around the expression that=E2=80=99s pas= sed to =E2=80=98build-expression->derivation=E2=80=99. > From what I can understand it's one of pid 1's responsiblities to reap > child processes, so I would expect this to be set up for every > builder, before the builder is run. True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D beca= use eventually guix-daemon terminates all its child processes. > Given it's not specific to the gnu-build-system, I don't think it > really fits there. Yes, but note that it would be inherited by all the build systems. >> On my first attempt with: >> >> ./pre-inst-env guix build -e '(@@ (gnu packages commencement) >> findutils-boot0)' >> >> quickly failed: >> >> ... >> >> This is why =E2=80=98install-SIGCHLD-handler=E2=80=99 in the patch does = nothing on >> Guile <=3D 2.0.9. > > From what I understand, Guix depends on Guile 2.0.13 or later, so I > didn't think it needed to work with 2.0.9. From my quick check, > though, our bootstrap binaries are Guile 2.0.9? Exactly. > I can see how that might cause a problem. In what sense does Guix > require 2.0.13 (as the manual claims) rather than 2.0.9? There=E2=80=99s the =E2=80=9Chost side=E2=80=9D (the =E2=80=98guix=E2=80=99= commands and related modules), and there=E2=80=99s the =E2=80=9Cbuild side=E2=80=9D (code used in the build en= vironment when building derivations.) The =E2=80=9Cbuild side=E2=80=9D is fully specified: =E2=80=98guix graph=E2= =80=99 shows exactly what Guile is used where, and you can see with, say: guix graph -t derivation \ -e '(@@ (gnu packages commencement) findutils-boot0)' that the early derivations run on Guile 2.0.9. For =E2=80=9Chost side=E2=80=9D code, users can use any Guile >=3D 2.0.13. See also . I hope this clarifies a bit! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 30 07:17:26 2018 Received: (at 30948) by debbugs.gnu.org; 30 Mar 2018 11:17:26 +0000 Received: from localhost ([127.0.0.1]:59412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1s2A-0004pI-9Q for submit@debbugs.gnu.org; Fri, 30 Mar 2018 07:17:26 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1s28-0004p5-Op for 30948@debbugs.gnu.org; Fri, 30 Mar 2018 07:17:25 -0400 Received: by mail-pf0-f177.google.com with SMTP id u86so5266826pfd.2 for <30948@debbugs.gnu.org>; Fri, 30 Mar 2018 04:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:message-id :in-reply-to:date:mime-version; bh=RbwRXuM9eqeFTsC0SnbqvbyKnD7Eu8LVAQukofh3w4s=; b=mys2BoJj+I+T/fVyuie/jaUKlJxyasp89PzNLyTmhAFdKAPuM0PhSv2j8teWtEuvBJ 6MXgZpCP2Ky75oW3m2IL9nfCIBbTjBHNiev4v64Zb+FHspcHPs4Z+F7jQK+K3Xge5Iaa Ng0UZDsaa5CuENI1RmAPbs+/cd/0ezWG9XvnvqPpnynmNhghr3l7c70JQeY7Ak0b7XRS 5etZ+6SEOxClkOyRRRAt/wQckDgE/xbYBL/MOZ3I2MfG22sopfyJh/ehJ34VUjpDaWkv LneyPTHxTdkRc++c7DWN9vCU2+j4eK3JF1eIm5oWFDVdOXwACewysl1a3GtxHMFXyPTJ GYlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :message-id:in-reply-to:date:mime-version; bh=RbwRXuM9eqeFTsC0SnbqvbyKnD7Eu8LVAQukofh3w4s=; b=LiTTMDQT+nW3Tifp2NDsVduyKPujL9qp4enXt9JJkmT6/Ik7RaE21QWsNkth+rb+d4 OvaxZlAkXcd5x86VxXvUSx9mtXlVUYojYrXO1zij1lKNeLe3VqryZek7kGu0dJxgWZFa xD7/3ACEgSVJ7exET014ei6n0mDoz+BjieJ11REUNDIHlHIS7HfzPYHajn+DZ9FwVaX2 DWOgGxGx6XWcpb49Oeq5HkvOmwoRWGC3cV0esqCwV82j0ON0qCg031ahC8CLXu2DjNQ0 ENSnxesY5MmGtsPPAYRjn4NPp7AoApbvLBk+EyZFy3D7iu4kI/VZd3ErFfUJnroujRx5 8Whg== X-Gm-Message-State: AElRT7EJOEizaVpAY8L+Z6goI7/u0zD6Q1S/wZmSthsV2DMN69dr9Yg6 gwkzinshB9dnljCqUSzMYz3QIdKa X-Google-Smtp-Source: AIpwx4+lBCUn7quopdFhMebAEjY57bEwV4MnGGJoFa1axNKb3cevh8kppGbpQ3N6S3OpcCa8l+R3yA== X-Received: by 10.99.190.5 with SMTP id l5mr8324299pgf.25.1522408638081; Fri, 30 Mar 2018 04:17:18 -0700 (PDT) Received: from gengar (210-1-202-160-cpe.spintel.net.au. [210.1.202.160]) by smtp.gmail.com with ESMTPSA id k70sm15013354pga.72.2018.03.30.04.17.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Mar 2018 04:17:17 -0700 (PDT) References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child processes in build containers. Message-ID: <87o9j5x1d4.fsf@zancanaro.id.au> In-reply-to: <87vadeou54.fsf@gnu.org> Date: Fri, 30 Mar 2018 22:17:06 +1100 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@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: 0.5 (/) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hey, On Fri, Mar 30 2018, Ludovic Court=C3=A8s wrote: >> From what I can understand it's one of pid 1's responsiblities=20 >> to reap child processes, so I would expect this to be set up=20 >> for every builder, before the builder is run. > > True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D be= cause=20 > eventually guix-daemon terminates all its child processes. As long as the build process doesn't rely on behaviour that,=20 strictly speaking, it should be allowed to rely on. It's not an=20 issue of resource leaking, it's an issue of correctness. >> Given it's not specific to the gnu-build-system, I don't think=20 >> it really fits there. > > Yes, but note that it would be inherited by all the build=20 > systems. Except for trivial-build-system, which is probably fine. I still=20 don't think it fits in a specific build system, given it's a=20 behaviour that transcends the specific action happening within the=20 container. Putting it in gnu-build-system will solve the problem in all=20 realistic cases, so that's probably fine. It's still subtly=20 incorrect, but will only be a problem if something using the=20 trivial build system relies on pid 1 to reap a process, or if we=20 make a new build system not deriving from gnu-build-system (which=20 seems unlikely, but not impossible). > The =E2=80=9Cbuild side=E2=80=9D is fully specified: =E2=80=98guix graph= =E2=80=99 shows exactly=20 > what Guile is used where, and you can see with, say: > > guix graph -t derivation \ > -e '(@@ (gnu packages commencement) findutils-boot0)' > > that the early derivations run on Guile 2.0.9. > > For =E2=80=9Chost side=E2=80=9D code, users can use any Guile >=3D 2.0.13. Yeah, okay. That makes sense. I guess I just expected 2.0.13 to be=20 the minimum version throughout. Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEwWt2bKTcV+mIZ20oCShLEsLiKqIFAlq+HLIACgkQCShLEsLi KqL7WAgAyftn/CJ0pPyDVc6L3qwhmU58s5hsT6U+E7TkRdkdf1NY6Hl1JK4JygJt FRFy7IuDgPWm4UpuBrCbHTbA5G7yzNoSqPzFiG+ephJmXvCyCg578NEfLD/ChUmz D/ES/rWw/rFmqTWTVxHZrnC7buiNOS9BgiiMkYbZ5cmAP1s77pzGFPKiZXoyp5zw zyn3lGPlh+ULvLGah+PdjLMM74qhIi7y3MDpGdRuHEFmCP4+vdz/33bZKwFqQ1YE Cj3Yi2tDPA4Ana0oAqCs4SMLGcseaZpAR4CmkDqaMq4t891k+JJ6EcvV45dFF0is 7gba+//F3RQAH9e1ujrp3SXCweO2GA== =qY0n -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 30 11:17:35 2018 Received: (at 30948) by debbugs.gnu.org; 30 Mar 2018 15:17:35 +0000 Received: from localhost ([127.0.0.1]:60357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1vmZ-0001cP-0U for submit@debbugs.gnu.org; Fri, 30 Mar 2018 11:17:35 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:54342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1vmW-0001cC-RM for 30948@debbugs.gnu.org; Fri, 30 Mar 2018 11:17:33 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 9112F12DB7; Fri, 30 Mar 2018 17:17:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V44PfniXDD_X; Fri, 30 Mar 2018 17:17:29 +0200 (CEST) Received: from ribbon (unknown [193.50.110.67]) by hera.aquilenet.fr (Postfix) with ESMTPSA id C75C912DAB; Fri, 30 Mar 2018 17:17:29 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Germinal an 226 de la =?utf-8?Q?R=C3=A9volution?= 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, 30 Mar 2018 17:17:29 +0200 In-Reply-To: <87o9j5x1d4.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Fri, 30 Mar 2018 22:17:06 +1100") Message-ID: <874lkxoanq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30948 Cc: 30948@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: 1.0 (+) Hello, Carlo Zancanaro skribis: > On Fri, Mar 30 2018, Ludovic Court=C3=A8s wrote: >>> From what I can understand it's one of pid 1's responsiblities to >>> reap child processes, so I would expect this to be set up for every >>> builder, before the builder is run. >> >> True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D b= ecause eventually >> guix-daemon terminates all its child processes. > > As long as the build process doesn't rely on behaviour that, strictly > speaking, it should be allowed to rely on. It's not an issue of > resource leaking, it's an issue of correctness. Right. >>> Given it's not specific to the gnu-build-system, I don't think it >>> really fits there. >> >> Yes, but note that it would be inherited by all the build systems. > > Except for trivial-build-system, which is probably fine. I still don't > think it fits in a specific build system, given it's a behaviour that > transcends the specific action happening within the container. > > Putting it in gnu-build-system will solve the problem in all realistic > cases, so that's probably fine. It's still subtly incorrect, but will > only be a problem if something using the trivial build system relies > on pid 1 to reap a process, or if we make a new build system not > deriving from gnu-build-system (which seems unlikely, but not > impossible). I agree, every Guile process running as PID=C2=A01 should reap processes. My view is just that this mechanism belongs in =E2=80=9Cuser code=E2=80=9D,= not in the low-level mechanisms such as =E2=80=98build-expression->derivation=E2=80=99= and =E2=80=98gexp->derivation=E2=80=99. It=E2=80=99s a matter of separation of= concerns. Of course we don=E2=80=99t want to duplicate that code every time, but the = way we should factorize it, IMO, is by putting it in a =E2=80=9Cnormal=E2=80=9D= module that people will use. Putting it in gnu-build-system is an admittedly hacky but easy way to have it widely shared. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 24 11:40:35 2022 Received: (at 30948) by debbugs.gnu.org; 24 Nov 2022 16:40:35 +0000 Received: from localhost ([127.0.0.1]:59895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyFH8-0001uQ-Ru for submit@debbugs.gnu.org; Thu, 24 Nov 2022 11:40:35 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:40859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyFH7-0001u8-Ms; Thu, 24 Nov 2022 11:40:33 -0500 Received: by mail-qt1-f181.google.com with SMTP id jr19so1277118qtb.7; Thu, 24 Nov 2022 08:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=cUqsiKqmn65Xernw7Hyq8Nqr5S6Buqfd55NR4yWvFZo=; b=MTxF7s5I/11MgDDfRp1xFa0rTBM1BHL63C+tGep2VlE3g0IPyY0PLK/38P+z7TKHjp loYz/pUeCAcxoCWusw6FcY6mvnWRxJ0dJj2SdqR9tRWj3PNwbcizyEhXyHok332rOpIx AAwHk2GRs1TDDDOZZXBkTgAm2E2NM3m79gPm8ZZuJVOjCGE9HWuxyNuAn7hTtjlG3ekz L5PUUtYaFjhdEogikS9us1iSTkbtPCNjxY2i3KOx8Hj5G1HZh469MEq/APFoSJBMjDOA vYhTXez/ConSwNmJT3yS+nWpW/OFuxBjLQTcMP4a6+m/t4SbR11Wre61llDjXzFJcyzg u3nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cUqsiKqmn65Xernw7Hyq8Nqr5S6Buqfd55NR4yWvFZo=; b=vh3Jq0swp43Mm7KPpbobNkQPv+nmbsyrh4W0kqWanDKNOAN3bHgpkEdB68BqVFpaFB ZQXxuAhyn7lo8cPO6Do+lNb7k5L1b04/U4AOWU6SK5IHNjq8cczScAUR1NOLCWFnycon ZASxC5vLdyuftVKR3ganMfq9iC9bJAlCPQx5l4hwNojBemf0rIvF8E2m4Wx8e03F9y75 qEkq6gv1xebkPLEIj9MN4uOF2b0fpZXBgtxU7zeq+YS+6/CJQXGhJaC9LIPEAneaXhq7 k/9ICEjq1J6TY3oU7C6RpNnmJaj08v5ROpDbdYYdIg06/9Y91yMG97sIA57ojZPcqfrG DDtg== X-Gm-Message-State: ANoB5pkizIuiZsyzlWtJ1Qcg3biMxrIKFxgY+2+hjLhrUf/jLgDNPnFb CZQeTfofqFseRyOV1pebWSJDRmPGLQQ= X-Google-Smtp-Source: AA0mqf775hwGK89VaJFairPSpfYo5rXHAamJibcwys705B5xs6rUNEeg7iJsXFViRn+E7KIaWwAyzQ== X-Received: by 2002:a05:622a:189f:b0:39a:c6ac:fd49 with SMTP id v31-20020a05622a189f00b0039ac6acfd49mr13718717qtc.201.1669308027850; Thu, 24 Nov 2022 08:40:27 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1003]) by smtp.gmail.com with ESMTPSA id dt31-20020a05620a479f00b006fc2e2198easm1111336qkb.95.2022.11.24.08.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 08:40:27 -0800 (PST) From: Maxim Cournoyer To: 30948@debbugs.gnu.org Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> Date: Thu, 24 Nov 2022 11:40:26 -0500 In-Reply-To: <874lkxoanq.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 30 Mar 2018 17:17:29 +0200") Message-ID: <87h6yonw5h.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: Carlo Zancanaro , GNU Debbugs , Ludovic =?utf-8?Q?Court=C3=A8s?= 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 (-) reassign 30948 guix thanks -- Hi, I'm moving this from 'guix-patches' to 'guix', so that it's more discoverable as a *bug*. It still bites us every now and then (grep the Guix source code for usages of tini to find some occurrences). Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 24 11:44:36 2022 Received: (at 30948) by debbugs.gnu.org; 24 Nov 2022 16:44:36 +0000 Received: from localhost ([127.0.0.1]:59911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyFL2-00021U-2K for submit@debbugs.gnu.org; Thu, 24 Nov 2022 11:44:36 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:33307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyFL0-00021I-Fk for 30948@debbugs.gnu.org; Thu, 24 Nov 2022 11:44:34 -0500 Received: by mail-qk1-f180.google.com with SMTP id x21so1297004qkj.0 for <30948@debbugs.gnu.org>; Thu, 24 Nov 2022 08:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=CrT8c52zNHQI5C47jEmoAd8qF9LOz0f/cfKrzQ3ZEAA=; b=P5aZI6yZgza3nsibP+r0TtPs0zSn1gTJpjASE/RnLVlQW+eT+z8/8q6zkWPQEdsvrr t3+UJj0L+nevfEvdjfpIfFtIis0ite4MTMoPsOZdKmw21gK3u4jTtSTjygZxf4D9lblp gGHIaImsi/j3p8ChUZ+IrOOfxnUDmjSmhoPyjo9j9XPSJ8uZpi2nViJpkEa32FNjqiXb W6xIeXOXqCaWOmA/UInC/ZmaK/OtxOdBHdUqLu8z8kDzjElXiHfQpL+m0sJXuuXjo9nx AUK9lWhwMbeifx/RbyTqxc0BoM+1BMDhbldvMUBtnRpQzkiIvOcpWB/lS//NhdrO11NK gGuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CrT8c52zNHQI5C47jEmoAd8qF9LOz0f/cfKrzQ3ZEAA=; b=A18FvCR/jF9WKM3pcIoq4H28TboTxdtepdjsn1lSdzQ9/B3wVENaqwRaPfI9IASe46 oWyIYm/eNonYqE+G2NKRx0PQn5MxI1YKOPty5rW4ABHRiS+N8LKwqlQBUSyvqrhOBlQP HDyD4dDuuj2KS420IpO359gvSpGiq/l6qJ1f3Et4Js8Jla8Oqlgu+ApZL6tE7QqOKlWA ln0nuECrlIX+qhiQqJ+TxeBYl5g0tscj3pmwboy+qFCtou3MijnSAJzYKZ2//baoJQ3y 5jZRKPBxaXqUqzjU5E4gbyd+QoVYyAIJiT+D/AeD8Lh2XHh86OzoBs9tjEtiRn+OTRvx Wuqg== X-Gm-Message-State: ANoB5pnXhykB8e/vwJg+nhDt/O5k/ycY7HajFhjrUCAq9i8XzP8S1Hnt CvJncXvNT6AwKNMW9L18+XmHxf0xJBE= X-Google-Smtp-Source: AA0mqf7lsEcJg1VsE9Lj/F6B0nczCCeJwx3Af5nfuUqsE/CF2QhHbgBTxtEtVPeOqUWMzOD9hVRVYQ== X-Received: by 2002:a05:620a:a59:b0:6fa:349b:7ba9 with SMTP id j25-20020a05620a0a5900b006fa349b7ba9mr30456450qka.339.1669308268710; Thu, 24 Nov 2022 08:44:28 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1003]) by smtp.gmail.com with ESMTPSA id o17-20020ac872d1000000b003988b3d5280sm796010qtp.70.2022.11.24.08.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 08:44:28 -0800 (PST) From: Maxim Cournoyer To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> Date: Thu, 24 Nov 2022 11:44:27 -0500 In-Reply-To: <874lkxoanq.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 30 Mar 2018 17:17:29 +0200") Message-ID: <87cz9cnvys.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (-) Hi, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello, > > Carlo Zancanaro skribis: > >> On Fri, Mar 30 2018, Ludovic Court=C3=A8s wrote: >>>> From what I can understand it's one of pid 1's responsiblities to >>>> reap child processes, so I would expect this to be set up for every >>>> builder, before the builder is run. >>> >>> True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D = because eventually >>> guix-daemon terminates all its child processes. >> >> As long as the build process doesn't rely on behaviour that, strictly >> speaking, it should be allowed to rely on. It's not an issue of >> resource leaking, it's an issue of correctness. > > Right. > >>>> Given it's not specific to the gnu-build-system, I don't think it >>>> really fits there. For what it's worth, I agree. The evaluation container should have the correct signal handling configured for *any* code about to be evaluated, not just when on demand, if we want to fix this fully in a way that won't come back to haunt us in some edge case. >>> Yes, but note that it would be inherited by all the build systems. >> >> Except for trivial-build-system, which is probably fine. I still don't >> think it fits in a specific build system, given it's a behaviour that >> transcends the specific action happening within the container. >> >> Putting it in gnu-build-system will solve the problem in all realistic >> cases, so that's probably fine. It's still subtly incorrect, but will >> only be a problem if something using the trivial build system relies >> on pid 1 to reap a process, or if we make a new build system not >> deriving from gnu-build-system (which seems unlikely, but not >> impossible). > > I agree, every Guile process running as PID=C2=A01 should reap processes. Agreed too. > My view is just that this mechanism belongs in =E2=80=9Cuser code=E2=80= =9D, not in the > low-level mechanisms such as =E2=80=98build-expression->derivation=E2=80= =99 and > =E2=80=98gexp->derivation=E2=80=99. It=E2=80=99s a matter of separation = of concerns. Why? On my Guix System, such signal handling is handled by Shepherd, if I'm not mistaken. As I user, I can trust the foundation to be sane, rather than having to provide the bits to make it so myself. > Of course we don=E2=80=99t want to duplicate that code every time, but th= e way > we should factorize it, IMO, is by putting it in a =E2=80=9Cnormal=E2=80= =9D module that > people will use. > > Putting it in gnu-build-system is an admittedly hacky but easy way to > have it widely shared. I think we can do better than hacky here :-) --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 26 10:11:24 2022 Received: (at 30948) by debbugs.gnu.org; 26 Nov 2022 15:11:24 +0000 Received: from localhost ([127.0.0.1]:41132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oywpw-0006zx-1d for submit@debbugs.gnu.org; Sat, 26 Nov 2022 10:11:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oywpt-0006zi-Pq for 30948@debbugs.gnu.org; Sat, 26 Nov 2022 10:11:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oywpn-00049N-IS; Sat, 26 Nov 2022 10:11:15 -0500 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=gtSmDRbd9BZJ1gXExIQGRmyis3euS8L0/vFvmpMFIVs=; b=eAeQ6luggfT7o8ablxcL pEeLUg06m/Z86sQbbepRGTA8PWT8cle3aAsGdTG6xfjoxZLxN3CGWw/QwWi8CH1xi4BzcTkDSCvZE 3MYNexgR9jWUAtDoeHj7++04NViHSWj+ta88P+ilg5SCbaPNOt1zsQJbK5yQaxQxXh46FqUwBOEcn fhlJ4LLFsrmDAbGA9S63KaNlANRDqR5Cn4dvLD6lWe7811P1b9gXoNLug3qVRTZds0mi4RnWB/BUV iqVdHfjCxzetoVjLGPAb6V1izbNDuZVINLwjGXQ95qneQ457DaFUp2tjyrmTxqE//4O8D8ZTJ/AUd Gkx4LS29fmXv2w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oywpm-0003a6-A7; Sat, 26 Nov 2022 10:11:15 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> <87cz9cnvys.fsf_-_@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 6 Frimaire an 231 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour de la =?utf-8?Q?M=C3=A2che?= 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: Sat, 26 Nov 2022 16:11:12 +0100 In-Reply-To: <87cz9cnvys.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Thu, 24 Nov 2022 11:44:27 -0500") Message-ID: <875yf192en.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (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: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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, Maxim Cournoyer skribis: >> My view is just that this mechanism belongs in =E2=80=9Cuser code=E2=80= =9D, not in the >> low-level mechanisms such as =E2=80=98build-expression->derivation=E2=80= =99 and >> =E2=80=98gexp->derivation=E2=80=99. It=E2=80=99s a matter of separation= of concerns. > > Why? On my Guix System, such signal handling is handled by Shepherd, if > I'm not mistaken. As I user, I can trust the foundation to be sane, > rather than having to provide the bits to make it so myself. > >> Of course we don=E2=80=99t want to duplicate that code every time, but t= he way >> we should factorize it, IMO, is by putting it in a =E2=80=9Cnormal=E2=80= =9D module that >> people will use. >> >> Putting it in gnu-build-system is an admittedly hacky but easy way to >> have it widely shared. > > I think we can do better than hacky here :-) I think the real issue here is semantic clarity when it comes to derivation inputs. If I write: (gexp->derivation "foo" #~(mkdir #$output)) I can be sure that my derivation depends on nothing but (default-guile). This is important for tests, but also to make sure we can use this primitive everywhere=E2=80=94if it pulled in the Shepherd, I wouldn=E2=80= =99t be able to use to build glibc, because there=E2=80=99d be a cycle. In that sense, having child-reaping code in gnu-build-system.scm, just like in (guix least-authority), doesn=E2=80=99t seem unreasonable to me. That said, I=E2=80=99m open to other proposals so please unleash your creativity! :-) We=E2=80=99re touching core components though so this will require discussi= on. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 26 22:00:27 2022 Received: (at 30948) by debbugs.gnu.org; 27 Nov 2022 03:00:27 +0000 Received: from localhost ([127.0.0.1]:41783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz7u6-0002Jf-VD for submit@debbugs.gnu.org; Sat, 26 Nov 2022 22:00:27 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:46675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz7u1-0002JZ-LH for 30948@debbugs.gnu.org; Sat, 26 Nov 2022 22:00:25 -0500 Received: by mail-qk1-f177.google.com with SMTP id d8so5054903qki.13 for <30948@debbugs.gnu.org>; Sat, 26 Nov 2022 19:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=TN//sqAk1BJ7C7LV1dwgEzfcBsc8VkvOl68Ap6Sk7fs=; b=d8jjhaqZl2582wlHLxk0f19AmtdJnyhdGd+DExB0LL3qIJx8EuqyPnZqO2gQ6CxS2q wvSYHRS2d5rNr66Jj1oaskcmX6KTuxOjU8jc0yHUrMmMViaookbX2czY7rlrYCUl4fjw ui+E0TS06537w2nDEt/aMZToE6FifzZlBZwz6FikDjJ366xioUnP8N7492whU4hvi+7c xkkIvYCyHBZwtF31OSYJ9vGNF+lZUpKVpVPd5BFCJykvw7MuoSEytREFFN4dp9eOj/YK a0WCesrPj29IzhFt19FbYK0xRcZozHcykyWg6zs9lA223CxnYc66+4Oni/a2CGu9x3sX Ns3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TN//sqAk1BJ7C7LV1dwgEzfcBsc8VkvOl68Ap6Sk7fs=; b=4cpfPjncVGW8gBRffHNpSWD11p63nWCtwd0jDzsumPd/Xs4juXUswOX3Vuajb7D9/L J9N6yidjiAD4/tQFSvICsD5BoIGvvXg/RwHkE8s1TrEDiR1cqrnE3NlLGyTqukcsl0Cg mvHU36a39YP3P6ikXZhwJk1dpbhuVujFxWlYutJ0hNQAnZGDkBuWnNCyPCpBWc5t/WPO uLBJ6KvXjTqGFL0CdrxXD0N4CtRivPgxOFE/Ap7odsqUFFUpsjCaaQhYUHeOFG82lPuG If+L6//klu+cJR1dyLwsx2giFA++To/V4tsjiz3yJs6tLnNymHLXGeNVF2ICMDGuWgC0 AxgQ== X-Gm-Message-State: ANoB5pk2uTGVEDOUZ6F4inyZkmrk215oOPMq/AfZl62U57ef//UvaOR6 5dg6Ut/cLq1zdwAtNjV9Izan3pX9Dws= X-Google-Smtp-Source: AA0mqf53gxEFptckX5II3QbzzVlE51AvkrJM0eiZZJIjXkursum0IUtiAiCVYiMAwCvvQw/4K8BM3Q== X-Received: by 2002:ae9:c106:0:b0:6fa:3001:58fd with SMTP id z6-20020ae9c106000000b006fa300158fdmr23937077qki.401.1669518015837; Sat, 26 Nov 2022 19:00:15 -0800 (PST) Received: from hurd (dsl-151-252.b2b2c.ca. [66.158.151.252]) by smtp.gmail.com with ESMTPSA id z13-20020a05622a124d00b00398313f286dsm4602645qtx.40.2022.11.26.19.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 19:00:15 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> <87cz9cnvys.fsf_-_@gmail.com> <875yf192en.fsf@gnu.org> Date: Sat, 26 Nov 2022 22:00:13 -0500 In-Reply-To: <875yf192en.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 26 Nov 2022 16:11:12 +0100") Message-ID: <87ilj1w18i.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (-) Hi, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >>> My view is just that this mechanism belongs in =E2=80=9Cuser code=E2=80= =9D, not in the >>> low-level mechanisms such as =E2=80=98build-expression->derivation=E2= =80=99 and >>> =E2=80=98gexp->derivation=E2=80=99. It=E2=80=99s a matter of separatio= n of concerns. >> >> Why? On my Guix System, such signal handling is handled by Shepherd, if >> I'm not mistaken. As I user, I can trust the foundation to be sane, >> rather than having to provide the bits to make it so myself. >> >>> Of course we don=E2=80=99t want to duplicate that code every time, but = the way >>> we should factorize it, IMO, is by putting it in a =E2=80=9Cnormal=E2= =80=9D module that >>> people will use. >>> >>> Putting it in gnu-build-system is an admittedly hacky but easy way to >>> have it widely shared. >> >> I think we can do better than hacky here :-) > > I think the real issue here is semantic clarity when it comes to > derivation inputs. > > If I write: > > (gexp->derivation "foo" #~(mkdir #$output)) > > I can be sure that my derivation depends on nothing but (default-guile). > This is important for tests, but also to make sure we can use this > primitive everywhere=E2=80=94if it pulled in the Shepherd, I wouldn=E2=80= =99t be able to > use to build glibc, because there=E2=80=99d be a cycle. I was not suggesting to pull in extra dependencies such as Shepherd, but to weave the to-be-added signal handling logic at a much lower level. One idea could be to arrange so that the correct signal handlers always get installed for any Guile code running in the build side (I'm not sure how, but perhaps by adjusting the gexp "compiler"?). The handlers could be defined in (guix build signal-handling) or similar. Users wouldn't need to explicitly import the module and install its signal handlers, that'd be taken care of automatically, all the time. Does that sound feasible? --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 28 10:04:27 2022 Received: (at 30948) by debbugs.gnu.org; 28 Nov 2022 15:04:27 +0000 Received: from localhost ([127.0.0.1]:49089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozfgI-0005BP-V8 for submit@debbugs.gnu.org; Mon, 28 Nov 2022 10:04:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozfgG-0005BJ-F1 for 30948@debbugs.gnu.org; Mon, 28 Nov 2022 10:04:25 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozfgA-0005oM-Vv; Mon, 28 Nov 2022 10:04:19 -0500 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=8ecu73a8BBybx8OlMyUS8Ye2iqfJjs99K8yi7cXfdvU=; b=TIwLR6SuAJCuBd1ijECZ eoZ+ji8JdzrHf/ra7NCEGxkzp2tL2m5yiLiU7rxr36r+samukAu7PZYK2UW94prs+hDVMJV3Dl9xv P+Lp8aGdWaS4enXRasZPItUvdT211YfkPsE18DvH81zIFEwzDOBC/Sf9duvkVZI8pTn2WKkAW/3O5 C9NZh0artI+JzCPVOA8py3eZcR+AXXcPLai0MqNa4rv7F2dNJqLqF5rKGedxB25V+mml5J1eTaJGj aUONb6HLnnbsyjiV3pQIK/pkoH0koXJU80ovkMMfH8e3+7Q2vl4YHmFbNUqFigGxJndURzz5kzaQn k/M0Joi9ELQedw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozffx-0000rm-N5; Mon, 28 Nov 2022 10:04:18 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> <87cz9cnvys.fsf_-_@gmail.com> <875yf192en.fsf@gnu.org> <87ilj1w18i.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 8 Frimaire an 231 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour du Miel 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: Mon, 28 Nov 2022 16:04:04 +0100 In-Reply-To: <87ilj1w18i.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 26 Nov 2022 22:00:13 -0500") Message-ID: <87lenvce8r.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (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: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (---) Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> If I write: >> >> (gexp->derivation "foo" #~(mkdir #$output)) >> >> I can be sure that my derivation depends on nothing but (default-guile). >> This is important for tests, but also to make sure we can use this >> primitive everywhere=E2=80=94if it pulled in the Shepherd, I wouldn=E2= =80=99t be able to >> use to build glibc, because there=E2=80=99d be a cycle. > > I was not suggesting to pull in extra dependencies such as Shepherd, but > to weave the to-be-added signal handling logic at a much lower level. > One idea could be to arrange so that the correct signal handlers always > get installed for any Guile code running in the build side (I'm not sure > how, but perhaps by adjusting the gexp "compiler"?). > > The handlers could be defined in (guix build signal-handling) or > similar. Users wouldn't need to explicitly import the module and > install its signal handlers, that'd be taken care of automatically, all > the time. > > Does that sound feasible? Not like this: the imported-modules derivation for (guix build signal-handling) would be a dependency in themselves. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 28 15:10:24 2022 Received: (at 30948) by debbugs.gnu.org; 28 Nov 2022 20:10:24 +0000 Received: from localhost ([127.0.0.1]:50649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozkSN-0001vm-S4 for submit@debbugs.gnu.org; Mon, 28 Nov 2022 15:10:24 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:45776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozkSM-0001ve-RU for 30948@debbugs.gnu.org; Mon, 28 Nov 2022 15:10:23 -0500 Received: by mail-qk1-f175.google.com with SMTP id v8so8174860qkg.12 for <30948@debbugs.gnu.org>; Mon, 28 Nov 2022 12:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=y5zNkC1hTFnPIJcD0O356qdzVgW5S4Q6DnvmkuxIqAs=; b=lVv/4OnXEFn0iJIDwwDn6ItPzj24h5LcBw14MeD/AkyyMb+pMPZ2Q36PpUq0A7t+al 72jC6U7tJPixUw6id00FBJxcQmnSTbjoJ8kyCl4v2h5+7vBzZP7N172aj+qOGQD8towL LB7aOyxo9IYRjW12QISNbY1WJUAPmfaAA9m6x0b3vGYN7Pz5gh4GRiOEz1lx8Lt75zrn DGXBrjaY7pzYCwKxuCE5frQ3E4IzdjhHoKmGdWEzFauSdR5bCsUSkjPAZe1eJj4YQgIx p7sPUjI6lvMbHXyW+m+8CdzI0DyeIzshjLxCgSgmS3GvxVJPQFubVPisBP4jxXqCMTiu 1amQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y5zNkC1hTFnPIJcD0O356qdzVgW5S4Q6DnvmkuxIqAs=; b=518VyNGdQDYNdafJunNRxBvGShNF9MZA1QdaC8GhXlgkOkUmV4kxE/OClGDvW+n+8w DZlMC2KvvWDzhKSN/4rx2fg/Z0FjDOMHzZs2SHzHHav6halHK3CAo3QVXLd0gQnMa41K n6LynQUGlRxZT7xtyAO7HJ8pepoXxkYhpNt+Z0OGNScX3YLqZ+N3EUc7NYfsBOFKId9u rsn7QJOrwTXrGgcE/T7XFYDEru+rumHVJ9/6g8KlZQscP2ERX/fycHdcFZVkxJJSum7p j1H0h+FqiLIfQZfrz8CyuWfj8dESa/DshV9JLn85HHkfoWl5MfeEYbjRO5BV3oTpP0pN W+Pw== X-Gm-Message-State: ANoB5plLuzGUaUP8t/bW89y30sGZcKbSKRYQhKd5TSG2cHvN3RK8dBVE mGLCeqxSOJypab66GcLUqCwuyE1g2DYpeA== X-Google-Smtp-Source: AA0mqf7zTUXDxMM7mVo8uS9uWp49Mmu+YWZYrBOwR0Lb9C3Noo30HW7WcHf/18bXmfb+h81S1I1mzg== X-Received: by 2002:a05:620a:78d:b0:6ea:39ec:e50f with SMTP id 13-20020a05620a078d00b006ea39ece50fmr37227605qka.571.1669666217143; Mon, 28 Nov 2022 12:10:17 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1004]) by smtp.gmail.com with ESMTPSA id bj12-20020a05620a190c00b006cfc1d827cbsm9099030qkb.9.2022.11.28.12.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 12:10:16 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> <87cz9cnvys.fsf_-_@gmail.com> <875yf192en.fsf@gnu.org> <87ilj1w18i.fsf@gmail.com> <87lenvce8r.fsf@gnu.org> Date: Mon, 28 Nov 2022 15:10:15 -0500 In-Reply-To: <87lenvce8r.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 28 Nov 2022 16:04:04 +0100") Message-ID: <87k03esuvs.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (-) Hi, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> If I write: >>> >>> (gexp->derivation "foo" #~(mkdir #$output)) >>> >>> I can be sure that my derivation depends on nothing but (default-guile). >>> This is important for tests, but also to make sure we can use this >>> primitive everywhere=E2=80=94if it pulled in the Shepherd, I wouldn=E2= =80=99t be able to >>> use to build glibc, because there=E2=80=99d be a cycle. >> >> I was not suggesting to pull in extra dependencies such as Shepherd, but >> to weave the to-be-added signal handling logic at a much lower level. >> One idea could be to arrange so that the correct signal handlers always >> get installed for any Guile code running in the build side (I'm not sure >> how, but perhaps by adjusting the gexp "compiler"?). >> >> The handlers could be defined in (guix build signal-handling) or >> similar. Users wouldn't need to explicitly import the module and >> install its signal handlers, that'd be taken care of automatically, all >> the time. >> >> Does that sound feasible? > > Not like this: the imported-modules derivation for (guix build > signal-handling) would be a dependency in themselves. Can we make it an implicit dependency, since we want it to *always* be used? It'd be useless/annoying boilerplate otherwise. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 28 21:07:58 2022 Received: (at 30948) by debbugs.gnu.org; 29 Nov 2022 02:07:58 +0000 Received: from localhost ([127.0.0.1]:52331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozq2P-0001h2-K2 for submit@debbugs.gnu.org; Mon, 28 Nov 2022 21:07:58 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:34703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozq2M-0001gv-FN for 30948@debbugs.gnu.org; Mon, 28 Nov 2022 21:07:55 -0500 Received: by mail-qt1-f169.google.com with SMTP id e15so8071004qts.1 for <30948@debbugs.gnu.org>; Mon, 28 Nov 2022 18:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=+Bd2wcIbGctVcHw9i6xtBzNE02ErQjt5rOIjPC8VuL4=; b=dA5yK2cZwAyopLqIraC4FuFVaNnJYUpsuIHvK6YoD1OuYN4VggKAx7CI3Xp3y2pIcC btjKpQux4JetUwx4u++naa3wc0BDpc/OoesmIx0B+iIkAMDq8WjHoHa7bsNWYN1XBfn+ kQ534NLBJ9OEnmMBVt6/B3bCnzskIjp4ytOfe+PmMPgZ7FIIcXIf630lWkla03Ig+1HB a/ng8EZMlKk70iwYdqANeNJSd6tDJ5wwqmCB6QHumJtD8ODUhr0TW8/8AqqAQlUuF8Rc DwSxJ2VT5ekaFGSBEaIKmhc9OzbSFukNTbuCQGJij0Iuzrw+7pg+lG8ICCHgpa81i763 dblA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+Bd2wcIbGctVcHw9i6xtBzNE02ErQjt5rOIjPC8VuL4=; b=r0jsNNlHA7lURUVZ9w7+wsMkX/CuZpxHqGwbRgfj43PyYHgVZ5hhO3dCvrI5giqWwn 59q0BzAgiGzEsNinN9LYd/ge8XnoCFIceBqIugTMXc41vLGOaZpKT0zyDCBWkPMPhwNB S3TnOJ4QSDbLeAPKGyp0os0+aOQ9rL6KMTn4rtL4PUjrFhHoh2AI/29SeHlnomAZ1eJ2 wIdsKnQ0c9zvb2u6xLIgLgmnT12f+Yowfpgri2+byvsPe4rJwjbSLI9wkKXsm1pQrVCW e8WIxOdqbnGOSv58zhwmWahNcw/xEB+s2P49zDyBfgYenFlwuAdgfqlKFsL4IesoG7JZ My2Q== X-Gm-Message-State: ANoB5pn2pHhYPm5I413neI9AYIyPxtafrrKx/PBoN9tbHMuEr2Z0J6pY 7iZxm3+ylhmXUyxRia6wa0UvSYZ0esJmPw== X-Google-Smtp-Source: AA0mqf6gj9P0lDvDpjcbCL0Kd+a74uxiwOvvV2NkwRyr1JBzUM2b97ppfTah8IdadOjqdKmIU/E4qA== X-Received: by 2002:ac8:7108:0:b0:3a5:8a24:e6bf with SMTP id z8-20020ac87108000000b003a58a24e6bfmr35864044qto.529.1669687668807; Mon, 28 Nov 2022 18:07:48 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1004]) by smtp.gmail.com with ESMTPSA id d26-20020ac8545a000000b003a622111f2csm7841994qtq.86.2022.11.28.18.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 18:07:48 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> <87cz9cnvys.fsf_-_@gmail.com> <875yf192en.fsf@gnu.org> <87ilj1w18i.fsf@gmail.com> <87lenvce8r.fsf@gnu.org> Date: Mon, 28 Nov 2022 21:07:47 -0500 In-Reply-To: <87lenvce8r.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 28 Nov 2022 16:04:04 +0100") Message-ID: <875yeysebw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (-) Hi, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> If I write: >>> >>> (gexp->derivation "foo" #~(mkdir #$output)) >>> >>> I can be sure that my derivation depends on nothing but (default-guile). >>> This is important for tests, but also to make sure we can use this >>> primitive everywhere=E2=80=94if it pulled in the Shepherd, I wouldn=E2= =80=99t be able to >>> use to build glibc, because there=E2=80=99d be a cycle. >> >> I was not suggesting to pull in extra dependencies such as Shepherd, but >> to weave the to-be-added signal handling logic at a much lower level. >> One idea could be to arrange so that the correct signal handlers always >> get installed for any Guile code running in the build side (I'm not sure >> how, but perhaps by adjusting the gexp "compiler"?). >> >> The handlers could be defined in (guix build signal-handling) or >> similar. Users wouldn't need to explicitly import the module and >> install its signal handlers, that'd be taken care of automatically, all >> the time. >> >> Does that sound feasible? > > Not like this: the imported-modules derivation for (guix build > signal-handling) would be a dependency in themselves. I see a couple of options for the lowest place to inject the minimal signal handling of a PID. 1. In Guile itself. We could make it detect when it's running as PID 1 and then set up the required signal handling. This is apparently what Bash does, a peculiarity exploited by NixOS (they launch their builder scripts via Bash, which is PID 1 and takes care of reaping the dead processes) 2. In a Guile wrapper. Instead of running Guile directly in the container, guix-daemon would run it through a wrapper that acts as PID 1. This would make it a tool comparable to dumb-init [0] or tini [1], except written in Scheme. [0] https://github.com/Yelp/dumb-init/ [1] https://github.com/krallin/tini If we implement 1, it'd make Guile potentially useful as a wrapper itself to launch scripts in containerized environment (the same as tini), and it alleviates any integration overhead for us, so I find it attractive. What do you think? For further reading, see [2], which I found interesting. [2] https://medium.com/hackernoon/my-process-became-pid-1-and-now-signals-= behave-strangely-b05c52cc551c --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 17 15:24:19 2023 Received: (at 30948) by debbugs.gnu.org; 17 Dec 2023 20:24:19 +0000 Received: from localhost ([127.0.0.1]:59055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rExgQ-00016s-Mx for submit@debbugs.gnu.org; Sun, 17 Dec 2023 15:24:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rExgO-00016Z-HE for 30948@debbugs.gnu.org; Sun, 17 Dec 2023 15:24:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rExgF-0001tW-Cf; Sun, 17 Dec 2023 15:24:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=9JQx6RlxXevWORVf9XOF0AU2TcuyJRIg2eR1Hqz8C28=; b=jkrDL/6uu98aJVRtwCT+ neCCKxE/ppXqOOx6bUwr8dl57zMxx2C80BaN66zYhhRPsqgz/5cPmTapOLhrS2I8ORYo2jPxIFT7x IOVFz48gUfqmxCYMZigprardrili9Lmje+aUsLoXub8V7n1BGrF2eaEhHMZEbEdaeT22TteKIJblJ kBzrhC9NOvP/s2DXGKqWXnAbthLsiKSP+fmhHQ2G5tP3GgYeihKGsEP5aVw1NjuGUZmGDFKT7EyzO vHv0EovnT/PmPS9foYLOfAfxssr91tmMHIGfP+5s8Ap3q2sW0EXM+ayTHXaWy2fO16NAfnXzXBN1W KXvI9pSHYUzO3w==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 30948@debbugs.gnu.org Subject: [PATCH core-updates] =?UTF-8?q?build-system/gnu:=20Turn=20PID=201?= =?UTF-8?q?=20into=20an=20=E2=80=9Cinit=E2=80=9D-style=20process=20by=20de?= =?UTF-8?q?fault.?= Date: Sun, 17 Dec 2023 21:23:52 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <87lenvce8r.fsf@gnu.org> References: <87lenvce8r.fsf@gnu.org> X-Debbugs-Cc: Maxim Cournoyer , Carlo Zancanaro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30948 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , Carlo Zancanaro 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 (---) Fixes . * guix/build/gnu-build-system.scm (separate-from-pid1): New procedure. (%standard-phases): Add it. * guix/build-system/gnu.scm (gnu-build): Add #:separate-from-pid1? and honor it. (gnu-cross-build): Likewise. Reported-by: Carlo Zancanaro Change-Id: I6f3bc8d8186d1a571f983a38d5e3fd178ffa2678 --- guix/build-system/gnu.scm | 4 ++++ guix/build/gnu-build-system.scm | 39 ++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) Hi! This is a second attempt I’m currently testing as part of an initially unrelated ‘core-updates’ series: https://issues.guix.gnu.org/67824 The principle is simple: if the build process runs as PID 1, fork so that PID 1 does nothing but call ‘waitpid’ in a loop while the actual build process runs as PID 2. This is simple and robust. The code is written in a defensive way as an extra phase that can be disabled. Thoughts? Ludo’. diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 0f886fe21d..6a89bcc0d8 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -362,6 +362,7 @@ (define* (gnu-build name inputs (license-file-regexp %license-file-regexp) (phases '%standard-phases) (locale "C.UTF-8") + (separate-from-pid1? #t) (system (%current-system)) (build (nix-system->gnu-triplet system)) (imported-modules %default-gnu-imported-modules) @@ -404,6 +405,7 @@ (define* (gnu-build name inputs (sexp->gexp phases) phases) #:locale #$locale + #:separate-from-pid1? #$separate-from-pid1? #:bootstrap-scripts #$bootstrap-scripts #:configure-flags #$(if (pair? configure-flags) (sexp->gexp configure-flags) @@ -502,6 +504,7 @@ (define* (gnu-cross-build name (license-file-regexp %license-file-regexp) (phases '%standard-phases) (locale "C.UTF-8") + (separate-from-pid1? #t) (system (%current-system)) (build (nix-system->gnu-triplet system)) (imported-modules %default-gnu-imported-modules) @@ -547,6 +550,7 @@ (define* (gnu-cross-build name (sexp->gexp phases) phases) #:locale #$locale + #:separate-from-pid1? #$separate-from-pid1? #:bootstrap-scripts #$bootstrap-scripts #:configure-flags #$configure-flags #:make-flags #$make-flags diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 39707e7ace..51b8f9acbf 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -72,6 +72,42 @@ (define (first-subdirectory directory) ((first . _) first) (_ #f))) +(define* (separate-from-pid1 #:key (separate-from-pid1? #t) + #:allow-other-keys) + "When running as PID 1 and SEPARATE-FROM-PID1? is true, run build phases as +a child process; PID 1 then becomes responsible for reaping child processes." + (if separate-from-pid1? + (if (= 1 (getpid)) + (dynamic-wind + (const #t) + (lambda () + (match (primitive-fork) + (0 #t) + (builder-pid + (format (current-error-port) + "build process now running as PID ~a~%" + builder-pid) + (let loop () + ;; Running as PID 1 so take responsibility for reaping + ;; child processes. + (match (waitpid WAIT_ANY) + ((pid . status) + (if (= pid builder-pid) + (if (zero? status) + (primitive-exit 0) + (begin + (format (current-error-port) + "build process ~a exited with status ~a~%" + pid status) + (primitive-exit 1))) + (loop)))))))) + (const #t)) + (format (current-error-port) "not running as PID 1 (PID: ~a)~%" + (getpid))) + (format (current-error-port) + "build process running as PID ~a; not forking~%" + (getpid)))) + (define* (set-paths #:key target inputs native-inputs (search-paths '()) (native-search-paths '()) #:allow-other-keys) @@ -872,7 +908,8 @@ (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () ((_ p ...) `((p . ,p) ...))))) - (phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack + (phases separate-from-pid1 + set-SOURCE-DATE-EPOCH set-paths install-locale unpack bootstrap patch-usr-bin-file patch-source-shebangs configure patch-generated-file-shebangs base-commit: 2f3b64b9d967b4eea5cbdb32c859f4e3ac3b1a83 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 17 16:47:03 2023 Received: (at 30948) by debbugs.gnu.org; 17 Dec 2023 21:47:03 +0000 Received: from localhost ([127.0.0.1]:59085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEyyV-0002HY-As for submit@debbugs.gnu.org; Sun, 17 Dec 2023 16:47:03 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:52419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEyyT-0002H3-3Y for 30948@debbugs.gnu.org; Sun, 17 Dec 2023 16:47:01 -0500 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-4260b657ed5so25123571cf.0 for <30948@debbugs.gnu.org>; Sun, 17 Dec 2023 13:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702849614; x=1703454414; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zJYCGtK98kqmNoEUDWkuaGVZcFNPRQg/N4mKglh5M3I=; b=Tk3G9LvOfV/ssR3DqaT3jPVwd6aILWY62Lm04iE2nuoV7Z8Ru9zaD2ujoqNGjzykUs Js9EvIMNLhvt2M221mLfrbuyk9biGiolvrV+5+ohase9oCvKkudAx++ifxX+l9c6Foy1 FIrkxwPZ6t3sWWZPk3EbDOvZE4C9lAsIopko86qIlKSE8Q+miGdp5IvWTD8DtcchlDJ2 x4fOwKvEU0nKXI2rb13le2pCFkj2+MnlJhf+wSfQ9wreIdQpcZo09FKXlEYBjR7WX9CW aaSWdjAaNq2H7dhh+sWGKANxDK88kHp0fuplFiQ4l1nVIwn62nMbeFnR233n4P80nTwt vONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702849614; x=1703454414; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zJYCGtK98kqmNoEUDWkuaGVZcFNPRQg/N4mKglh5M3I=; b=W2KyDRrEu4mMWKVvPtRY8mrqOAC8OVOrQv6tzynqbSlehui3ppDqopEHn0fW7gnwxN H+JAWvkGs7SBqbTQDhuZgtJB6R4j9YR/gm/H6yfht2llseSOZIk5cfnx6u5RPonY4TyD 4UELtBQoXSiJmn2wAQdEu1rapawDSktTLrcFzQf43kITNVmnSc12BCgaK8dNIbxbCfIT syC6i0GjWydAk7GBULj/ZyWuctX5JEM01ZssFYDYcHTQ/0Nm2HeLvt81aCbux9dmsBxh vcU2GgUMB0ZORQluHMMZkmAhrA+nxqUuaSisRAmRSKH3zpcf+QPEXZN4YxEs74pl83p/ cIMw== X-Gm-Message-State: AOJu0YyC7UGa/fAhej9iNXtzKRBGGjzhdI0YsWw3dDmjdPDUejXi1CcJ EKSHEJ7ctOd37VQJykNlm26hZt5ZZCs= X-Google-Smtp-Source: AGHT+IEW3lc5HB+okPdkrhI5AA3f1ZQBgZNq+Nu/yLTbX+6nXdGU3hDaBlmcKe3YYC7R1YHyehDRxQ== X-Received: by 2002:ac8:57ce:0:b0:425:9903:80c with SMTP id w14-20020ac857ce000000b004259903080cmr22991382qta.20.1702849613806; Sun, 17 Dec 2023 13:46:53 -0800 (PST) Received: from hurd (dsl-205-236-230-90.b2b2c.ca. [205.236.230.90]) by smtp.gmail.com with ESMTPSA id cj10-20020a05622a258a00b004259bbf166esm8607526qtb.63.2023.12.17.13.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 13:46:53 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#30948: [PATCH core-updates] build-system/gnu: Turn PID 1 into an =?utf-8?B?4oCcaW5pdOKAnS1zdHlsZQ==?= process by default. In-Reply-To: ("Ludovic =?utf-8?Q?Court=C3=A8s=22's?= message of "Sun, 17 Dec 2023 21:23:52 +0100") References: <87lenvce8r.fsf@gnu.org> Date: Sun, 17 Dec 2023 16:46:51 -0500 Message-ID: <87v88w7b90.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (-) Hi Ludovic, Ludovic Court=C3=A8s writes: > Fixes . > > * guix/build/gnu-build-system.scm (separate-from-pid1): New procedure. > (%standard-phases): Add it. > * guix/build-system/gnu.scm (gnu-build): Add #:separate-from-pid1? and > honor it. > (gnu-cross-build): Likewise. > > Reported-by: Carlo Zancanaro > Change-Id: I6f3bc8d8186d1a571f983a38d5e3fd178ffa2678 > --- > guix/build-system/gnu.scm | 4 ++++ > guix/build/gnu-build-system.scm | 39 ++++++++++++++++++++++++++++++++- > 2 files changed, 42 insertions(+), 1 deletion(-) > > Hi! > > This is a second attempt I=E2=80=99m currently testing as part of an > initially unrelated =E2=80=98core-updates=E2=80=99 series: > > https://issues.guix.gnu.org/67824 > > The principle is simple: if the build process runs as PID 1, fork > so that PID 1 does nothing but call =E2=80=98waitpid=E2=80=99 in a loop w= hile the > actual build process runs as PID 2. > > This is simple and robust. The code is written in a defensive way > as an extra phase that can be disabled. > > Thoughts? I haven't yet looked at the code, but looking at the bigger picture, wouldn't it be a useful behavior to have for Guile itself? Perhaps not, as there already exists a Guile init manager (GNU Shepherd), but if it's something relatively simple/compact to implement, perhaps it could find its place in Guile itself, just like Bash implements correctly signal handling when used as a PID 1 (if I'm not mistaken). --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 18 12:47:03 2023 Received: (at 30948) by debbugs.gnu.org; 18 Dec 2023 17:47:03 +0000 Received: from localhost ([127.0.0.1]:33519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFHhn-0006LO-68 for submit@debbugs.gnu.org; Mon, 18 Dec 2023 12:47:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFHhh-0006KX-Qc for 30948@debbugs.gnu.org; Mon, 18 Dec 2023 12:47:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFHhY-0005gt-FC; Mon, 18 Dec 2023 12:46:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=geHH2tdd/42fjtV9Y3lkzRFIaSCfv4hTuIrjhCJnMwY=; b=O03TtDdG+tRDH8EbkDGd iDbndIKrI0RFFe6dF+GD+8w24ZSbjM53M8Od1w/w5056rODVgu7fExsV1FNHv1NUEWvX82INfVtAn jrNxlI4ggOHk9hkO678T6CBiszKqkKuihctpxkYioBlVEh/A24eNB2SzMmTlRV3i2fBxmOqCuELk1 nwAetdC0d8nQ9vdguKIF5t1YzJU+a2duhejHcY2HqtMg2BOEs/NnM3sI4Y4Lb/uRrHGasCXy3/TpY LvHic71xW9b2sIhHznk2MMfnTydPjplC8A5tV4L2Q9Py6Lzj9Ylidx2iPHsIvIlOo4gAa8ZcGwuK9 lJ+LJrwcFtH91g==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. In-Reply-To: <87v88w7b90.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 17 Dec 2023 16:46:51 -0500") References: <87lenvce8r.fsf@gnu.org> <87v88w7b90.fsf@gmail.com> Date: Mon, 18 Dec 2023 18:46:44 +0100 Message-ID: <874jgfjtdn.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (---) Hey Maxim, Maxim Cournoyer skribis: > I haven't yet looked at the code, but looking at the bigger picture, > wouldn't it be a useful behavior to have for Guile itself? Perhaps not, > as there already exists a Guile init manager (GNU Shepherd), but if it's > something relatively simple/compact to implement, perhaps it could find > its place in Guile itself, just like Bash implements correctly signal > handling when used as a PID 1 (if I'm not mistaken). Bash is a shell whereas Guile is a programming language, and to me that makes a big difference: we want to be able to implement init systems in Guile just like we implement them in C, and that means we need full control over what to do when running as PID 1. That=E2=80=99s why I wouldn= =E2=80=99t do anything special in Guile itself (nor in libc). The patch I submitted fixes our immediate problem with build processes, so I=E2=80=99d like to have it in =E2=80=98core-updates=E2=80=99. Hopeful as I am, I see us merging =E2=80=98core-updates=E2=80=99 in the fir= st half of January. Ambition! :-) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 19 17:56:41 2023 Received: (at 30948) by debbugs.gnu.org; 19 Dec 2023 22:56:41 +0000 Received: from localhost ([127.0.0.1]:37878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFj0y-0000qX-MF for submit@debbugs.gnu.org; Tue, 19 Dec 2023 17:56:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFj0w-0000qG-LH for 30948@debbugs.gnu.org; Tue, 19 Dec 2023 17:56:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFj0o-0000T2-GR; Tue, 19 Dec 2023 17:56:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ONbWtkWS4g8KXR6vL4OjZMhVcR+N44fa4S/QfT/SOGc=; b=NQxm/vtEMcfAHoQUX3hx hTpOaCb5iQPz+IYD9l4LW6tmbLnV6QYAKdFzwHJvBFFjFm0S86tAv14q+foQus0pQ/ii9smxSZC6L 3/reXV7BKOqbAMm9so1WLtUxc9J8bwQbE1zOz0X2ajn1t8b39QfXoB2Y/mfm2J5rJeex7Eo76wo7b IJj4zG4CmYnpGsm8z5TIqAd+EX2E/vFOyWc5pLfCaF3JuuI+AGIk2odRAdsOzs6lPuXZ5jqCZO8yV l5Wu8hm3KO0A3ONr3/U69/UKeLUWb0b8bcXEDbfd5uJCxhugTw6aRZduIBhlum05Yk2Mp7gaP4zbo CoganpHD90WrYw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 30948@debbugs.gnu.org Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. In-Reply-To: ("Ludovic =?utf-8?Q?Court=C3=A8s=22's?= message of "Sun, 17 Dec 2023 21:23:52 +0100") References: <87lenvce8r.fsf@gnu.org> Date: Tue, 19 Dec 2023 23:56:26 +0100 Message-ID: <871qbhiyxx.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 30948 Cc: Carlo Zancanaro , Maxim Cournoyer 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, Ludovic Court=C3=A8s skribis: > Fixes . > > * guix/build/gnu-build-system.scm (separate-from-pid1): New procedure. > (%standard-phases): Add it. > * guix/build-system/gnu.scm (gnu-build): Add #:separate-from-pid1? and > honor it. > (gnu-cross-build): Likewise. > > Reported-by: Carlo Zancanaro > Change-Id: I6f3bc8d8186d1a571f983a38d5e3fd178ffa2678 I pushed this change in =E2=80=98core-updates=E2=80=99 as 7ebe4b72727632561ddbf8bb0c58527929682989 (together with other world-rebuild changes.) I=E2=80=99m closing this bug but please do re-open if you think the issue n= eeds further work. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 19 17:56:46 2023 Received: (at control) by debbugs.gnu.org; 19 Dec 2023 22:56:46 +0000 Received: from localhost ([127.0.0.1]:37882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFj14-0000qq-0y for submit@debbugs.gnu.org; Tue, 19 Dec 2023 17:56:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFj12-0000qR-DE for control@debbugs.gnu.org; Tue, 19 Dec 2023 17:56:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFj0u-0000U1-6d for control@debbugs.gnu.org; Tue, 19 Dec 2023 17:56:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=d4Ta8g2ZN9T7P5V3uu4YTylmxXmGFgSZfNl2DKMvQc4=; b=ZVwZGPg2fkWLw9 84Ma3kpZpoeCQn1hY9TR/IUkEy4UMLnue5nu/GFuQlL45DUY4KFykLZW93kM1AtoyetHQ5dDvgvXN fNmOQ7H9f/AZGuZp4y3Cq6kM7Mc63LgIl4j7AllJUk+R5Q2Q93E3jqcdF3T9GhSkdZIVOI6TpupYp OCBzPdtj00lVmPmV0xShIjFvidXe+J5c7AKORQBJXLHsDQ7TI0gL/VDIdMDeu+0FuRuGV7AO7Dyyj NluI4NHt/yHJQP6EgDwiaeph7I8he/x1+p/Uai6xtP4p33zoRCr4OWxKH3sk/dlW2vctgTja+ZoOn +DxSWbC2Q8j0mAlyrsdA==; Date: Tue, 19 Dec 2023 23:56:34 +0100 Message-Id: <87zfy5hkd9.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #30948 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) close 30948 quit From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 29 22:36:48 2023 Received: (at 30948) by debbugs.gnu.org; 30 Dec 2023 03:36:48 +0000 Received: from localhost ([127.0.0.1]:42776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJQ9Y-0005XS-BC for submit@debbugs.gnu.org; Fri, 29 Dec 2023 22:36:48 -0500 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:48274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJQ9W-0005X6-F5 for 30948@debbugs.gnu.org; Fri, 29 Dec 2023 22:36:46 -0500 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4280de11cf8so2047001cf.0 for <30948@debbugs.gnu.org>; Fri, 29 Dec 2023 19:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703907400; x=1704512200; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rfp0968aPHGw6bsOwGGV3MrACtB+1W532SBSyVuwJtI=; b=lucmc8SZo6tl8YpxymxhGtJyfRrmL+5VqEGvYKQr8Rerb7FfGKTKmDP2qPPtMIk0LQ bBp4XQz7VNa3UbWGwz5WGxlDRvtqw4kpWOXuEyX/Nrlz577Yt4tWEuXLM2xVMAIO6ed1 dQjH2g9y7T9hXZ2acjwPrk2kBNlencrTpYZTIzy/OZ1A50qM+PzgU8jkD8RiMDoAZrIK HRxl6/qyBbNoABCS2gTCG06eEVMOF2jsZ6/8aPzYiX+t1JXXKZPIX9CGCIxNlglrKnj+ HA7CFRx5StFVSVqEyiGEBl7j8XEGw692nZ9unkxlIY1KwVqsTB3uuUpxOhgKvo1FL1vr bKfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703907400; x=1704512200; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rfp0968aPHGw6bsOwGGV3MrACtB+1W532SBSyVuwJtI=; b=X0bn/veM7TuGtAOMcp9fICLchNez7/MASSPpsQ4QypXLP0MOO/ALBGCxNm+XSlNaeZ WYJ7+LKnTfhMbuEPXRAuXbT91aq1824TdOuL2A8rN8C0pW7RNeQVb+ya90mBvpzxDV4U VWKr1X0MZX2llX0BF2BSKry8CcBgv0AAEpyF+PqgwNM+e4yYCXR580qOdQz/swTn0lkN zkZ2z99D14W/G3Tc8oAV3yD/HgmQ6gD+eNRP+FluUr3xis2Vugt/dFnNT12r95z6bG+I 8xiVgFaxUjohpna1BYuIxaSf38xWEWTWlgoMyklVpzrxWM8rJwPh1u1XRHee7Q0hxaB5 z2uw== X-Gm-Message-State: AOJu0YywFk0KvJMQrdN9UQRK818TXfCR3dqNU8qc7jt++0IGnO8cY1b/ qdIJxYA7vToPqlgkMQJ9z0c= X-Google-Smtp-Source: AGHT+IEBz+tNse/YbdGD2uRfYKe6wX5q1mEbuvw3EqwIO3ffq9lAjq1oCK0lN2mOzDn9XlRzwFM6pg== X-Received: by 2002:ac8:5811:0:b0:427:ea25:6f9f with SMTP id g17-20020ac85811000000b00427ea256f9fmr6760245qtg.38.1703907400225; Fri, 29 Dec 2023 19:36:40 -0800 (PST) Received: from hurd (dsl-152-202.b2b2c.ca. [66.158.152.202]) by smtp.gmail.com with ESMTPSA id cd6-20020a05622a418600b0041aff9339a2sm9699273qtb.22.2023.12.29.19.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 19:36:39 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. In-Reply-To: <874jgfjtdn.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Mon, 18 Dec 2023 18:46:44 +0100") References: <87lenvce8r.fsf@gnu.org> <87v88w7b90.fsf@gmail.com> <874jgfjtdn.fsf_-_@gnu.org> Date: Fri, 29 Dec 2023 22:36:38 -0500 Message-ID: <87a5pss6nt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro 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 (-) Hi Ludo, Ludovic Court=C3=A8s writes: > Hey Maxim, > > Maxim Cournoyer skribis: > >> I haven't yet looked at the code, but looking at the bigger picture, >> wouldn't it be a useful behavior to have for Guile itself? Perhaps not, >> as there already exists a Guile init manager (GNU Shepherd), but if it's >> something relatively simple/compact to implement, perhaps it could find >> its place in Guile itself, just like Bash implements correctly signal >> handling when used as a PID 1 (if I'm not mistaken). > > Bash is a shell whereas Guile is a programming language, and to me that > makes a big difference: we want to be able to implement init systems in > Guile just like we implement them in C, and that means we need full > control over what to do when running as PID 1. That=E2=80=99s why I woul= dn=E2=80=99t do > anything special in Guile itself (nor in libc). That sounds reasonable. > The patch I submitted fixes our immediate problem with build processes, > so I=E2=80=99d like to have it in =E2=80=98core-updates=E2=80=99. > > Hopeful as I am, I see us merging =E2=80=98core-updates=E2=80=99 in the f= irst half of > January. Ambition! :-) Cool, let's see if we can get it done! --=20 Thanks, Maxim From unknown Fri Jun 20 07:15:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 27 Jan 2024 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator