From patchwork Mon Feb 12 22:50:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 60256 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 925C427BBEA; Tue, 13 Feb 2024 02:52:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4D79227BBE2 for ; Tue, 13 Feb 2024 02:52:09 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZith-0006QH-FQ; Mon, 12 Feb 2024 21:51:49 -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 1rZitd-0006Ol-Vj for guix-patches@gnu.org; Mon, 12 Feb 2024 21:51:46 -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 1rZitd-0004cu-NN for guix-patches@gnu.org; Mon, 12 Feb 2024 21:51:45 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZitu-0004zS-R6 for guix-patches@gnu.org; Mon, 12 Feb 2024 21:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69092] [PATCH] machine/ssh: Invert WITH-ROLL-BACK and MBEGIN. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Feb 2024 02:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69092 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69092@debbugs.gnu.org Cc: Ricardo Wurmus X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170779267618972 (code B ref -1); Tue, 13 Feb 2024 02:52:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Feb 2024 02:51:16 +0000 Received: from localhost ([127.0.0.1]:38579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZit9-0004vr-OS for submit@debbugs.gnu.org; Mon, 12 Feb 2024 21:51:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:39802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZiX3-0003rl-GG for submit@debbugs.gnu.org; Mon, 12 Feb 2024 21:28:26 -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 1rZf8n-0007t3-TX for guix-patches@gnu.org; Mon, 12 Feb 2024 17:51:09 -0500 Received: from sender4-of-o50.zoho.com ([136.143.188.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZf8k-00067L-Rx for guix-patches@gnu.org; Mon, 12 Feb 2024 17:51:09 -0500 Delivered-To: rekado@elephly.net ARC-Seal: i=1; a=rsa-sha256; t=1707778261; cv=none; d=zohomail.com; s=zohoarc; b=HUArrk2E5TcbokHKD1sB7Q/DxGZNu9REUwDgqf9Ye8GWcdEj+//c+BRfZ13X944qkBRsRJzayYiDisPgwSKmsQ5TEWxxhDV8Fffp9z1JzDeynWScaHpzsVg51xb+3uKzf4krilLPlo/mN+lQbE8mRejHsmPETz5litLG50Mdb8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707778261; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=2uhAX0bavuypogu8bvE39LreOMo4woMpmRES6+kOtNs=; b=gzE7anS4H94c74uKdJXdlRrjqCKQ1/vSda5kbMA1MmxsDkQ6/OK0xuxhRKybRqFCEpXhUQbX4yrRUjAOMCLRgRVBYc+FJyayqMmNYGW+9Ej+A0uXyE7FfWqMH0NVF1RroYhDtgfCQwVj/mfqgc/QKxBgO4iFSdW7rySOBLKquQY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1707778261; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=2uhAX0bavuypogu8bvE39LreOMo4woMpmRES6+kOtNs=; b=W+zFoLUUbihOrqUVfvfW34scmbtO567nObZZf/euUzmdJylm1wR+yQi0vbS6/nhP x7Bfsv0C52KpISpnoScsOIcgDjwsYmbhBUOYONTck1kTNjLKI7boVXvXScZFI5BUr80 OnK7EgrG2lW8lRtvcyGYOWPGt0BOkWSGBSWsZtyU= Received: from localhost (36-109-142-46.pool.kielnet.net [46.142.109.36]) by mx.zohomail.com with SMTPS id 1707778260463428.42568756250273; Mon, 12 Feb 2024 14:51:00 -0800 (PST) From: Ricardo Wurmus Date: Mon, 12 Feb 2024 23:50:39 +0100 Message-ID: <9915f5dc0cea842a9c4c3f3a13f2c97e6ee60432.1707778239.git.rekado@elephly.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.50; envelope-from=rekado@elephly.net; helo=sender4-of-o50.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches When using "guix deploy" on an x86_64-linux machine to deploy a system to i686-linux, DEPLOY-MANAGED-HOST would revert %CURRENT-SYSTEM to the host system's value by the time it evaluated UPGRADE-SHEPHERD-SERVICES. The earlier PARAMETERIZE would no longer be effective. Turning the expression inside out solves the problem as the monadic expression introduced with MBEGIN retains the %CURRENT-SYSTEM parameter. * gnu/machine/ssh.scm (deploy-managed-host): Ensure that UPGRADE-SHEPHERD-SERVICES is evaluated for the architecture of the target machine. Change-Id: I0816da79cd7c46a69418717fa33b2fe4e2fabae0 --- gnu/machine/ssh.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) base-commit: bb4f0509b7cce750fc944e604aa919ea89910ea7 diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index b5984dc732..011d197917 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Jakob L. Kreuze ;;; Copyright © 2020-2023 Ludovic Courtès +;;; Copyright © 2024 Ricardo ;;; ;;; This file is part of GNU Guix. ;;; @@ -537,8 +538,8 @@ (define (deploy-managed-host machine) host (inferior-exception-arguments c)))) os)) - (with-roll-back #t - (mbegin %store-monad + (mbegin %store-monad + (with-roll-back #t (upgrade-shepherd-services (eval/error-handling c (warning (G_ "\ an error occurred while upgrading services on '~a':~%~{~s ~}~%")