From patchwork Thu Mar 19 11:02:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 20756 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4D59F27BBE4; Thu, 19 Mar 2020 11:04:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C761527BBEA for ; Thu, 19 Mar 2020 11:04:17 +0000 (GMT) Received: from localhost ([::1]:36146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEsyH-0007nE-9x for patchwork@mira.cbaines.net; Thu, 19 Mar 2020 07:04:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34676) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEsy9-0007mB-K1 for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEsy4-0001mn-KT for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEsy4-0001l3-6Q for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jEsy4-0000QU-2i for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40130] [PATCH 5/8] deploy: Use 'with-build-handler'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 19 Mar 2020 11:04:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40130 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40130@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 40130-submit@debbugs.gnu.org id=B40130.15846157911518 (code B ref 40130); Thu, 19 Mar 2020 11:04:04 +0000 Received: (at 40130) by debbugs.gnu.org; 19 Mar 2020 11:03:11 +0000 Received: from localhost ([127.0.0.1]:41831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEsxD-0000OL-8f for submit@debbugs.gnu.org; Thu, 19 Mar 2020 07:03:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEsxA-0000N8-Ap for 40130@debbugs.gnu.org; Thu, 19 Mar 2020 07:03:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jEsx5-0000Bd-6B; Thu, 19 Mar 2020 07:03:03 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50612 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jEsx4-0001MW-ID; Thu, 19 Mar 2020 07:03:02 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 19 Mar 2020 12:02:49 +0100 Message-Id: <20200319110252.5081-5-ludo@gnu.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319110252.5081-1-ludo@gnu.org> References: <20200319110252.5081-1-ludo@gnu.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Until now, 'guix deploy' would never display what is going to be built. * guix/scripts/deploy.scm (guix-deploy): Wrap 'for-each' in 'with-build-handler'. --- guix/scripts/deploy.scm | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index ad05c333dc..a82dde00a4 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -108,19 +108,21 @@ Perform the deployment specified by FILE.\n")) (with-status-verbosity (assoc-ref opts 'verbosity) (with-store store (set-build-options-from-command-line store opts) - (for-each (lambda (machine) - (info (G_ "deploying to ~a...~%") - (machine-display-name machine)) - (parameterize ((%graft? (assq-ref opts 'graft?))) - (guard (c ((message-condition? c) - (report-error (G_ "failed to deploy ~a: ~a~%") - (machine-display-name machine) - (condition-message 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)))) - (run-with-store store (deploy-machine machine))))) - machines))))) + (with-build-handler (build-notifier #:use-substitutes? + (assoc-ref opts 'substitutes?)) + (for-each (lambda (machine) + (info (G_ "deploying to ~a...~%") + (machine-display-name machine)) + (parameterize ((%graft? (assq-ref opts 'graft?))) + (guard (c ((message-condition? c) + (report-error (G_ "failed to deploy ~a: ~a~%") + (machine-display-name machine) + (condition-message 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)))) + (run-with-store store (deploy-machine machine))))) + machines))))))