From 07e70f4846521c1fa5319b25f23eea171a03fccd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 3 Dec 2015 19:08:35 +0200 Subject: store: Add mode parameter to 'build-paths'. * guix/store.scm (%protocol-version): Set minor to 15. (build-mode): New enumerate type. (build-things): Add 'mode' parameter; pass it to the RPC. * tests/store.scm ("build-things, check mode"): New check. --- guix/store.scm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'guix/store.scm') diff --git a/guix/store.scm b/guix/store.scm index 89f5df052a..1818187155 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -53,6 +53,7 @@ nix-protocol-error-status hash-algo + build-mode open-connection close-connection @@ -129,7 +130,7 @@ direct-store-path log-file)) -(define %protocol-version #x10e) +(define %protocol-version #x10f) (define %worker-magic-1 #x6e697863) ; "nixc" (define %worker-magic-2 #x6478696f) ; "dxio" @@ -188,6 +189,12 @@ (sha1 2) (sha256 3)) +(define-enumerate-type build-mode + ;; store-api.hh + (normal 0) + (repair 1) + (check 2)) + (define-enumerate-type gc-action ;; store-api.hh (return-live 0) @@ -637,12 +644,17 @@ bits are kept. HASH-ALGO must be a string such as \"sha256\"." (hash-set! cache args path) path)))))) -(define-operation (build-things (string-list things)) - "Build THINGS, a list of store items which may be either '.drv' files or +(define build-things + (let ((build (operation (build-things (string-list things) + (integer mode)) + "Do it!" + boolean))) + (lambda* (store things #:optional (mode (build-mode normal))) + "Build THINGS, a list of store items which may be either '.drv' files or outputs, and return when the worker is done building them. Elements of THINGS that are not derivations can only be substituted and not built locally. Return #t on success." - boolean) + (build store things mode)))) (define-operation (add-temp-root (store-path path)) "Make PATH a temporary root for the duration of the current session. -- cgit v1.2.3