From 190ddfe21e3d87719733d12fb9b5eb176125a49f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 30 Mar 2020 21:48:51 +0200 Subject: guix package: 'transaction-upgrade-entry' uses 'lower-manifest-entry'. * guix/profiles.scm (lower-manifest-entry): Export. * guix/scripts/package.scm (transaction-upgrade-entry)[lower-manifest-entry*] [upgrade]: New procedures. Use 'lower-manifest-entry*' instead of 'package-derivation' to compute the output file name of PKG. --- guix/scripts/package.scm | 73 ++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 34 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index c7908ece6c..be2e67997e 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -199,6 +199,10 @@ non-zero relevance score." (define (transaction-upgrade-entry store entry transaction) "Return a variant of TRANSACTION that accounts for the upgrade of ENTRY, a ." + (define (lower-manifest-entry* entry) + (run-with-store store + (lower-manifest-entry entry (%current-system)))) + (define (supersede old new) (info (G_ "package '~a' has been superseded by '~a'~%") (manifest-entry-name old) (package-name new)) @@ -211,40 +215,41 @@ non-zero relevance score." (output (manifest-entry-output old))) transaction))) - (match (if (manifest-transaction-removal-candidate? entry transaction) - 'dismiss - entry) - ('dismiss - transaction) - (($ name version output (? string? path)) - (match (find-best-packages-by-name name #f) - ((pkg . rest) - (let ((candidate-version (package-version pkg))) - (match (package-superseded pkg) - ((? package? new) - (supersede entry new)) - (#f - (case (version-compare candidate-version version) - ((>) - (manifest-transaction-install-entry - (package->manifest-entry* pkg output) - transaction)) - ((<) - transaction) - ((=) - (let ((candidate-path (derivation->output-path - (package-derivation store pkg)))) - ;; XXX: When there are propagated inputs, assume we need to - ;; upgrade the whole entry. - (if (and (string=? path candidate-path) - (null? (package-propagated-inputs pkg))) - transaction - (manifest-transaction-install-entry - (package->manifest-entry* pkg output) - transaction))))))))) - (() - (warning (G_ "package '~a' no longer exists~%") name) - transaction))))) + (define (upgrade entry) + (match entry + (($ name version output (? string? path)) + (match (find-best-packages-by-name name #f) + ((pkg . rest) + (let ((candidate-version (package-version pkg))) + (match (package-superseded pkg) + ((? package? new) + (supersede entry new)) + (#f + (case (version-compare candidate-version version) + ((>) + (manifest-transaction-install-entry + (package->manifest-entry* pkg output) + transaction)) + ((<) + transaction) + ((=) + (let* ((new (package->manifest-entry* pkg output))) + ;; XXX: When there are propagated inputs, assume we need to + ;; upgrade the whole entry. + (if (and (string=? (manifest-entry-item + (lower-manifest-entry* new)) + (manifest-entry-item entry)) + (null? (package-propagated-inputs pkg))) + transaction + (manifest-transaction-install-entry + new transaction))))))))) + (() + (warning (G_ "package '~a' no longer exists~%") name) + transaction))))) + + (if (manifest-transaction-removal-candidate? entry transaction) + transaction + (upgrade entry))) ;;; -- cgit v1.2.3 From a187cc562890895ad41dfad00eb1d5c4a4b00936 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 30 Mar 2020 22:11:54 +0200 Subject: guix package: 'transaction-upgrade-entry' swallows build requests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a regression introduced in 131f50cdc9dbb7183023f4dae759876a9e700bef whereby the install/upgrade message would not be displayed: $ guix upgrade -n 2.1 MB would be downloaded: /gnu/store/…-something-1.2 /gnu/store/…-its-dependency-2.3 This is because we'd directly abort from 'transaction-upgrade-entry' to the build handler of 'build-notifier'. * guix/scripts/package.scm (transaction-upgrade-entry): Call 'string=?' expression in 'with-build-handler'. * tests/packages.scm ("transaction-upgrade-entry, grafts"): New test. --- guix/scripts/package.scm | 14 +++++++++++--- tests/packages.scm | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index be2e67997e..cafa62c3f3 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -234,11 +234,19 @@ non-zero relevance score." transaction) ((=) (let* ((new (package->manifest-entry* pkg output))) + ;; Here we want to determine whether the NEW actually + ;; differs from ENTRY, but we need to intercept + ;; 'build-things' calls because they would prevent us from + ;; displaying the list of packages to install/upgrade + ;; upfront. Thus, if lowering NEW triggers a build (due + ;; to grafts), assume NEW differs from ENTRY. + ;; XXX: When there are propagated inputs, assume we need to ;; upgrade the whole entry. - (if (and (string=? (manifest-entry-item - (lower-manifest-entry* new)) - (manifest-entry-item entry)) + (if (and (with-build-handler (const #f) + (string=? (manifest-entry-item + (lower-manifest-entry* new)) + (manifest-entry-item entry))) (null? (package-propagated-inputs pkg))) transaction (manifest-transaction-install-entry diff --git a/tests/packages.scm b/tests/packages.scm index 1ff35ec9c4..c2ec1f2c24 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -148,6 +148,30 @@ (string=? (manifest-pattern-version pattern) "1") (string=? (manifest-pattern-output pattern) "out"))))))) +(test-assert "transaction-upgrade-entry, grafts" + ;; Ensure that, when grafts are enabled, 'transaction-upgrade-entry' doesn't + ;; try to build stuff. + (with-build-handler (const 'failed!) + (parameterize ((%graft? #t)) + (let* ((old (dummy-package "foo" (version "1"))) + (bar (dummy-package "bar" (version "0") + (replacement old))) + (new (dummy-package "foo" (version "1") + (inputs `(("bar" ,bar))))) + (tx (mock ((gnu packages) find-best-packages-by-name + (const (list new))) + (transaction-upgrade-entry + %store + (manifest-entry + (inherit (package->manifest-entry old)) + (item (string-append (%store-prefix) "/" + (make-string 32 #\e) "-foo-1"))) + (manifest-transaction))))) + (and (match (manifest-transaction-install tx) + ((($ "foo" "1" "out" item)) + (eq? item new))) + (null? (manifest-transaction-remove tx))))))) + (test-assert "package-field-location" (let () (define (goto port line column) -- cgit v1.2.3 From a357849f5b1314c2a35efeee237645b9b08c39f5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 30 Mar 2020 23:34:48 +0200 Subject: guix package: Do not misdiagnose upgrades when there are propagated inputs. Fixes . Reported by Andy Tai . * guix/profiles.scm (list=?, manifest-entry=?): New procedures. * guix/scripts/package.scm (transaction-upgrade-entry): In the '=' case, use 'manifest-entry=?' to determine whether it's an upgrade. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs"): New test. --- guix/profiles.scm | 29 +++++++++++++++++++++++++++++ guix/scripts/package.scm | 11 +++-------- tests/packages.scm | 22 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 8 deletions(-) (limited to 'guix/scripts') diff --git a/guix/profiles.scm b/guix/profiles.scm index e3bbc6dd6d..8aa76a3537 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -89,6 +89,8 @@ manifest-entry-properties lower-manifest-entry + manifest-entry=? + manifest-pattern manifest-pattern? manifest-pattern-name @@ -217,6 +219,33 @@ (output manifest-pattern-output ; string | #f (default "out"))) +(define (list=? = lst1 lst2) + "Return true if LST1 and LST2 have the same length and their elements are +pairwise equal per =." + (match lst1 + (() + (null? lst2)) + ((head1 . tail1) + (match lst2 + ((head2 . tail2) + (and (= head1 head2) (list=? = tail1 tail2))) + (() + #f))))) + +(define (manifest-entry=? entry1 entry2) + "Return true if ENTRY1 is equivalent to ENTRY2, ignoring their 'properties' +field." + (match entry1 + (($ name1 version1 output1 item1 dependencies1 paths1) + (match entry2 + (($ name2 version2 output2 item2 dependencies2 paths2) + (and (string=? name1 name2) + (string=? version1 version2) + (string=? output1 output2) + (equal? item1 item2) ;XXX: could be vs. store item + (equal? paths1 paths2) + (list=? manifest-entry=? dependencies1 dependencies2))))))) + (define (manifest-transitive-entries manifest) "Return the entries of MANIFEST along with their propagated inputs, recursively." diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index cafa62c3f3..badb1dcd38 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -240,14 +240,9 @@ non-zero relevance score." ;; displaying the list of packages to install/upgrade ;; upfront. Thus, if lowering NEW triggers a build (due ;; to grafts), assume NEW differs from ENTRY. - - ;; XXX: When there are propagated inputs, assume we need to - ;; upgrade the whole entry. - (if (and (with-build-handler (const #f) - (string=? (manifest-entry-item - (lower-manifest-entry* new)) - (manifest-entry-item entry))) - (null? (package-propagated-inputs pkg))) + (if (with-build-handler (const #f) + (manifest-entry=? (lower-manifest-entry* new) + entry)) transaction (manifest-transaction-install-entry new transaction))))))))) diff --git a/tests/packages.scm b/tests/packages.scm index d0befbe45d..7a8b5e4a2d 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -122,6 +122,28 @@ (manifest-transaction))))) (manifest-transaction-null? tx))) +(test-assert "transaction-upgrade-entry, zero upgrades, propagated inputs" + ;; Properly detect equivalent packages even when they have propagated + ;; inputs. See . + (let* ((dep (dummy-package "dep" (version "2"))) + (old (dummy-package "foo" (version "1") + (propagated-inputs `(("dep" ,dep))))) + (drv (package-derivation %store old)) + (tx (mock ((gnu packages) find-best-packages-by-name + (const (list old))) + (transaction-upgrade-entry + %store + (manifest-entry + (inherit (package->manifest-entry old)) + (item (derivation->output-path drv)) + (dependencies + (list (manifest-entry + (inherit (package->manifest-entry dep)) + (item (derivation->output-path + (package-derivation %store dep))))))) + (manifest-transaction))))) + (manifest-transaction-null? tx))) + (test-assert "transaction-upgrade-entry, one upgrade" (let* ((old (dummy-package "foo" (version "1"))) (new (dummy-package "foo" (version "2"))) -- cgit v1.2.3 From 2ad6eb0568ed69127aea987c009138e03b5b8954 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 2 Apr 2020 10:58:38 +0200 Subject: guix system: Use 'mapm/accumulate-builds'. * guix/scripts/system.scm (perform-action): Use 'mapm/accumulate-builds' instead of 'mapm'. --- guix/scripts/system.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index a178761203..4937e68115 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -825,10 +825,10 @@ static checks." ;; For 'init' and 'reconfigure', always build BOOTCFG, even if ;; --no-bootloader is passed, because we then use it as a GC root. ;; See . - (drvs (mapm %store-monad lower-object - (if (memq action '(init reconfigure)) - (list sys bootcfg) - (list sys)))) + (drvs (mapm/accumulate-builds lower-object + (if (memq action '(init reconfigure)) + (list sys bootcfg) + (list sys)))) (% (if derivations-only? (return (for-each (compose println derivation-file-name) drvs)) -- cgit v1.2.3 From a6850f6827869cd20feb1d4cc5abf6744b6cc164 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 2 Apr 2020 22:09:43 +0200 Subject: guix system: Do not import the user's (guix config). Previously, 'switch-to-system.drv' and 'install-bootloader.drv' would depend on the user's (guix config) module. This is no longer the case. * guix/scripts/system/reconfigure.scm (not-config?): New procedure. (switch-system-program): Do not import the user's (guix config). Use 'make-config.scm' instead. (install-bootloader-program): Likewise. --- guix/scripts/system/reconfigure.scm | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 77a72307b4..c8d1ed4a51 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2016 Alex Kost ;;; Copyright © 2016, 2017, 2018 Chris Marusich ;;; Copyright © 2017 Mathieu Othacehe @@ -33,6 +33,7 @@ #:use-module (guix modules) #:use-module (guix monads) #:use-module (guix store) + #:use-module ((guix self) #:select (make-config.scm)) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -60,6 +61,14 @@ ;;; Profile creation. ;;; +(define not-config? + ;; Select (guix …) and (gnu …) modules, except (guix config). + (match-lambda + (('guix 'config) #f) + (('guix rest ...) #t) + (('gnu rest ...) #t) + (_ #f))) + (define* (switch-system-program os #:optional profile) "Return an executable store item that, upon being evaluated, will create a new generation of PROFILE pointing to the directory of OS, switch to it @@ -67,9 +76,11 @@ atomically, and run OS's activation script." (program-file "switch-to-system.scm" (with-extensions (list guile-gcrypt) - (with-imported-modules (source-module-closure '((guix config) - (guix profiles) - (guix utils))) + (with-imported-modules `(,@(source-module-closure + '((guix profiles) + (guix utils)) + #:select? not-config?) + ((guix config) => ,(make-config.scm))) #~(begin (use-modules (guix config) (guix profiles) @@ -184,10 +195,13 @@ BOOTLOADER-PACKAGE." (program-file "install-bootloader.scm" (with-extensions (list guile-gcrypt) - (with-imported-modules (source-module-closure '((gnu build bootloader) - (gnu build install) - (guix store) - (guix utils))) + (with-imported-modules `(,@(source-module-closure + '((gnu build bootloader) + (gnu build install) + (guix store) + (guix utils)) + #:select? not-config?) + ((guix config) => ,(make-config.scm))) #~(begin (use-modules (gnu build bootloader) (gnu build install) @@ -197,6 +211,7 @@ BOOTLOADER-PACKAGE." (ice-9 binary-ports) (srfi srfi-34) (srfi srfi-35)) + (let* ((gc-root (string-append #$target %gc-roots-directory "/bootcfg")) (new-gc-root (string-append gc-root ".new"))) ;; #$bootcfg has dependencies. -- cgit v1.2.3 From 5517750344be05c91bc2979c1a0e2348a9ae902d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 2 Apr 2020 22:46:18 +0200 Subject: reconfigure: Run the effect scripts as separate processes. Fixes . Reported by strypsteen@posteo.net. * guix/scripts/system/reconfigure.scm (switch-to-system) (upgrade-shepherd-services, install-bootloader): Use 'system*' instead of 'primitive-load'. --- guix/scripts/system/reconfigure.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index c8d1ed4a51..21b472e0c5 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -100,7 +100,7 @@ atomically, and run OS's activation script." "Using EVAL, a monadic procedure taking a single G-Expression as an argument, create a new generation of PROFILE pointing to the directory of OS, switch to it atomically, and run OS's activation script." - (eval #~(primitive-load #$(switch-system-program os profile)))) + (eval #~(system* #$(switch-system-program os profile)))) ;;; @@ -176,10 +176,10 @@ services as defined by OS." (map live-service-canonical-name live-services))) (service-files (map shepherd-service-file target-services))) - (eval #~(primitive-load #$(upgrade-services-program service-files - to-start - to-unload - to-restart))))))) + (eval #~(system* #$(upgrade-services-program service-files + to-start + to-unload + to-restart))))))) ;;; @@ -252,9 +252,9 @@ additional configurations specified by MENU-ENTRIES can be selected." (package (bootloader-package bootloader)) (device (bootloader-configuration-target configuration)) (bootcfg-file (bootloader-configuration-file bootloader))) - (eval #~(primitive-load #$(install-bootloader-program installer - package - bootcfg - bootcfg-file - device - target))))) + (eval #~(system* #$(install-bootloader-program installer + package + bootcfg + bootcfg-file + device + target))))) -- cgit v1.2.3 From 00a1ebb84a5664cae1fbe0a0845d65c99d9907f1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Apr 2020 10:26:54 +0200 Subject: Revert "reconfigure: Run the effect scripts as separate processes." This reverts commit 5517750344be05c91bc2979c1a0e2348a9ae902d. That commit would remove all sorts of error checking when running those programs. --- guix/scripts/system/reconfigure.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 21b472e0c5..c8d1ed4a51 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -100,7 +100,7 @@ atomically, and run OS's activation script." "Using EVAL, a monadic procedure taking a single G-Expression as an argument, create a new generation of PROFILE pointing to the directory of OS, switch to it atomically, and run OS's activation script." - (eval #~(system* #$(switch-system-program os profile)))) + (eval #~(primitive-load #$(switch-system-program os profile)))) ;;; @@ -176,10 +176,10 @@ services as defined by OS." (map live-service-canonical-name live-services))) (service-files (map shepherd-service-file target-services))) - (eval #~(system* #$(upgrade-services-program service-files - to-start - to-unload - to-restart))))))) + (eval #~(primitive-load #$(upgrade-services-program service-files + to-start + to-unload + to-restart))))))) ;;; @@ -252,9 +252,9 @@ additional configurations specified by MENU-ENTRIES can be selected." (package (bootloader-package bootloader)) (device (bootloader-configuration-target configuration)) (bootcfg-file (bootloader-configuration-file bootloader))) - (eval #~(system* #$(install-bootloader-program installer - package - bootcfg - bootcfg-file - device - target))))) + (eval #~(primitive-load #$(install-bootloader-program installer + package + bootcfg + bootcfg-file + device + target))))) -- cgit v1.2.3 From 9fb3ff31c15f36545bad11c1d9b11eaf0333f831 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Apr 2020 10:48:32 +0200 Subject: reconfigure: Silence Guile warnings. Fixes . Reported by strypsteen@posteo.net. * guix/scripts/system/reconfigure.scm (switch-to-system) (upgrade-shepherd-services, install-bootloader): Wrap 'primitive-load' call in 'parameterize'. --- guix/scripts/system/reconfigure.scm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index c8d1ed4a51..074c48f58b 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -100,7 +100,8 @@ atomically, and run OS's activation script." "Using EVAL, a monadic procedure taking a single G-Expression as an argument, create a new generation of PROFILE pointing to the directory of OS, switch to it atomically, and run OS's activation script." - (eval #~(primitive-load #$(switch-system-program os profile)))) + (eval #~(parameterize ((current-warning-port (%make-void-port "w"))) + (primitive-load #$(switch-system-program os profile))))) ;;; @@ -176,10 +177,11 @@ services as defined by OS." (map live-service-canonical-name live-services))) (service-files (map shepherd-service-file target-services))) - (eval #~(primitive-load #$(upgrade-services-program service-files - to-start - to-unload - to-restart))))))) + (eval #~(parameterize ((current-warning-port (%make-void-port "w"))) + (primitive-load #$(upgrade-services-program service-files + to-start + to-unload + to-restart)))))))) ;;; @@ -252,9 +254,10 @@ additional configurations specified by MENU-ENTRIES can be selected." (package (bootloader-package bootloader)) (device (bootloader-configuration-target configuration)) (bootcfg-file (bootloader-configuration-file bootloader))) - (eval #~(primitive-load #$(install-bootloader-program installer - package - bootcfg - bootcfg-file - device - target))))) + (eval #~(parameterize ((current-warning-port (%make-void-port "w"))) + (primitive-load #$(install-bootloader-program installer + package + bootcfg + bootcfg-file + device + target)))))) -- cgit v1.2.3 From 4efbb079b5aac6a4eb53ef3f9a67a2849c3ebf1f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Apr 2020 11:22:46 +0200 Subject: guix system: Remove unused procedure. This procedure was unused since 5c8c8c455420af27189d6045b3599fe6e27ad012. * guix/scripts/system.scm (call-with-service-upgrade-info): Remove. --- guix/scripts/system.scm | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 4937e68115..b87f2bdd3b 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -290,22 +290,6 @@ on service '~a':~%") ((not error) ;not an error #t))) -(define (call-with-service-upgrade-info new-services mproc) - "Call MPROC, a monadic procedure in %STORE-MONAD, passing it the list of -names of services to load (upgrade), and the list of names of services to -unload." - (match (current-services) - ((services ...) - (let-values (((to-unload to-restart) - (shepherd-service-upgrade services new-services))) - (mproc to-restart - (map (compose first live-service-provision) - to-unload)))) - (#f - (with-monad %store-monad - (warning (G_ "failed to obtain list of shepherd services~%")) - (return #f))))) - (define-syntax-rule (unless-file-not-found exp) (catch 'system-error (lambda () @@ -1294,7 +1278,6 @@ argument list and OPTS is the option alist." (process-command command args opts)))))) ;;; Local Variables: -;;; eval: (put 'call-with-service-upgrade-info 'scheme-indent-function 1) ;;; eval: (put 'with-store* 'scheme-indent-function 1) ;;; End: -- cgit v1.2.3 From 73bfb14f8ff105bbc8a8836f475f72867297fe93 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Apr 2020 11:42:01 +0200 Subject: guix system: Mention 'herd restart' when reconfigure completes. * guix/scripts/system.scm (with-shepherd-error-handling): Use 'mbegin' instead of 'begin'. (perform-action): Print a message after 'upgrade-shepherd-services'. That message had disappeared in commit 5c8c8c455420af27189d6045b3599fe6e27ad012. --- guix/scripts/system.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index b87f2bdd3b..2664c66a30 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -258,7 +258,7 @@ expression in %STORE-MONAD." (lambda () (guard (c ((shepherd-error? c) (values (report-shepherd-error c) store))) - (values (run-with-store store (begin mbody ...)) + (values (run-with-store store (mbegin %store-monad mbody ...)) store))) (lambda (key proc format-string format-args errno . rest) (warning (G_ "while talking to shepherd: ~a~%") @@ -837,7 +837,10 @@ static checks." (info (G_ "bootloader successfully installed on '~a'~%") (bootloader-configuration-target bootloader)))) (with-shepherd-error-handling - (upgrade-shepherd-services local-eval os)))) + (upgrade-shepherd-services local-eval os) + (return (format #t (G_ "\ +To complete the upgrade, run 'herd restart SERVICE' to stop, +upgrade, and restart each service that was not automatically restarted.\n")))))) ((init) (newline) (format #t (G_ "initializing operating system under '~a'...~%") -- cgit v1.2.3 From f7b5b8cd45b4560b3473dde2e6f6f20b4ff9daff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Apr 2020 21:51:12 +0200 Subject: pack: Pass the cross-compilation target to 'run-with-store'. This ensures '%current-target-system' is correctly bound upfront, which some packages rely on. * guix/scripts/pack.scm (guix-pack): Pass #:target to 'run-with-store'. --- guix/scripts/pack.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'guix/scripts') diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index f641f535b9..6d63fb4b90 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1128,4 +1128,5 @@ to your package list."))) gc-root)) (return (format #t "~a~%" (derivation->output-path drv)))))) + #:target target #:system (assoc-ref opts 'system))))))))) -- cgit v1.2.3 From 93add9bf7d73b6a6ed2d0cf85778b26aa38fd194 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 7 Apr 2020 23:31:41 +0200 Subject: reconfigure: Correctly re-throw SRFI-34 exceptions on Guile 3. Previously, we'd just print an ugly backtrace when running on Guile 3 because the '%exception throw would not be caught anywhere. Reported by Arne Babenhauserheide in . * guix/scripts/system/reconfigure.scm (install-bootloader-program): In 'catch' handler, match '%exception and use 'raise-exception' instead of 'throw' to rethrow in that case. --- guix/scripts/system/reconfigure.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 074c48f58b..7885c33457 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -211,6 +211,7 @@ BOOTLOADER-PACKAGE." (guix store) (guix utils) (ice-9 binary-ports) + (ice-9 match) (srfi srfi-34) (srfi srfi-35)) @@ -235,7 +236,11 @@ BOOTLOADER-PACKAGE." (#$installer #$bootloader-package #$device #$target)) (lambda args (delete-file new-gc-root) - (apply throw args)))) + (match args + (('%exception exception) ;Guile 3 SRFI-34 or similar + (raise-exception exception)) + ((key . args) + (apply throw key args)))))) ;; We are sure that the installation of the bootloader ;; succeeded, so we can replace the old GC root by the new ;; GC root now. -- cgit v1.2.3