diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index ee7e5b958c5d1026f5cc6288f53982ca207103cd..644ffe8d6ec0f11ebbcd55ff6000444a8cbf612f 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -185,8 +185,7 @@ (define (set-build-options-from-command-line store opts) #:max-build-jobs (or (assoc-ref opts 'max-jobs) 1) #:fallback? (assoc-ref opts 'fallback?) #:use-substitutes? (assoc-ref opts 'substitutes?) - #:substitute-urls (or (assoc-ref opts 'substitute-urls) - %default-substitute-urls) + #:substitute-urls (assoc-ref opts 'substitute-urls) #:use-build-hook? (assoc-ref opts 'build-hook?) #:max-silent-time (assoc-ref opts 'max-silent-time) #:timeout (assoc-ref opts 'timeout) @@ -512,6 +511,8 @@ (define (guix-build . args) (urls (map (cut string-append <> "/log") (if (assoc-ref opts 'substitutes?) (or (assoc-ref opts 'substitute-urls) + ;; XXX: This does not necessarily match the + ;; daemon's substitute URLs. %default-substitute-urls) '()))) (roots (filter-map (match-lambda diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 44ff92655bd693c48864d2abf40ce5ec82972436..e999cce1fddb28b846120b841980c6f80522c17f 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -252,8 +252,7 @@ (define %options (show-version-and-exit "guix size"))))) (define %default-options - `((system . ,(%current-system)) - (substitute-urls . ,%default-substitute-urls))) + `((system . ,(%current-system)))) ;;; diff --git a/guix/store.scm b/guix/store.scm index c4e357371146e0c0b9cc2841e07a1d4f0cf1e81f..8413d1f4523f4d40e93c9208ffe77cf3c5d60b0b 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -501,11 +501,11 @@ (define* (set-build-options server (build-cores (current-processor-count)) (use-substitutes? #t) - ;; Client-provided substitute URLs. For - ;; unprivileged clients, these are considered - ;; "untrusted"; for "trusted" users, they override - ;; the daemon's settings. - (substitute-urls %default-substitute-urls)) + ;; Client-provided substitute URLs. If it is #f, + ;; the daemon's settings are used. Otherwise, it + ;; overrides the daemons settings; see 'guix + ;; substitute'. + (substitute-urls #f)) ;; Must be called after `open-connection'. (define socket @@ -533,7 +533,10 @@ (define socket (let ((pairs `(,@(if timeout `(("build-timeout" . ,(number->string timeout))) '()) - ("substitute-urls" . ,(string-join substitute-urls))))) + ,@(if substitute-urls + `(("substitute-urls" + . ,(string-join substitute-urls))) + '())))) (send (string-pairs pairs)))) (let loop ((done? (process-stderr server))) (or done? (process-stderr server)))))