mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
inferior: 'cached-channel-instance' no longer calls 'show-what-to-build'.
This allows the user of 'cached-channel-instance' to install the build handler of its choice. In particular, it allows "guix time-machine" to install a build notifier with the right options instead of using the defaults that 'cached-channel-instance' would pass to 'show-what-to-build*'. * guix/inferior.scm (cached-channel-instance): Remove call to 'show-what-to-build*'. (inferior-for-channels): Wrap body in 'with-build-handler'. * guix/scripts/time-machine.scm (guix-time-machine): Use 'with-build-handler'.
This commit is contained in:
parent
27f00963d3
commit
7bd5f72918
2 changed files with 22 additions and 10 deletions
|
@ -48,7 +48,7 @@
|
||||||
#:use-module (gcrypt hash)
|
#:use-module (gcrypt hash)
|
||||||
#:autoload (guix cache) (maybe-remove-expired-cache-entries
|
#:autoload (guix cache) (maybe-remove-expired-cache-entries
|
||||||
file-expiration-time)
|
file-expiration-time)
|
||||||
#:autoload (guix ui) (show-what-to-build*)
|
#:autoload (guix ui) (build-notifier)
|
||||||
#:autoload (guix build utils) (mkdir-p)
|
#:autoload (guix build utils) (mkdir-p)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
|
@ -801,8 +801,10 @@ determines whether CHANNELS are authenticated."
|
||||||
(profile
|
(profile
|
||||||
(channel-instances->derivation instances)))
|
(channel-instances->derivation instances)))
|
||||||
(mbegin %store-monad
|
(mbegin %store-monad
|
||||||
(show-what-to-build* (list profile))
|
;; It's up to the caller to install a build handler to report
|
||||||
|
;; what's going to be built.
|
||||||
(built-derivations (list profile))
|
(built-derivations (list profile))
|
||||||
|
|
||||||
;; Note: Caching is fine even when AUTHENTICATE? is false because
|
;; Note: Caching is fine even when AUTHENTICATE? is false because
|
||||||
;; we always call 'latest-channel-instances?'.
|
;; we always call 'latest-channel-instances?'.
|
||||||
(symlink* (derivation->output-path profile) cached)
|
(symlink* (derivation->output-path profile) cached)
|
||||||
|
@ -821,10 +823,14 @@ This is a convenience procedure that people may use in manifests passed to
|
||||||
'guix package -m', for instance."
|
'guix package -m', for instance."
|
||||||
(define cached
|
(define cached
|
||||||
(with-store store
|
(with-store store
|
||||||
(cached-channel-instance store
|
;; XXX: Install a build notifier out of convenience, so users know
|
||||||
channels
|
;; what's going on. However, we cannot be sure that its options, such
|
||||||
#:cache-directory cache-directory
|
;; as #:use-substitutes?, correspond to the daemon's default settings.
|
||||||
#:ttl ttl)))
|
(with-build-handler (build-notifier)
|
||||||
|
(cached-channel-instance store
|
||||||
|
channels
|
||||||
|
#:cache-directory cache-directory
|
||||||
|
#:ttl ttl))))
|
||||||
(open-inferior cached))
|
(open-inferior cached))
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2019 Konrad Hinsen <konrad.hinsen@fastmail.net>
|
;;; Copyright © 2019 Konrad Hinsen <konrad.hinsen@fastmail.net>
|
||||||
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
|
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
|
@ -141,13 +141,19 @@ Execute COMMAND ARGS... in an older version of Guix.\n"))
|
||||||
(let* ((opts (parse-args args))
|
(let* ((opts (parse-args args))
|
||||||
(channels (channel-list opts))
|
(channels (channel-list opts))
|
||||||
(command-line (assoc-ref opts 'exec))
|
(command-line (assoc-ref opts 'exec))
|
||||||
|
(substitutes? (assoc-ref opts 'substitutes?))
|
||||||
(authenticate? (assoc-ref opts 'authenticate-channels?)))
|
(authenticate? (assoc-ref opts 'authenticate-channels?)))
|
||||||
(when command-line
|
(when command-line
|
||||||
(let* ((directory
|
(let* ((directory
|
||||||
(with-store store
|
(with-store store
|
||||||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||||
(set-build-options-from-command-line store opts)
|
(with-build-handler (build-notifier #:use-substitutes?
|
||||||
(cached-channel-instance store channels
|
substitutes?
|
||||||
#:authenticate? authenticate?))))
|
#:verbosity
|
||||||
|
(assoc-ref opts 'verbosity)
|
||||||
|
#:dry-run? #f)
|
||||||
|
(set-build-options-from-command-line store opts)
|
||||||
|
(cached-channel-instance store channels
|
||||||
|
#:authenticate? authenticate?)))))
|
||||||
(executable (string-append directory "/bin/guix")))
|
(executable (string-append directory "/bin/guix")))
|
||||||
(apply execl (cons* executable executable command-line))))))))
|
(apply execl (cons* executable executable command-line))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue