From e36a71721630a827a094ad07f250eada16d1f674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 2 Jul 2012 00:45:23 +0200 Subject: [PATCH] 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. --- guix/store.scm | 7 +++++-- 1 file 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 @@ (define-module (guix store) 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 @@ (define-condition-type &nix-protocol-error &nix-error (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 @@ (define* (open-connection #:optional (file %default-socket-path)) (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))))