From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2BG4DRT7ZmfJQAEAqHPOHw:P1 (envelope-from ) for ; Sat, 21 Dec 2024 17:29:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2BG4DRT7ZmfJQAEAqHPOHw (envelope-from ) for ; Sat, 21 Dec 2024 18:29:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=auqc52R0; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=mnd73a6T; 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=1734802196; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-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=GILwmmbUV5cxDgm2vE7mgAMn6SS5HAWz45VRyyCkjIU=; b=hSKTHqDj03QB3BXmNOwEQ6SSPGq2naUZbBjKiV3VbUYUSv5/0uiRahm0nV9WEW1U4y5iXm aQPBI1ItAMF3Rfvsf6EbDJy8H0R7/A4NplxrdmLfwYSBUQfJf281SAf3wMMvVmaojqWrhy s1E+wOaMRGuBXTpQMRostVcgQTetskKZL+4NzhwwntslmJFBZZMIWhUN8VTJ57EhGmwrq4 Vox3Fr49p1ORwFldarslea3Wvxlz20v+Nbjp7COv7YbhXrbZbTJi/A+2d0b42cNejnFQCL Lqydvagh/O9+t6AwFr2gJ9tbLvIkjO3CXn/HM5kBIzOOuhTlfWmeppcHzKR93g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=auqc52R0; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=mnd73a6T; 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=1734802196; a=rsa-sha256; cv=none; b=XVhbdr47/Aku9IcvbcrxYnwe1uR/A7DPg/hzDIO/BfWmLmNaGBNRe5SFq336zYBzo2Ya0d 8tHiwcZleizfd857dzJ6gWh+ZgSuRFwMoMfziMvnWZKbUaXuurU9vJC+t4b+0J84ZPbXOG GsLgaTRGnTi+FNbME7gYUjuNQFYdXtp/wR84UnALEaKwe96vhII0EBYnXa+1NQ/To+iljm M39GfQVksA2f5lNsuBJPWd4FR9t7wLQdyP+cm3kSBy6YmdIl2TXsIhMmfpN/nPKj0p7jiw wp3EzVkSW9A/xbWkni/mNDaagTWcusYywk20wxjTDvYWi68YQMp0Vf0321cceA== 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 07D418300C for ; Sat, 21 Dec 2024 18:29:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tP2ve-0005TW-Dq; Sat, 21 Dec 2024 12:06:15 -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 1tP2vY-0005RS-OO for guix-patches@gnu.org; Sat, 21 Dec 2024 12:06: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 1tP2vV-0003PS-JJ; Sat, 21 Dec 2024 12:06:06 -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:References:In-Reply-To:Date:From:To:Subject; bh=wA07eaLkQ4B3lVWMM51rM1bssBd0q3oVs5rlUk0PLOY=; b=auqc52R01g+8VRmKhXsG/aRz+7MLauM/J00CTppFRgxBHgdqLK3SkfCXj+w94dmmjUvsrLn9R1f9gvIGpIX0ZCq65Ztd9laL9w+lqCsMr6TafrzyNaUxrKQsL7IERSdBT/h3+JFHyR8wo+Uixmc3/gQGZZFzpYDvo98Iunu/u2Y42Yr6AdBlEk2Tjhp+prtDwOm8H2yKX6EUZlNb2MHO+TApgC/5sPEf4R+M5Br2VYnvgwFjoXNimQQ1TrMBLcutPwTfPpo9FbLyQ57ra3F8ACJTcq1y6OcQeop5bCXTz89zt7Ycb3E6Zn8Aop01d+/yioLEkZDXwzSA/Va6HHxzmQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tP2vU-0005RW-SI; Sat, 21 Dec 2024 12:06:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75010] [PATCH 5/7] gnu: machine: Remove &deploy-error. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 21 Dec 2024 17:06:04 +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: 75010@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 75010-submit@debbugs.gnu.org id=B75010.173480071620808 (code B ref 75010); Sat, 21 Dec 2024 17:06:04 +0000 Received: (at 75010) by debbugs.gnu.org; 21 Dec 2024 17:05:16 +0000 Received: from localhost ([127.0.0.1]:47523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tP2uh-0005PR-OI for submit@debbugs.gnu.org; Sat, 21 Dec 2024 12:05:16 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:38121 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tP2uc-0005I2-4r for 75010@debbugs.gnu.org; Sat, 21 Dec 2024 12:05:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734800700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GILwmmbUV5cxDgm2vE7mgAMn6SS5HAWz45VRyyCkjIU=; b=mnd73a6TS7e1pqVgvtQRNtFq38wE5BhUm/Yj2HEIdgAhHXOtqmtIzGY7PNFq5DL8+rMyeR 0usEneEv0XZ3ZB+qf/FIpQAiDPVA3Qg76vfkJ57J9RWHqWq0PDL8rO3G2QyGN9zTF/os+/ RwYUYLaM7DDfG9ot/eLDen2tiVEfPoUOhol/eviW2BAMKHQ8vFKkQUrVvw3d/WbWQZL1qX 0Vuo8OIUm26UoH+Yk4bWxm/gK2AomNfqkhwPin2zUtazj2NSbpHUaH9cnpn/6iFmHN2jBW 8WKSeJ9fWT4P4Y/6cdl4C+WnGJG//QZxdQzGJtBYsE+QqE3DnX84lkD2ZJz6bA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 75f982c0 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <75010@debbugs.gnu.org>; Sat, 21 Dec 2024 17:05:00 +0000 (UTC) Date: Sat, 21 Dec 2024 18:04:09 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 07D418300C X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -1.51 X-Spam-Score: -1.51 X-TUID: 8OhZWo7Wv6OB * gnu/machine.scm (&deploy-error): Remove. * gnu/machine/ssh.scm (with-roll-back): Remove. (deploy-managed-host): Remove with-roll-back. * guix/scripts/deploy.scm (deploy-machine*): Remove deploy-error? case. Change-Id: I719eafda0f5d12e1f4e3795631e78378f5376745 --- gnu/machine.scm | 17 +------------- gnu/machine/ssh.scm | 51 +++++++++++++++-------------------------- guix/scripts/deploy.scm | 8 +------ 3 files changed, 20 insertions(+), 56 deletions(-) diff --git a/gnu/machine.scm b/gnu/machine.scm index 60be674972..ede595d053 100644 --- a/gnu/machine.scm +++ b/gnu/machine.scm @@ -41,12 +41,7 @@ (define-module (gnu machine) deploy-machine roll-back-machine - machine-remote-eval - - &deploy-error - deploy-error? - deploy-error-should-roll-back - deploy-error-captured-args)) + machine-remote-eval)) ;;; Commentary: ;;; @@ -122,13 +117,3 @@ (define (roll-back-machine machine) and the new generation number." (let ((environment (machine-environment machine))) ((environment-type-roll-back-machine environment) machine))) - - -;;; -;;; Error types. -;;; - -(define-condition-type &deploy-error &error - deploy-error? - (should-roll-back deploy-error-should-roll-back) - (captured-args deploy-error-captured-args)) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 3e69d4b9a3..b954620b69 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -480,18 +480,6 @@ (define (machine-boot-parameters machine) (boot-parameters-kernel-arguments params)))))))) remote-results)))) -(define-syntax-rule (with-roll-back should-roll-back? mbody ...) - "Catch exceptions that arise when binding MBODY, a monadic expression in -%STORE-MONAD, and collect their arguments in a &deploy-error condition, with -the 'should-roll-back' field set to SHOULD-ROLL-BACK?" - (catch #t - (lambda () - mbody ...) - (lambda args - (raise (condition (&deploy-error - (should-roll-back should-roll-back?) - (captured-args args))))))) - (define (deploy-managed-host machine) "Internal implementation of 'deploy-machine' for MACHINE instances with an environment type of 'managed-host." @@ -536,32 +524,29 @@ (define (deploy-managed-host machine) store))))) (mbegin %store-monad - (with-roll-back #f - (switch-to-system (eval/error-handling c - (raise (formatted-message - (G_ "\ + (switch-to-system (eval/error-handling c + (raise (formatted-message + (G_ "\ failed to switch systems while deploying '~a':~%~{~s ~}") - host - (inferior-exception-arguments c)))) - os)) + host + (inferior-exception-arguments c)))) + os) (parameterize ((%current-system system) (%current-target-system #f)) - (with-roll-back #t - (mbegin %store-monad - (upgrade-shepherd-services (eval/error-handling c - (warning (G_ "\ + (mbegin %store-monad + (upgrade-shepherd-services + (eval/error-handling c + (warning (G_ "\ an error occurred while upgrading services on '~a':~%~{~s ~}~%") - host - (inferior-exception-arguments - c))) - os) - (install-bootloader (eval/error-handling c - (raise (formatted-message - (G_ "\ + host (inferior-exception-arguments c))) + os) + (install-bootloader + (eval/error-handling c + (raise (formatted-message + (G_ "\ failed to install bootloader on '~a':~%~{~s ~}~%") - host - (inferior-exception-arguments c)))) - bootloader-configuration bootcfg))))))))) + host (inferior-exception-arguments c)))) + bootloader-configuration bootcfg)))))))) ;;; diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index 4b1a603049..ca0e1c4023 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -156,13 +156,7 @@ (define (deploy-machine* store machine) (apply format #f (gettext (formatted-message-string c) %gettext-domain) - (formatted-message-arguments c)))) - ((deploy-error? c) - (when (deploy-error-should-roll-back c) - (info (G_ "rolling back ~a...~%") - (machine-display-name machine)) - (run-with-store store (roll-back-machine machine))) - (apply throw (deploy-error-captured-args c)))) + (formatted-message-arguments c))))) (run-with-store store (deploy-machine machine)) (info (G_ "successfully deployed ~a~%") -- 2.45.2