From e036c31bc607ec1be8037294bdfd90723f3458a8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 1 Jul 2012 00:09:47 +0200 Subject: Add missing `set-build-options' parameters. * guix/store.scm (set-build-options)[build-cores, use-substitutes?]: New keyword parameters. [send]: Change to expect a type, and use `write-arg'. Send settings for BUILD-CORES and USE-SUBSTITUTES? when the server supports it. --- guix/store.scm | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'guix') diff --git a/guix/store.scm b/guix/store.scm index e00282ad8a..1ecb2cc359 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -331,30 +331,32 @@ again until #t is returned or an error is raised." (use-build-hook? #t) (build-verbosity 0) (log-type 0) - (print-build-trace #t)) + (print-build-trace #t) + (build-cores 1) + (use-substitutes? #t)) ;; Must be called after `open-connection'. (define socket (nix-server-socket server)) (let-syntax ((send (syntax-rules () - ((_ option ...) - (for-each (lambda (i) - (cond ((boolean? i) - (write-int (if i 1 0) socket)) - ((integer? i) - (write-int i socket)) - (else - (error "invalid build option" - i)))) - (list option ...)))))) - (send (operation-id set-options) - keep-failed? keep-going? try-fallback? verbosity - max-build-jobs max-silent-time) + ((_ (type option) ...) + (begin + (write-arg type option socket) + ...))))) + (write-int (operation-id set-options) socket) + (send (boolean keep-failed?) (boolean keep-going?) + (boolean try-fallback?) (integer verbosity) + (integer max-build-jobs) (integer max-silent-time)) (if (>= (nix-server-minor-version server) 2) - (send use-build-hook?)) + (send (boolean use-build-hook?))) (if (>= (nix-server-minor-version server) 4) - (send build-verbosity log-type print-build-trace)) + (send (integer build-verbosity) (integer log-type) + (boolean print-build-trace))) + (if (>= (nix-server-minor-version server) 6) + (send (integer build-cores))) + (if (>= (nix-server-minor-version server) 10) + (send (boolean use-substitutes?))) (let loop ((done? (process-stderr server))) (or done? (process-stderr server))))) -- cgit v1.2.3