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

View file

@ -935,9 +935,12 @@ (define opts
#:mode mode))
(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)
(delete-duplicates
(append (map derivation-file-name drv)
(append (map derivation->output-path drv)
items))))
((assoc-ref opts 'derivations-only?)
(format #t "~{~a~%~}" (map derivation-file-name drv))