guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#36404] [PATCH 1/3] guix system: Add 'reconfigure' module.


From: Ludovic Courtès
Subject: [bug#36404] [PATCH 1/3] guix system: Add 'reconfigure' module.
Date: Sun, 07 Jul 2019 00:11:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

address@hidden (Jakob L. Kreuze) skribis:

> * guix/scripts/system/reconfigure.scm: New file.
> * Makefile.am (MODULES): Add it.
> * guix/scripts/system.scm (bootloader-installer-script): Export variable.

> +;;; Copyright © 2019 Jakob L. Kreuze <address@hidden>

Could you preserve the copyright lines of (guix scripts system) that
apply to these portions of code, roughly?

I think all the procedures in (guix scripts system reconfigure) could
return a <scheme-file> rather than a gexp.  Actually a <program-file>
would even be cleaner than a <scheme-file>, as it could better handle
transitions like you’re on a Guile 2.2 system reconfiguring towards a
Guile 3 system.

Consequently you could rename ‘switch-to-system’ to
‘switch-system-program’, and so on.

> +(define (switch-to-system system-derivation activation-script)

I think it could simply take an <operating-system> record and derive the
relevant bits from that.

> +            (switch-symlinks generation system)
> +            (switch-symlinks %system-profile generation)
> +            ;; The implementation of 'guix system reconfigure' saves the
> +            ;; load path and environment here. This is unnecessary here
> +            ;; because each invocation of 'remote-eval' runs in a distinct
> +            ;; Guile REPL.
> +            (setenv "GUIX_NEW_SYSTEM" system)

This comment may become irrelevant.

> +            ;; The activation script may write to stdout, which confuses
> +            ;; 'remote-eval' when it attempts to read a result from the
> +            ;; remote REPL. We work around this by forcing the output to a
> +            ;; string.
> +            (with-output-to-string
> +              (lambda ()
> +                (primitive-load #$activation-script))))))))

Same here?  For ‘guix system reconfigure’, we’d rather not lose messages
written to stdout by ACTIVATION-SCRIPT.

> +            (unless (false-if-exception
> +                     (begin
> +                       ;; The implementation of 'guix system reconfigure'
> +                       ;; saves the load path here. This is unnecessary here
> +                       ;; because each invocation of 'remote-eval' runs in a
> +                       ;; distinct Guile REPL.
> +                       (install-boot-config #$bootcfg #$bootcfg-file 
> #$target)
> +                       ;; The installation script may write to stdout, which
> +                       ;; confuses 'remote-eval' when it attempts to read a
> +                       ;; result from the remote REPL. We work around this
> +                       ;; by forcing the output to a string.
> +                       (with-output-to-string
> +                         (lambda ()
> +                           (primitive-load #$installer-script)))))

Same as above.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]