unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: "Jakob L. Kreuze" <zerodaysfordays@sdf.lonestar.org>
Cc: guix-devel@gnu.org, 36855@debbugs.gnu.org
Subject: bug#36855: guix system switch-generation doesn't
Date: Thu, 08 Aug 2019 09:40:30 -0700	[thread overview]
Message-ID: <87h86ry5j5.fsf__27223.4835357935$1565282475$gmane$org@gmail.com> (raw)
In-Reply-To: <877e7on3zd.fsf@sdf.lonestar.org> (Jakob L. Kreuze's message of "Wed, 07 Aug 2019 15:57:10 -0400")

[-- Attachment #1: Type: text/plain, Size: 3048 bytes --]

Hi Jakob,

zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) writes:

> 'switch-to-system-generation' doesn't call out to
> 'upgrade-shepherd-services'. I'm not sure if this was an intentional
> decision or not

It is intentional, but only because there is currently no way to call
upgrade-shepherd-services when switching system generations.

Consider the procedure upgrade-shepherd-services: you must pass it an
<operating-system> record.  When you are flipping from one generation to
another, how do you get the <operating-system> record that was used for
the generation you're switching to?  Guix doesn't currently store the
operating system configuration file or its <operating-system> record
anywhere, so we can't call upgrade-shepherd-services.

This was discussed in 2016 and we agreed we need to persist some
information to enable us to handle Shepherd services correctly.  This is
what Ludo suggested at the time:

https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00173.html

"Maybe we could store in the system output (result of ‘guix system
build’) an sexp representation of (part of) our <shepherd-service>
records:

  (shepherd-service
    (provisions (x y z))
    (requirements (a b c))
    (start-script "/gnu/store/…-start-foo.scm")
    (stop-script "/gnu/store/…-stop-foo.scm")
    …)

Then ‘upgrade-shepherd-services’ could start from this simplified
representation instead of using the full-blown <shepherd-service>
objects, and thus could work both when instantiating a new generation
and when rolling back."

Until that happens, you'll always have to reboot to complete the
switch.

FYI, last I checked (about 3 years ago), in NixOS they took a slightly
different approach: instead of storing state describing the previous
system generation and relying on the current system's logic to correctly
parse it and use it to revert the system to a prior configuration, they
just dump everything into a self-contained script that knows how to
update the entire system to one specific configuration.  That approach
is nice in some ways because switching generations is dead simple - you
just run the switching script belonging to the generation you want to
switch to - but it also has downsides.

For example, if the target generation is old enough compared to the
current system, then the target generation's old switching script might
not understand how to deal with the current system correctly.  Instead,
if you only store the bare minimum of state required to take the right
actions, and you implement the meat of the logic in the current Guix
installation, you are more likely to be able to switch generations even
to very old ones where the world was very different, since the current
Guix can be taught how to deal gracefully with the old world.  But it
seems more complicated.  It's all about trade-offs.

That said, I've never gone back to implement this.  If you want to give
it a try, you're more than welcome to do so!

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2019-08-08 16:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 10:00 bug#36855: guix system switch-generation doesn't Robert Vollmert
2019-07-30 16:16 ` Jakob L. Kreuze
2019-08-06 21:21 ` Robert Vollmert
2019-08-06 21:25 ` Robert Vollmert
     [not found] ` <A3C3B87A-1B74-4983-A8EA-7281E3103567@vllmrt.net>
2019-08-07 19:37   ` Christopher Lemmer Webber
2019-08-07 19:57     ` Jakob L. Kreuze
     [not found]     ` <877e7on3zd.fsf@sdf.lonestar.org>
2019-08-08 16:40       ` Chris Marusich [this message]
     [not found]       ` <87h86ry5j5.fsf@gmail.com>
2019-08-08 17:03         ` Robert Vollmert
     [not found]         ` <51A8B412-1AE3-4464-8146-DE8B19B7C4DF@vllmrt.net>
2019-08-09  7:35           ` Chris Marusich
2019-08-26 10:07         ` Ludovic Courtès
2019-08-26 18:51           ` Mark H Weaver
2019-08-28  0:34             ` Mark H Weaver
2019-08-28 18:33               ` Jakob L. Kreuze
2019-08-28 18:46                 ` Mark H Weaver
     [not found]                 ` <875zmhm8jo.fsf@netris.org>
2019-08-29  0:08                   ` Jakob L. Kreuze
     [not found]         ` <874l241bq6.fsf@gnu.org>
2019-08-28 18:28           ` Jakob L. Kreuze
2021-03-09  7:01 ` bug#36855: bug#37596: 'guix system switch-generation' does not reload Shepherd services Brice Waegeneire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='87h86ry5j5.fsf__27223.4835357935$1565282475$gmane$org@gmail.com' \
    --to=cmmarusich@gmail.com \
    --cc=36855@debbugs.gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=zerodaysfordays@sdf.lonestar.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).