diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-06-10 22:10:21 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-06-10 22:42:59 +0200 |
commit | f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb (patch) | |
tree | dca6c6f3b0b95083be5d37e636d3c338f109eeba /guix/store.scm | |
parent | 416a7c69f1d788670f0c4a7ffaed3e032eadc91d (diff) | |
download | guix-f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb.tar guix-f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb.tar.gz |
store: 'build-things' accepts derivation/output pairs.
This allows callers to request the substitution of a single derivation
output.
* guix/store.scm (build-things): Accept derivation/output pairs among
THINGS.
* guix/derivations.scm (build-derivations): Likewise.
* tests/store.scm ("substitute + build-things with specific output"):
New test.
* tests/derivations.scm ("build-derivations with specific output"):
New test.
* doc/guix.texi (The Store): Adjust accordingly.
Diffstat (limited to 'guix/store.scm')
-rw-r--r-- | guix/store.scm | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/guix/store.scm b/guix/store.scm index 738c0fb5f3..8fa16499f8 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1211,16 +1211,22 @@ an arbitrary directory layout in the store without creating a derivation." "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." - (parameterize ((current-store-protocol-version - (store-connection-version store))) - (if (>= (store-connection-minor-version store) 15) - (build store things mode) - (if (= mode (build-mode normal)) - (build/old store things) - (raise (condition (&store-protocol-error - (message "unsupported build mode") - (status 1)))))))))) +Alternately, an element of THING can be a derivation/output name pair, in +which case the daemon will attempt to substitute just the requested output of +the derivation. Return #t on success." + (let ((things (map (match-lambda + ((drv . output) (string-append drv "!" output)) + (thing thing)) + things))) + (parameterize ((current-store-protocol-version + (store-connection-version store))) + (if (>= (store-connection-minor-version store) 15) + (build store things mode) + (if (= mode (build-mode normal)) + (build/old store things) + (raise (condition (&store-protocol-error + (message "unsupported build mode") + (status 1))))))))))) (define-operation (add-temp-root (store-path path)) "Make PATH a temporary root for the duration of the current session. |