From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CLF2As9goV/8TAAA0tVLHw (envelope-from ) for ; Tue, 03 Nov 2020 13:53:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qFAJOs5goV8CUAAA1q6Kng (envelope-from ) for ; Tue, 03 Nov 2020 13:53:18 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C2E8E9407E9 for ; Tue, 3 Nov 2020 13:53:18 +0000 (UTC) Received: from localhost ([::1]:47502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZwkP-00028v-JT for larch@yhetil.org; Tue, 03 Nov 2020 08:53:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZwkH-00028m-BI for guix-devel@gnu.org; Tue, 03 Nov 2020 08:53:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43456) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZwkG-0008Km-SB; Tue, 03 Nov 2020 08:53:08 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59112 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZwkG-0004AS-Dj; Tue, 03 Nov 2020 08:53:08 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: John Soo Subject: Re: RFC: subcommand to pause/resume builds References: <87r1pbzixl.fsf@asu.edu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Brumaire an 229 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: Tue, 03 Nov 2020 14:53:07 +0100 In-Reply-To: <87r1pbzixl.fsf@asu.edu> (John Soo's message of "Mon, 02 Nov 2020 10:56:38 -0800") Message-ID: <87zh3yczss.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: aN7USGoXRvN6 Hi, John Soo skribis: > I was looking to pause a long build today and asked on IRC how to > accomplish pause/resume. It seems this is possible already with the > following: > > kill --signal SIGSTOP|SIGCONT {pids-of-build-process-tree} > > There is already a command to list the processes associated to guix > commands: guix processes. Perhaps pause/resume can be a subcommand or > set of flags to guix processes. The following is the first thing that > comes to mind: > > guix processes --pause package-name ... --resume package-name ... > > What do you think? First, note that the daemon is unaware of =E2=80=9Cpackages=E2=80=9D, it on= ly knows about =E2=80=9Cderivations=E2=80=9D. Second, =E2=80=98guix processes=E2=80=99 is nice but it uses low-level heur= istics to determine what daemon sessions are open, what their clients are, and what they=E2=80=99re building; it resorts to heuristics because the daemon = as it stands doesn=E2=80=99t have a way to communicate its current state. It wor= ks well in practice, but still I wouldn=E2=80=99t go too far building around i= t. Last, you=E2=80=99d need to send SIGTSTP to the whole process group of the build, like so (I think, haven=E2=80=99t tried): sudo kill -TSTP -123 where 123 is the =E2=80=9CSessionPID=E2=80=9D shown by =E2=80=98guix proces= ses=E2=80=99. However, doing so may affect build results: processes in the build environment might handle SIGTSTP specially, which can have side effects. It=E2=80=99s an observable action. Conclusion: I don=E2=80=99t think we can implement this reliably. HTH! Ludo=E2=80=99.