GNU bug report logs - #71802
[PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done.

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Thu, 27 Jun 2024 15:08:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 71802 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#71802; Package guix-patches. (Thu, 27 Jun 2024 15:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Graves <ngraves <at> ngraves.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 27 Jun 2024 15:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: guix-patches <at> gnu.org
Cc: ngraves <at> ngraves.fr, andrew <at> trop.in
Subject: [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be
 done.
Date: Thu, 27 Jun 2024 17:00:40 +0200
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





Information forwarded to guix-patches <at> gnu.org:
bug#71802; Package guix-patches. (Thu, 27 Jun 2024 15:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 71802 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 71802 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr, andrew <at> trop.in
Subject: [PATCH] guix: home: Avoid home reconfiguration when nothing is to be
 done.
Date: Thu, 27 Jun 2024 17:36:18 +0200
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#71802; Package guix-patches. (Sat, 29 Jun 2024 01:09:01 GMT) Full text and rfc822 format available.

Message #11 received at 71802 <at> debbugs.gnu.org (full text, mbox):

From: Richard Sent <richard <at> freakingpenguin.com>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 71802 <at> debbugs.gnu.org, andrew <at> trop.in
Subject: Re: [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when
 nothing is to be done.
Date: Fri, 28 Jun 2024 21:08:20 -0400
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.




This bug report was last modified 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.