1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 18:40:57 +02:00

guix build: Avoid “could not determine …” warning when unnecessary.

This is a followup to 0629af7c2a.

* 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
This commit is contained in:
Ludovic Courtès 2024-10-14 23:17:50 +02:00
parent 943b38a0c3
commit 40a0b440ba
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -760,15 +760,6 @@ needed."
(%graft? graft?)) (%graft? graft?))
(let* ((mode (assoc-ref opts 'build-mode)) (let* ((mode (assoc-ref opts 'build-mode))
(drv (options->derivations store opts)) (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 (items (filter-map (match-lambda
(('argument . (? store-path? file)) (('argument . (? store-path? file))
;; If FILE is a .drv that's not in ;; 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 ;; 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
;; derivations leading to the same output. ;; derivations leading to the same output.
(for-each (cut show-build-log store <> urls) (let ((urls (map (cut string-append <> "/log")
(delete-duplicates (if (assoc-ref opts 'substitutes?)
(append (map derivation->output-path drv) (or (assoc-ref opts 'substitute-urls)
items)))) (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?) ((assoc-ref opts 'derivations-only?)
(format #t "~{~a~%~}" (map derivation-file-name drv)) (format #t "~{~a~%~}" (map derivation-file-name drv))
(for-each (cut register-root store <> <>) (for-each (cut register-root store <> <>)