diff options
author | Ludovic Courtès <ludo@gnu.org> | 2024-10-14 23:17:50 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-10-15 18:40:08 +0200 |
commit | 40a0b440ba7aef484572d3ee63a6b51e938a0a0b (patch) | |
tree | 577f1c2f23d8f6203154fc91364a6b55e7475b73 | |
parent | 943b38a0c3fcc835e0037c0c2af466c053c63dd3 (diff) | |
download | guix-40a0b440ba7aef484572d3ee63a6b51e938a0a0b.tar.gz guix-40a0b440ba7aef484572d3ee63a6b51e938a0a0b.zip |
guix build: Avoid “could not determine …” warning when unnecessary.
This is a followup to 0629af7c2a47171fe8699b4d45662e605fea2fa6.
* guix/scripts/build.scm (guix-build): Move ‘urls’ definition
to (assoc-ref opts 'log-file?) case so that the “could not determine
current substitute URLs” warning is not displayed when ‘urls’ is unused.
Change-Id: I9434621b00a80bdbcf54d2a46d1a1e5f49cc7669
-rw-r--r-- | guix/scripts/build.scm | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index b010414d53..9e05bb532b 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -760,15 +760,6 @@ needed." (%graft? graft?)) (let* ((mode (assoc-ref opts 'build-mode)) (drv (options->derivations store opts)) - (urls (map (cut string-append <> "/log") - (if (assoc-ref opts 'substitutes?) - (or (assoc-ref opts 'substitute-urls) - (substitute-urls store) - (begin - (warning (G_ "could not determine current \ -substitute URLs; using defaults~%")) - %default-substitute-urls)) - '()))) (items (filter-map (match-lambda (('argument . (? store-path? file)) ;; If FILE is a .drv that's not in @@ -791,10 +782,19 @@ substitute URLs; using defaults~%")) ;; 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->output-path drv) - items)))) + (let ((urls (map (cut string-append <> "/log") + (if (assoc-ref opts 'substitutes?) + (or (assoc-ref opts 'substitute-urls) + (substitute-urls store) + (begin + (warning (G_ "\ +could not determine current substitute URLs; using defaults~%")) + %default-substitute-urls)) + '())))) + (for-each (cut show-build-log store <> urls) + (delete-duplicates + (append (map derivation->output-path drv) + items))))) ((assoc-ref opts 'derivations-only?) (format #t "~{~a~%~}" (map derivation-file-name drv)) (for-each (cut register-root store <> <>) |