guix build: Use 'with-build-handler'.
Fixes <https://bugs.gnu.org/28310>. Reported by Andreas Enge <andreas@enge.fr>. * guix/scripts/build.scm (guix-build): Wrap 'parameterize' in 'with-build-handler'. Remove explicit call to 'show-what-to-build'. Call 'build-derivations' regardless of whether OPTS contains 'dry-run?'.
This commit is contained in:
parent
07ce23e011
commit
62195b9a8f
1 changed files with 55 additions and 59 deletions
|
@ -952,6 +952,10 @@ needed."
|
||||||
;; Set the build options before we do anything else.
|
;; Set the build options before we do anything else.
|
||||||
(set-build-options-from-command-line store opts)
|
(set-build-options-from-command-line store opts)
|
||||||
|
|
||||||
|
(with-build-handler (build-notifier #:use-substitutes?
|
||||||
|
(assoc-ref opts 'substitutes?)
|
||||||
|
#:dry-run?
|
||||||
|
(assoc-ref opts 'dry-run?))
|
||||||
(parameterize ((current-terminal-columns (terminal-columns))
|
(parameterize ((current-terminal-columns (terminal-columns))
|
||||||
|
|
||||||
;; Set grafting upfront in case the user's input
|
;; Set grafting upfront in case the user's input
|
||||||
|
@ -982,14 +986,6 @@ needed."
|
||||||
(_ #f))
|
(_ #f))
|
||||||
opts)))
|
opts)))
|
||||||
|
|
||||||
(unless (or (assoc-ref opts 'log-file?)
|
|
||||||
(assoc-ref opts 'derivations-only?))
|
|
||||||
(show-what-to-build store drv
|
|
||||||
#:use-substitutes?
|
|
||||||
(assoc-ref opts 'substitutes?)
|
|
||||||
#:dry-run? (assoc-ref opts 'dry-run?)
|
|
||||||
#:mode mode))
|
|
||||||
|
|
||||||
(cond ((assoc-ref opts 'log-file?)
|
(cond ((assoc-ref opts 'log-file?)
|
||||||
;; Pass 'show-build-log' the output file names, not the
|
;; Pass 'show-build-log' the output file names, not the
|
||||||
;; derivation file names, because there can be several
|
;; derivation file names, because there can be several
|
||||||
|
@ -1003,7 +999,7 @@ needed."
|
||||||
(for-each (cut register-root store <> <>)
|
(for-each (cut register-root store <> <>)
|
||||||
(map (compose list derivation-file-name) drv)
|
(map (compose list derivation-file-name) drv)
|
||||||
roots))
|
roots))
|
||||||
((not (assoc-ref opts 'dry-run?))
|
(else
|
||||||
(and (build-derivations store (append drv items)
|
(and (build-derivations store (append drv items)
|
||||||
mode)
|
mode)
|
||||||
(for-each show-derivation-outputs drv)
|
(for-each show-derivation-outputs drv)
|
||||||
|
@ -1012,4 +1008,4 @@ needed."
|
||||||
(map cdr
|
(map cdr
|
||||||
(derivation->output-paths drv)))
|
(derivation->output-paths drv)))
|
||||||
drv)
|
drv)
|
||||||
roots))))))))))
|
roots)))))))))))
|
||||||
|
|
Reference in a new issue