guix build: '--log-file' looks for build logs of equivalent derivations.

Previously, '--log-file' would look for log files only for the current
derivation, and thus wouldn't find log files of equivalent derivations
that produce the same output.

* guix/scripts/build.scm (guix-build) <log-file?>: Replace
'derivation-file-name' by 'derivation->output-path'.
This commit is contained in:
Ludovic Courtès 2019-06-18 09:50:38 +02:00
parent 5c7f87881a
commit 9353b199c1
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 4 additions and 1 deletions

View File

@ -935,9 +935,12 @@ needed."
#:mode mode)) #:mode mode))
(cond ((assoc-ref opts 'log-file?) (cond ((assoc-ref opts 'log-file?)
;; Pass 'show-build-log' the output file names, not the
;; derivation file names, because there can be several
;; derivations leading to the same output.
(for-each (cut show-build-log store <> urls) (for-each (cut show-build-log store <> urls)
(delete-duplicates (delete-duplicates
(append (map derivation-file-name drv) (append (map derivation->output-path drv)
items)))) items))))
((assoc-ref opts 'derivations-only?) ((assoc-ref opts 'derivations-only?)
(format #t "~{~a~%~}" (map derivation-file-name drv)) (format #t "~{~a~%~}" (map derivation-file-name drv))