summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-02-03 23:02:14 +0100
committerLudovic Courtès <ludo@gnu.org>2013-02-04 08:58:48 +0100
commit63193ebfdc72eb11cfb1c50b8cd5dfc49d01361d (patch)
treed84c4324d18281290c74398af91401cf45404f22
parentc5a855c481fd9d9c9f712a38610fcdbee1ed25d4 (diff)
downloadguix-63193ebfdc72eb11cfb1c50b8cd5dfc49d01361d.tar.gz
store: Update to protocol 1.12.
* guix/store.scm (%protocol-version): Bump.
  (operation-id): Comment out `query-substitutable-path-info'.
  Rename `query-valid-paths' to `query-all-valid-paths'.  Add
  `query-path-from-hash-part', `query-substitutable-path-infos',
  `query-valid-paths', and `query-substitutable-paths'.
  (set-build-options): Add `binary-caches' keyword parameter.  When
  using a server >= 1.12, send the list of binary caches.
  (query-path-hash): Use the `store-path' type, for clarity.
-rw-r--r--guix/store.scm24
1 files changed, 18 insertions, 6 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 4bb2270a59..0a6285deac 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -66,7 +66,7 @@
             derivation-path?
             store-path-package-name))
 
-(define %protocol-version #x10b)
+(define %protocol-version #x10c)
 
 (define %worker-magic-1 #x6e697863)
 (define %worker-magic-2 #x6478696f)
@@ -103,14 +103,18 @@
   (query-deriver 18)
   (set-options 19)
   (collect-garbage 20)
-  (query-substitutable-path-info 21)
+  ;;(query-substitutable-path-info 21)  ; obsolete as of #x10c
   (query-derivation-outputs 22)
-  (query-valid-paths 23)
+  (query-all-valid-paths 23)
   (query-failed-paths 24)
   (clear-failed-paths 25)
   (query-path-info 26)
   (import-paths 27)
-  (query-derivation-output-names 28))
+  (query-derivation-output-names 28)
+  (query-path-from-hash-part 29)
+  (query-substitutable-path-infos 30)
+  (query-valid-paths 31)
+  (query-substitutable-paths 32))
 
 (define-enumerate-type hash-algo
   ;; hash.hh
@@ -423,7 +427,8 @@ encoding conversion errors."
                             (log-type 0)
                             (print-build-trace #t)
                             (build-cores 1)
-                            (use-substitutes? #t))
+                            (use-substitutes? #t)
+                            (binary-caches '())) ; client "untrusted" cache URLs
   ;; Must be called after `open-connection'.
 
   (define socket
@@ -447,6 +452,13 @@ encoding conversion errors."
         (send (integer build-cores)))
     (if (>= (nix-server-minor-version server) 10)
         (send (boolean use-substitutes?)))
+    (if (>= (nix-server-minor-version server) 12)
+        (send (string-list (fold-right (lambda (pair result)
+                                         (match pair
+                                           ((h . t)
+                                            (cons* h t result))))
+                                       '()
+                                       binary-caches))))
     (let loop ((done? (process-stderr server)))
       (or done? (process-stderr server)))))
 
@@ -474,7 +486,7 @@ encoding conversion errors."
   "Return #t when PATH is a valid store path."
   boolean)
 
-(define-operation (query-path-hash (string path))
+(define-operation (query-path-hash (store-path path))
   "Return the SHA256 hash of PATH as a bytevector."
   base16)