[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’.
- [bug#36404] [PATCH 0/6] Add 'guix deploy'., (continued)
- [bug#36404] [PATCH 0/6] Add 'guix deploy'., Jakob L. Kreuze, 2019/07/04
- [bug#36404] [PATCH 0/6] Add 'guix deploy'., Ludovic Courtès, 2019/07/05
- [bug#36404] [PATCH 0/3] Refactor out common behavior for system reconfiguration., Jakob L. Kreuze, 2019/07/05
- [bug#36404] [PATCH 1/3] guix system: Add 'reconfigure' module., Jakob L. Kreuze, 2019/07/05
- [bug#36404] [PATCH 2/3] machine: Reimplement 'managed-host-environment-type' deployment., Jakob L. Kreuze, 2019/07/05
- [bug#36404] [PATCH 3/3] guix system: Reimplement 'reconfigure'., Jakob L. Kreuze, 2019/07/05
- [bug#36404] [PATCH 3/3] guix system: Reimplement 'reconfigure'., Ludovic Courtès, 2019/07/06
- [bug#36404] [PATCH 2/3] machine: Reimplement 'managed-host-environment-type' deployment., Ludovic Courtès, 2019/07/06
- [bug#36404] [PATCH 2/3] machine: Reimplement 'managed-host-environment-type' deployment., Christopher Lemmer Webber, 2019/07/07
- [bug#36404] [PATCH 2/3] machine: Reimplement 'managed-host-environment-type' deployment., Ludovic Courtès, 2019/07/07
- [bug#36404] [PATCH 1/3] guix system: Add 'reconfigure' module.,
Ludovic Courtès <=
- [bug#36404] [PATCH 0/3] Refactor out common behavior for system reconfiguration., Ludovic Courtès, 2019/07/06
- [bug#36404] [PATCH 0/3] Refactor out common behavior for system reconfiguration., Christopher Lemmer Webber, 2019/07/07
- [bug#36404] [PATCH 0/3] Refactor out common behavior for system reconfiguration., Ludovic Courtès, 2019/07/07
- [bug#36404] [PATCH 0/3] Refactor out common behavior for system reconfiguration., Jakob L. Kreuze, 2019/07/08
[bug#36404] [PATCH 0/4] Add 'guix deploy'., Jakob L. Kreuze, 2019/07/01
- [bug#36404] [PATCH 1/4] ssh: Add 'identity' keyword to 'open-ssh-session'., Jakob L. Kreuze, 2019/07/01
- [bug#36404] [PATCH 2/4] gnu: Add machine type for deployment specifications., Jakob L. Kreuze, 2019/07/01
- [bug#36404] [PATCH 3/4] Add 'guix deploy'., Jakob L. Kreuze, 2019/07/01
- [bug#36404] [PATCH 4/4] doc: Add section for 'guix deploy'., Jakob L. Kreuze, 2019/07/01
- [bug#36404] [PATCH 4/4] doc: Add section for 'guix deploy'., Kyle Meyer, 2019/07/02