From unknown Sun Jun 15 08:45:03 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Jun 2024 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71802@debbugs.gnu.org Cc: ngraves@ngraves.fr, andrew@trop.in X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17195008305019 (code B ref -1); Thu, 27 Jun 2024 15:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Jun 2024 15:07:10 +0000 Received: from localhost ([127.0.0.1]:43133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMqiL-0001It-Vy for submit@debbugs.gnu.org; Thu, 27 Jun 2024 11:07:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:58212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMqiK-0001Im-GE for submit@debbugs.gnu.org; Thu, 27 Jun 2024 11:07:08 -0400 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 1sMqiH-0001Ra-7K for guix-patches@gnu.org; Thu, 27 Jun 2024 11:07:05 -0400 Received: from 16.mo583.mail-out.ovh.net ([87.98.174.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqiD-0001tv-9J for guix-patches@gnu.org; Thu, 27 Jun 2024 11:07:04 -0400 Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.139.225]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4W923F2Lp2z1K5y for ; Thu, 27 Jun 2024 15:06:48 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-mcrrc (unknown [10.110.96.193]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 9B6DC1FEAA; Thu, 27 Jun 2024 15:06:47 +0000 (UTC) Received: from ngraves.fr ([37.59.142.106]) by ghost-submission-6684bf9d7b-mcrrc with ESMTPSA id 88OWDgeAfWak8QAA3IHzLA (envelope-from ); Thu, 27 Jun 2024 15:06:47 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R0061de0929a-09a3-401d-80e5-041079b08411, EF1A3882BBF0FDD95E9CFC0F8FCF195DD0B940A8) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves Date: Thu, 27 Jun 2024 17:00:40 +0200 Message-ID: <20240627150643.30981-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 9225623839507407451 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrtdeggdekhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeekffegteffgfffjeegjedvfffgtddvueeutefgfeeuvdejgedvgeejjeevueeuveenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeefpdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=87.98.174.144; envelope-from=ngraves@ngraves.fr; helo=16.mo583.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) While experimenting with profile reconfigurations almost a year ago, a thing that happened a lot was that I reconfigured a lot while often I didn't need to. In the event a guix system / guix home wrapper comes to life (I've experimented for that in RDE), such a reflex to avoid switching to new profiles that already are existing profiles is welcome IMO. This is not a definitive proposal but rather an illustration of an approach which could be implemented at other places too to avoid some unecessary calculations / reconfigurations. Nicolas Graves (1): guix: home: Avoid home reconfiguration when nothing is to be done. guix/scripts/home.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.45.2 From unknown Sun Jun 15 08:45:03 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#71802] [PATCH] guix: home: Avoid home reconfiguration when nothing is to be done. References: <20240627150643.30981-1-ngraves@ngraves.fr> In-Reply-To: <20240627150643.30981-1-ngraves@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Jun 2024 15:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71802@debbugs.gnu.org Cc: ngraves@ngraves.fr, andrew@trop.in Received: via spool by 71802-submit@debbugs.gnu.org id=B71802.17195026148187 (code B ref 71802); Thu, 27 Jun 2024 15:37:02 +0000 Received: (at 71802) by debbugs.gnu.org; 27 Jun 2024 15:36:54 +0000 Received: from localhost ([127.0.0.1]:43187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMrB8-00027z-4c for submit@debbugs.gnu.org; Thu, 27 Jun 2024 11:36:54 -0400 Received: from 6.mo582.mail-out.ovh.net ([87.98.177.69]:52259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMrB4-00027o-J8 for 71802@debbugs.gnu.org; Thu, 27 Jun 2024 11:36:52 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.108.25.152]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 4W92jm50p7z1Bws for <71802@debbugs.gnu.org>; Thu, 27 Jun 2024 15:36:44 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-j6b4p (unknown [10.111.182.7]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CFCBF1FEA7; Thu, 27 Jun 2024 15:36:42 +0000 (UTC) Received: from ngraves.fr ([37.59.142.102]) by ghost-submission-6684bf9d7b-j6b4p with ESMTPSA id Zof9NgqHfWam1QMAMsdf5g (envelope-from ); Thu, 27 Jun 2024 15:36:42 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-102R00430d05ee9-eba9-4392-ad86-34b8cf5d374a, EF1A3882BBF0FDD95E9CFC0F8FCF195DD0B940A8) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves Date: Thu, 27 Jun 2024 17:36:18 +0200 Message-ID: <20240627153634.5181-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 9731152895955296859 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrtdeggdeludcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeekffegteffgfffjeegjedvfffgtddvueeutefgfeeuvdejgedvgeejjeevueeuveenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedukedtvdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/scripts/home.scm (perform-action): In case of 'reconfigure action, when the output profile is the current profile, avoid reconfiguration. Change-Id: I9d4413df05455a1ebbe10773a851a61e1c8c9e66 --- guix/scripts/home.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index b4c82d275f1..f0b8251c435 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -446,12 +446,16 @@ (define println (generation (generation-file-name %guix-home (+ 1 number)))) - (switch-symlinks generation he-out-path) - (switch-symlinks %guix-home generation) - (setenv "GUIX_NEW_HOME" he-out-path) - (primitive-load (string-append he-out-path "/activate")) - (setenv "GUIX_NEW_HOME" #f) - (return he-out-path))) + (if (equal? he-out-path (readlink* %guix-home)) + (begin (info (G_ "Nothing to be done.~%")) + (return #f)) + (begin + (switch-symlinks generation he-out-path) + (switch-symlinks %guix-home generation) + (setenv "GUIX_NEW_HOME" he-out-path) + (primitive-load (string-append he-out-path "/activate")) + (setenv "GUIX_NEW_HOME" #f) + (return he-out-path))))) ((container) (mlet %store-monad ((status (spawn-home-container he -- 2.45.2 From unknown Sun Jun 15 08:45:03 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done. Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 29 Jun 2024 01:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves Cc: 71802@debbugs.gnu.org, andrew@trop.in Received: via spool by 71802-submit@debbugs.gnu.org id=B71802.171962331317671 (code B ref 71802); Sat, 29 Jun 2024 01:09:01 +0000 Received: (at 71802) by debbugs.gnu.org; 29 Jun 2024 01:08:33 +0000 Received: from localhost ([127.0.0.1]:36411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNMZs-0004ax-SB for submit@debbugs.gnu.org; Fri, 28 Jun 2024 21:08:33 -0400 Received: from mail-108-mta0.mxroute.com ([136.175.108.0]:41353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNMZo-0004aa-T1 for 71802@debbugs.gnu.org; Fri, 28 Jun 2024 21:08:29 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta0.mxroute.com (ZoneMTA) with ESMTPSA id 1906189444000017a3.001 for <71802@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 29 Jun 2024 01:08:24 +0000 X-Zone-Loop: 7fcc4d77558d5738db333010e2fb0c77da8e67ed9004 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=t2wVyXuqVboJfv6hibfDnxaUByCyr7nsqtZ2NbNOrOI=; b=POt20fRBeLjqMRff4Q7jtq+88K QbPJwsGHNxUaWvOrRSeAOvjiOp5urKdomkEpOv5FV2ZMFIbbAvmVXjFrBEFwjdsdturOpNCki1xVL /Rm8ISD17cN5aGKmEZ5vambZcpJplyHhHULAVDrs8AYAYNafkxGHJ8TOYn7CkMbQIB8FhRllVSZ92 w3UZfhjMc1Vd9lym+Q/7K2oYjloAB6Igs0GYWlYDnX9wn/Qm0ye1UNTLpt6XnCY46LNvc+aEDAlW6 F3WfFM0Wv7JYLLqUvAkOJ/LR7pY/Bau1KnY2THzdlooDLj0IriA2PpMJdQ4kdY58cjjzPQp263ZS5 HMlaYtUA==; From: Richard Sent In-Reply-To: <20240627150643.30981-1-ngraves@ngraves.fr> (Nicolas Graves's message of "Thu, 27 Jun 2024 17:00:40 +0200") References: <20240627150643.30981-1-ngraves@ngraves.fr> Date: Fri, 28 Jun 2024 21:08:20 -0400 Message-ID: <87bk3kv9mj.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Nicolas, > While experimenting with profile reconfigurations almost a year ago, a > thing that happened a lot was that I reconfigured a lot while often I > didn't need to. In the event a guix system / guix home wrapper comes > to life (I've experimented for that in RDE), such a reflex to avoid > switching to new profiles that already are existing profiles is > welcome IMO. > > This is not a definitive proposal but rather an illustration of an > approach which could be implemented at other places too to avoid some > unecessary calculations / reconfigurations. I can't figure out exactly how this patch could apply, but I can see it or something similar being useful when using guix-home-service. If we can make oneshot service attempt to register a new generation on every invocation /and/ use a patch like to avoid redundant generations, it may solve many of the issues raised in [1]. [1]: https://issues.guix.gnu.org/69781#5 -- Take it easy, Richard Sent Making my computer weirder one commit at a time.