diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-10-28 15:20:06 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-28 15:31:44 +0100 |
| commit | fb4bf72be3fbc23bca35ba4b842b7e1517ef0e3a (patch) | |
| tree | 4d6cb0a5bf3d97222d8697976f1cc4b42c321d2c | |
| parent | 34a1783fc1498d7150210da22dd7804d288438b3 (diff) | |
store: Use the daemon's substitute URLs by default.
Partly fixes <http://bugs.gnu.org/20217>.
* guix/store.scm (set-build-options): Change #:substitute-urls to
default to #f. Send the 'substitute-urls' pair only if
SUBSTITUTE-URLS is true.
* guix/scripts/build.scm (set-build-options-from-command-line): Do not
default to %DEFAULT-SUBSTITUTE-URLS for #:substitute-urls.
* guix/scripts/size.scm (%default-options): Remove 'substitute-urls'.
| -rw-r--r-- | guix/scripts/build.scm | 5 | ||||
| -rw-r--r-- | guix/scripts/size.scm | 3 | ||||
| -rw-r--r-- | guix/store.scm | 15 |
3 files changed, 13 insertions, 10 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index ee7e5b958c5..644ffe8d6ec 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm | |||
| @@ -185,8 +185,7 @@ options handled by 'set-build-options-from-command-line', and listed in | |||
| 185 | #:max-build-jobs (or (assoc-ref opts 'max-jobs) 1) | 185 | #:max-build-jobs (or (assoc-ref opts 'max-jobs) 1) |
| 186 | #:fallback? (assoc-ref opts 'fallback?) | 186 | #:fallback? (assoc-ref opts 'fallback?) |
| 187 | #:use-substitutes? (assoc-ref opts 'substitutes?) | 187 | #:use-substitutes? (assoc-ref opts 'substitutes?) |
| 188 | #:substitute-urls (or (assoc-ref opts 'substitute-urls) | 188 | #:substitute-urls (assoc-ref opts 'substitute-urls) |
| 189 | %default-substitute-urls) | ||
| 190 | #:use-build-hook? (assoc-ref opts 'build-hook?) | 189 | #:use-build-hook? (assoc-ref opts 'build-hook?) |
| 191 | #:max-silent-time (assoc-ref opts 'max-silent-time) | 190 | #:max-silent-time (assoc-ref opts 'max-silent-time) |
| 192 | #:timeout (assoc-ref opts 'timeout) | 191 | #:timeout (assoc-ref opts 'timeout) |
| @@ -512,6 +511,8 @@ arguments with packages that use the specified source." | |||
| 512 | (urls (map (cut string-append <> "/log") | 511 | (urls (map (cut string-append <> "/log") |
| 513 | (if (assoc-ref opts 'substitutes?) | 512 | (if (assoc-ref opts 'substitutes?) |
| 514 | (or (assoc-ref opts 'substitute-urls) | 513 | (or (assoc-ref opts 'substitute-urls) |
| 514 | ;; XXX: This does not necessarily match the | ||
| 515 | ;; daemon's substitute URLs. | ||
| 515 | %default-substitute-urls) | 516 | %default-substitute-urls) |
| 516 | '()))) | 517 | '()))) |
| 517 | (roots (filter-map (match-lambda | 518 | (roots (filter-map (match-lambda |
diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 44ff92655bd..e999cce1fdd 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm | |||
| @@ -252,8 +252,7 @@ Report the size of PACKAGE and its dependencies.\n")) | |||
| 252 | (show-version-and-exit "guix size"))))) | 252 | (show-version-and-exit "guix size"))))) |
| 253 | 253 | ||
| 254 | (define %default-options | 254 | (define %default-options |
| 255 | `((system . ,(%current-system)) | 255 | `((system . ,(%current-system)))) |
| 256 | (substitute-urls . ,%default-substitute-urls))) | ||
| 257 | 256 | ||
| 258 | 257 | ||
| 259 | ;;; | 258 | ;;; |
diff --git a/guix/store.scm b/guix/store.scm index c4e35737114..8413d1f4523 100644 --- a/guix/store.scm +++ b/guix/store.scm | |||
| @@ -501,11 +501,11 @@ encoding conversion errors." | |||
| 501 | (build-cores (current-processor-count)) | 501 | (build-cores (current-processor-count)) |
| 502 | (use-substitutes? #t) | 502 | (use-substitutes? #t) |
| 503 | 503 | ||
| 504 | ;; Client-provided substitute URLs. For | 504 | ;; Client-provided substitute URLs. If it is #f, |
| 505 | ;; unprivileged clients, these are considered | 505 | ;; the daemon's settings are used. Otherwise, it |
| 506 | ;; "untrusted"; for "trusted" users, they override | 506 | ;; overrides the daemons settings; see 'guix |
| 507 | ;; the daemon's settings. | 507 | ;; substitute'. |
| 508 | (substitute-urls %default-substitute-urls)) | 508 | (substitute-urls #f)) |
| 509 | ;; Must be called after `open-connection'. | 509 | ;; Must be called after `open-connection'. |
| 510 | 510 | ||
| 511 | (define socket | 511 | (define socket |
| @@ -533,7 +533,10 @@ encoding conversion errors." | |||
| 533 | (let ((pairs `(,@(if timeout | 533 | (let ((pairs `(,@(if timeout |
| 534 | `(("build-timeout" . ,(number->string timeout))) | 534 | `(("build-timeout" . ,(number->string timeout))) |
| 535 | '()) | 535 | '()) |
| 536 | ("substitute-urls" . ,(string-join substitute-urls))))) | 536 | ,@(if substitute-urls |
| 537 | `(("substitute-urls" | ||
| 538 | . ,(string-join substitute-urls))) | ||
| 539 | '())))) | ||
| 537 | (send (string-pairs pairs)))) | 540 | (send (string-pairs pairs)))) |
| 538 | (let loop ((done? (process-stderr server))) | 541 | (let loop ((done? (process-stderr server))) |
| 539 | (or done? (process-stderr server))))) | 542 | (or done? (process-stderr server))))) |
