environment: Use 'with-build-handler'.
* guix/scripts/environment.scm (build-environment): Remove. (guix-environment): Wrap 'with-status-verbosity' in 'with-build-handler'. Remove 'dry-run?' conditional. Use 'built-derivations' instead of 'build-environment'.master
parent
2d5ee2c6e8
commit
c74f19d758
|
@ -1,6 +1,6 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015, 2018 David Thompson <davet@gnu.org>
|
||||
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018 Mike Gerwitz <mtg@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
|
@ -364,19 +364,6 @@ for the corresponding packages."
|
|||
opts)
|
||||
manifest-entry=?)))
|
||||
|
||||
(define* (build-environment derivations opts)
|
||||
"Build the DERIVATIONS required by the environment using the build options
|
||||
in OPTS."
|
||||
(let ((substitutes? (assoc-ref opts 'substitutes?))
|
||||
(dry-run? (assoc-ref opts 'dry-run?)))
|
||||
(mbegin %store-monad
|
||||
(show-what-to-build* derivations
|
||||
#:use-substitutes? substitutes?
|
||||
#:dry-run? dry-run?)
|
||||
(if dry-run?
|
||||
(return #f)
|
||||
(built-derivations derivations)))))
|
||||
|
||||
(define (manifest->derivation manifest system bootstrap?)
|
||||
"Return the derivation for a profile of MANIFEST.
|
||||
BOOTSTRAP? specifies whether to use the bootstrap Guile to build the profile."
|
||||
|
@ -720,6 +707,10 @@ message if any test fails."
|
|||
|
||||
|
||||
(with-store store
|
||||
(with-build-handler (build-notifier #:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?)
|
||||
#:dry-run?
|
||||
(assoc-ref opts 'dry-run?))
|
||||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||
(define manifest
|
||||
(options/resolve-packages store opts))
|
||||
|
@ -748,16 +739,13 @@ message if any test fails."
|
|||
;; --search-paths. Additionally, we might need to build bash for
|
||||
;; a container.
|
||||
(mbegin %store-monad
|
||||
(build-environment (if (derivation? bash)
|
||||
(built-derivations (if (derivation? bash)
|
||||
(list prof-drv bash)
|
||||
(list prof-drv))
|
||||
opts)
|
||||
(list prof-drv)))
|
||||
(mwhen gc-root
|
||||
(register-gc-root profile gc-root))
|
||||
|
||||
(cond
|
||||
((assoc-ref opts 'dry-run?)
|
||||
(return #t))
|
||||
((assoc-ref opts 'search-paths)
|
||||
(show-search-paths profile manifest #:pure? pure?)
|
||||
(return #t))
|
||||
|
@ -783,4 +771,4 @@ message if any test fails."
|
|||
(exit/status
|
||||
(launch-environment/fork command profile manifest
|
||||
#:white-list white-list
|
||||
#:pure? pure?))))))))))))))
|
||||
#:pure? pure?)))))))))))))))
|
||||
|
|
Reference in New Issue