From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id gBqOE7iNcmfp6gAAqHPOHw:P1 (envelope-from ) for ; Mon, 30 Dec 2024 12:10:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gBqOE7iNcmfp6gAAqHPOHw (envelope-from ) for ; Mon, 30 Dec 2024 13:10:32 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=oPwlnhV0; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Ajoi5Ncf; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735560631; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MSUI0vjXgVIzIcWY1kWgPXFJmSNrp3BBARSP8AeMU7E=; b=sK2ReAPZ5OTQUC5S2CyJk9F3DvAAOLiXxgIwdRG9A9MlCEVhWt54hycyGqEa+R9a1YCa6r xT6qq5CmGHgIh7LkfdwD+1VurPJ+kT/UcjsPf0s6sU9E+XI/kXzxALe30zmAhICbC8paxn Pkn8/G9VuTD6j+amNOmR+3Ke219buFuhFinia6qnppUMbSYNHtO4Bc+x0GR8lKXpstaXGa 6A70E31f0OIe0H9WKknOgjJEYYw/kypBsrQx/CBzCYQpmijpeKdt26Ou2BQirU+NGLS2a8 tkux6/MmUlflYvOtVyBEbtykOyIxenfY0DrebD+PN8cojhg27gfNXNflG504kA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=oPwlnhV0; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Ajoi5Ncf; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735560631; a=rsa-sha256; cv=none; b=BNs0bVbAy+ENTFu6jwoMCNEntZ5rGh189tHW60PXdE/+/NTbfVZYU9qKiV4bm+6RbYrAu1 ubUiNCmmVf4UAmhvCNQT1BuAtFYMg6ZWjv0PO0DHCkvOXqJ2lU+A0k16RbF2Wpczl0Rmr2 c+KR/+eB+Fv9KvA1Ikty5y+SMi5GGYywFRba8L/8EC3MgZbnjEgi5MLXcOClM5embHTjyO ldJgxo+U/MfGto0sUxa/bPdD4Q7ReDWxQQNFQvJmL03paFk3nnGpVdgzrteRug7Xf7RJ14 66wpwN4IAdXgMs82Qq5FnrlmmIHzubFegry8fmqixUsrMqnJltlWZQqBJSAqjw== 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 4E09981442 for ; Mon, 30 Dec 2024 13:10:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSEb6-0005tX-9r; Mon, 30 Dec 2024 07:10:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSEb1-0005rT-HM for guix-patches@gnu.org; Mon, 30 Dec 2024 07:10:08 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSEaw-0003QY-9Y for guix-patches@gnu.org; Mon, 30 Dec 2024 07:10:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=MSUI0vjXgVIzIcWY1kWgPXFJmSNrp3BBARSP8AeMU7E=; b=oPwlnhV0oeQ+9YS6A8crWK30dB6Svp0y+BtQ4UHOPCZZ9UMOPYIG6Twr0I6UKnmYY7LCzaJdFmNtDGa+ZNyeZgmVDphF/fJTBYUxnUa1CZLTlGrIq/At/PoGHn8m0REDPCECz35hyMZ6SPTtgCL94UJe3pzXoqu4ZBpSd1KNDEQUnT8S4yYSjW100HpI6Zsxb8oP0T0n14dMlTtZJXOtsFJSmA+V0A19dCbrXMxkKfkEcitbtMkm87Lm0FmU+V67hcjlVqPquLtn9Ya1GRubC/B9gbOMxDnn67Pcwt8a2RO0BQGvh7Q8RAfQ+lLQxGNqKJ9yZzce6HYHJsjk2Q7Evg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tSEaw-0005pe-3I for guix-patches@gnu.org; Mon, 30 Dec 2024 07:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75010] [PATCH 2/7] gnu: machine: ssh: Refactor roll-back-managed-host. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Dec 2024 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75010 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Herman Rimm Cc: 75010@debbugs.gnu.org Received: via spool by 75010-submit@debbugs.gnu.org id=B75010.173556057022361 (code B ref 75010); Mon, 30 Dec 2024 12:10:02 +0000 Received: (at 75010) by debbugs.gnu.org; 30 Dec 2024 12:09:30 +0000 Received: from localhost ([127.0.0.1]:57602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tSEaQ-0005oa-6s for submit@debbugs.gnu.org; Mon, 30 Dec 2024 07:09:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tSEaO-0005oK-4f for 75010@debbugs.gnu.org; Mon, 30 Dec 2024 07:09:28 -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 1tSEaG-0003PP-7V; Mon, 30 Dec 2024 07:09:20 -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=MSUI0vjXgVIzIcWY1kWgPXFJmSNrp3BBARSP8AeMU7E=; b=Ajoi5NcfjvhuMuPRuVLq lZf2Wes8JDMtoluuCWcbQWNe0Q0LZhy5jMUAdeDuxiKP/CHK6Atm6HNtdaVM0BkhpVdf6P37hDjNe xm9Z9QjefSOqXhp13GolE2BjfXtfXIaowCjEmRuNo106HMJv2LrLpZg80p+OchN8UnQVri7w/p6h6 91aWGy3w6yJI37EwI/1wh/gu8YWug0oy3kLGT6NUQvRkgNcvXH7ZhViJKKHzkGn7Ee2fO2FoiqaAX 8YSqOuZbV2fP3531Su9yEcmrAqGdPvb9NQHkvR7gtnH8Yc40ZQ9IQUKNkq445xMOV/bJ8zo60D7bK yaOhh3HioKpkDA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: (Herman Rimm's message of "Sat, 21 Dec 2024 18:04:06 +0100") References: Date: Mon, 30 Dec 2024 13:09:04 +0100 Message-ID: <87ed1ptlsv.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -8.80 X-Spam-Score: -8.80 X-Migadu-Queue-Id: 4E09981442 X-TUID: RSGwHoCe5YTg Hi, Herman Rimm skribis: > * gnu/machine/ssh.scm (roll-back-managed-host): Use let* and mbegin. > > Change-Id: Ic3d5039ecf01e1e965dce8a696e7dbd625d2b3c5 [...] > + (mmatch %store-monad (machine-boot-parameters machine) > + ((_ params rest ...) > + (let* ((entries (list (boot-parameters->menu-entry params))) > + (locale (boot-parameters-locale params)) > + (crypto-dev (boot-parameters-store-crypto-devices params)) > + (store-dir (boot-parameters-store-directory-prefix params)) > + (old-entries (map boot-parameters->menu-entry rest)) > + (bootloader (operating-system-bootloader > + (machine-operating-system machine))) > + (generate-bootloader-configuration-file > + (bootloader-configuration-file-generator > + (bootloader-configuration-bootloader bootloader)))) > + (mbegin %store-monad > + (lower-object (generate-bootloader-configuration-file > + bootloader entries > + #:locale locale > + #:store-crypto-devices crypto-dev > + #:store-directory-prefix store-dir > + #:old-entries old-entries))) > + (mlet %store-monad > + ((remote-result (machine-remote-eval machine remote-exp))) > + (when (eqv? 'error remote-result) > + (raise roll-back-failure))))) The (mbegin =E2=80=A6) expression has no effect because it=E2=80=99s not in= tail position (it expands to (lambda (=E2=80=A6) =E2=80=A6)). Even if it had an effect, generating the bootloader config file in itself does nothing: it has to at least be copied to the right place or passed as an argument to =E2=80=98grub-install=E2=80=99 or similar. The following =E2=80=98mlet=E2=80=99 should use =E2=80=98mwhen=E2=80=99 rat= her than =E2=80=98when=E2=80=99 to return a monadic value when the condition is false. These two bugs are actually already present in =E2=80=98master=E2=80=99, so= I guess we=E2=80=99re dealing with untested code. =F0=9F=98=B1 (We should come up with a strategy to test those things.) Ludo=E2=80=99.