diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-07-02 00:45:23 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-07-02 01:35:39 +0200 |
commit | e36a71721630a827a094ad07f250eada16d1f674 (patch) | |
tree | 214e5541436995e656dfffc29d44ff7b6e70971d | |
parent | 561eaf7144755716ed65ba5ceb73d1672695050a (diff) | |
download | guix-e36a71721630a827a094ad07f250eada16d1f674.tar.gz |
Upgrade Nix worker protocol.
We were already relying on the new version in `set-build-options', so this patch fixes that. * guix/store.scm (%protocol-version): Increase. (open-connection)[reserve-space?]: New argument. Pass it to the server when it's recent enough.
-rw-r--r-- | guix/store.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/store.scm b/guix/store.scm index b525994672..bd7bb59f89 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -53,7 +53,7 @@ store-path? derivation-path?)) -(define %protocol-version #x109) +(define %protocol-version #x10b) (define %worker-magic-1 #x6e697863) (define %worker-magic-2 #x6478696f) @@ -257,7 +257,8 @@ (message nix-protocol-error-message) (status nix-protocol-error-status)) -(define* (open-connection #:optional (file %default-socket-path)) +(define* (open-connection #:optional (file %default-socket-path) + #:key (reserve-space? #t)) (let ((s (with-fluids ((%default-port-encoding #f)) ;; This trick allows use of the `scm_c_read' optimization. (socket PF_UNIX SOCK_STREAM 0))) @@ -271,6 +272,8 @@ (protocol-major v)) (begin (write-int %protocol-version s) + (if (>= (protocol-minor v) 11) + (write-int (if reserve-space? 1 0) s)) (let ((s (%make-nix-server s (protocol-major v) (protocol-minor v)))) |