guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/06: guix build: Add '--substitute-urls' client option.


From: Ludovic Courtès
Subject: 05/06: guix build: Add '--substitute-urls' client option.
Date: Mon, 13 Jul 2015 17:29:27 +0000

civodul pushed a commit to branch master
in repository guix.

commit f8a8e0fe1653d4bd998a33f013ea2583b4a32a00
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jul 13 16:07:59 2015 +0200

    guix build: Add '--substitute-urls' client option.
    
    * guix/scripts/build.scm (%standard-build-options,
      show-build-options-help): Add --substitute-urls=URLS.
      (set-build-options-from-command-line): Honor it.
    * guix/store.scm (%default-substitute-urls): Make public.
    * doc/guix.texi (Substitutes): Add xref to the client --substitute-urls
      option.
      (Invoking guix build): Document it.
      (Invoking guix-daemon): Add 'daemon-substitute-urls' anchor.
---
 doc/guix.texi          |   20 +++++++++++++++++---
 guix/scripts/build.scm |   12 ++++++++++++
 guix/store.scm         |    1 +
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 454dde6..7b1d18a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -760,6 +760,7 @@ explicitly enable substitution @i{via} the 
@code{set-build-options}
 remote procedure call (@pxref{The Store}).
 
 @item address@hidden
address@hidden
 Consider @var{urls} the default whitespace-separated list of substitute
 source URLs.  When this option is omitted, @indicateurl{http://hydra.gnu.org}
 is used.
@@ -1434,9 +1435,12 @@ also result from derivation builds, can be available as 
substitutes.
 The @code{hydra.gnu.org} server is a front-end to a build farm that
 builds packages from the GNU distribution continuously for some
 architectures, and makes them available as substitutes.  This is the
-default source of substitutes; it can be overridden by passing
address@hidden the @code{--substitute-urls} option
-(@pxref{Invoking guix-daemon}).
+default source of substitutes; it can be overridden by passing the
address@hidden option either to @command{guix-daemon}
+(@pxref{daemon-substitute-urls,, @code{guix-daemon --substitute-urls}})
+or to client tools such as @command{guix package}
+(@pxref{client-substitute-urls,, client @option{--substitute-urls}
+option}).
 
 @cindex security
 @cindex digital signatures
@@ -3584,6 +3588,16 @@ Do not build the derivations.
 When substituting a pre-built binary fails, fall back to building
 packages locally.
 
address@hidden address@hidden
address@hidden
+Consider @var{urls} the whitespace-separated list of substitute source
+URLs, overriding the default list of URLs of @command{guix-daemon}
+(@pxref{daemon-substitute-urls,, @command{guix-daemon} URLs}).
+
+This means that substitutes may be downloaded from @var{urls}, provided
+they are signed by a key authorized by the system administrator
+(@pxref{Substitutes}).
+
 @item --no-substitutes
 Do not use substitutes for build products.  That is, always build things
 locally instead of allowing downloads of pre-built binaries
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 7fd05da..d593b5a 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -118,6 +118,9 @@ options handled by 'set-build-options-from-command-line', 
and listed in
   (display (_ "
       --no-substitutes   build instead of resorting to pre-built substitutes"))
   (display (_ "
+      --substitute-urls=URLS
+                         fetch substitute from URLS if they are authorized"))
+  (display (_ "
       --no-build-hook    do not attempt to offload builds via the build hook"))
   (display (_ "
       --max-silent-time=SECONDS
@@ -141,6 +144,8 @@ options handled by 'set-build-options-from-command-line', 
and listed in
                      #: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)
                      #:use-build-hook? (assoc-ref opts 'build-hook?)
                      #:max-silent-time (assoc-ref opts 'max-silent-time)
                      #:timeout (assoc-ref opts 'timeout)
@@ -177,6 +182,13 @@ options handled by 'set-build-options-from-command-line', 
and listed in
                          (alist-cons 'substitutes? #f
                                      (alist-delete 'substitutes? result))
                          rest)))
+        (option '("substitute-urls") #t #f
+                (lambda (opt name arg result . rest)
+                  (apply values
+                         (alist-cons 'substitute-urls
+                                     (string-tokenize arg)
+                                     (alist-delete 'substitute-urls result))
+                         rest)))
         (option '("no-build-hook") #f #f
                 (lambda (opt name arg result . rest)
                   (apply values
diff --git a/guix/store.scm b/guix/store.scm
index 39e5faf..132b8a3 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -37,6 +37,7 @@
   #:use-module (ice-9 popen)
   #:export (%daemon-socket-file
             %gc-roots-directory
+            %default-substitute-urls
 
             nix-server?
             nix-server-major-version



reply via email to

[Prev in Thread] Current Thread [Next in Thread]