unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done.
@ 2024-06-27 15:00 Nicolas Graves via Guix-patches via
  2024-06-27 15:36 ` [bug#71802] [PATCH] guix: home: Avoid " Nicolas Graves via Guix-patches via
  2024-06-29  1:08 ` [bug#71802] [PATCH 0/1] Avoid guix " Richard Sent
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-06-27 15:00 UTC (permalink / raw)
  To: 71802; +Cc: ngraves, andrew

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#71802] [PATCH] guix: home: Avoid home reconfiguration when nothing is to be done.
  2024-06-27 15:00 [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done Nicolas Graves via Guix-patches via
@ 2024-06-27 15:36 ` Nicolas Graves via Guix-patches via
  2024-06-29  1:08 ` [bug#71802] [PATCH 0/1] Avoid guix " Richard Sent
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-06-27 15:36 UTC (permalink / raw)
  To: 71802; +Cc: ngraves, andrew

* 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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done.
  2024-06-27 15:00 [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done Nicolas Graves via Guix-patches via
  2024-06-27 15:36 ` [bug#71802] [PATCH] guix: home: Avoid " Nicolas Graves via Guix-patches via
@ 2024-06-29  1:08 ` Richard Sent
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Sent @ 2024-06-29  1:08 UTC (permalink / raw)
  To: Nicolas Graves; +Cc: 71802, andrew

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.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-29  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 15:00 [bug#71802] [PATCH 0/1] Avoid guix home reconfiguration when nothing is to be done Nicolas Graves via Guix-patches via
2024-06-27 15:36 ` [bug#71802] [PATCH] guix: home: Avoid " Nicolas Graves via Guix-patches via
2024-06-29  1:08 ` [bug#71802] [PATCH 0/1] Avoid guix " Richard Sent

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).