derivations: Rename #:dependency-graphs to #:references-graphs.

* guix/derivations.scm (derivation, build-expression->derivation):
  Rename #:dependency-graphs to #:references-graphs, for consistency in
  the terminology.
* tests/derivations.scm: Adjust accordingly.
This commit is contained in:
Ludovic Courtès 2013-08-27 18:34:49 +02:00
parent af807dea7f
commit 858e92823f
3 changed files with 15 additions and 15 deletions

View File

@ -1113,7 +1113,7 @@ derivations as Scheme objects, along with procedures to create and
otherwise manipulate derivations. The lowest-level primitive to create otherwise manipulate derivations. The lowest-level primitive to create
a derivation is the @code{derivation} procedure: a derivation is the @code{derivation} procedure:
@deffn {Scheme Procedure} derivation @var{store} @var{name} @var{builder} @var{args} [#:outputs '("out")] [#:hash #f] [#:hash-algo #f] [#:hash-mode #f] [#:inputs '()] [#:env-vars '()] [#:system (%current-system)] [#:dependency-graphs #f] @deffn {Scheme Procedure} derivation @var{store} @var{name} @var{builder} @var{args} [#:outputs '("out")] [#:hash #f] [#:hash-algo #f] [#:hash-mode #f] [#:inputs '()] [#:env-vars '()] [#:system (%current-system)] [#:references-graphs #f]
Build a derivation with the given arguments. Return the resulting store Build a derivation with the given arguments. Return the resulting store
path and @code{<derivation>} object. path and @code{<derivation>} object.
@ -1121,7 +1121,7 @@ When @var{hash}, @var{hash-algo}, and @var{hash-mode} are given, a
@dfn{fixed-output derivation} is created---i.e., one whose result is @dfn{fixed-output derivation} is created---i.e., one whose result is
known in advance, such as a file download. known in advance, such as a file download.
When @var{dependency-graphs} is true, it must be a list of file When @var{references-graphs} is true, it must be a list of file
name/store path pairs. In that case, the reference graph of each store name/store path pairs. In that case, the reference graph of each store
path is exported in the build environment in the corresponding file, in path is exported in the build environment in the corresponding file, in
a simple text format. a simple text format.
@ -1153,7 +1153,7 @@ As can be guessed, this primitive is cumbersome to use directly. An
improved variant is @code{build-expression->derivation}, which allows improved variant is @code{build-expression->derivation}, which allows
the caller to directly pass a Guile expression as the build script: the caller to directly pass a Guile expression as the build script:
@deffn {Scheme Procedure} build-expression->derivation @var{store} @var{name} @var{system} @var{exp} @var{inputs} [#:outputs '("out")] [#:hash #f] [#:hash-algo #f] [#:env-vars '()] [#:modules '()] [#:dependency-graphs #f] [#:guile-for-build #f] @deffn {Scheme Procedure} build-expression->derivation @var{store} @var{name} @var{system} @var{exp} @var{inputs} [#:outputs '("out")] [#:hash #f] [#:hash-algo #f] [#:env-vars '()] [#:modules '()] [#:references-graphs #f] [#:guile-for-build #f]
Return a derivation that executes Scheme expression @var{exp} as a Return a derivation that executes Scheme expression @var{exp} as a
builder for derivation @var{name}. @var{inputs} must be a list of builder for derivation @var{name}. @var{inputs} must be a list of
@code{(name drv-path sub-drv)} tuples; when @var{sub-drv} is omitted, @code{(name drv-path sub-drv)} tuples; when @var{sub-drv} is omitted,
@ -1175,7 +1175,7 @@ terminates by passing the result of @var{exp} to @code{exit}; thus, when
@var{guile-for-build} is omitted or is @code{#f}, the value of the @var{guile-for-build} is omitted or is @code{#f}, the value of the
@code{%guile-for-build} fluid is used instead. @code{%guile-for-build} fluid is used instead.
See the @code{derivation} procedure for the meaning of @var{dependency-graphs}. See the @code{derivation} procedure for the meaning of @var{references-graphs}.
@end deffn @end deffn
@noindent @noindent

View File

@ -502,13 +502,13 @@ the derivation called NAME with hash HASH."
(system (%current-system)) (env-vars '()) (system (%current-system)) (env-vars '())
(inputs '()) (outputs '("out")) (inputs '()) (outputs '("out"))
hash hash-algo hash-mode hash hash-algo hash-mode
dependency-graphs) references-graphs)
"Build a derivation with the given arguments. Return the resulting "Build a derivation with the given arguments. Return the resulting
store path and <derivation> object. When HASH, HASH-ALGO, and HASH-MODE store path and <derivation> object. When HASH, HASH-ALGO, and HASH-MODE
are given, a fixed-output derivation is created---i.e., one whose result is are given, a fixed-output derivation is created---i.e., one whose result is
known in advance, such as a file download. known in advance, such as a file download.
When DEPENDENCY-GRAPHS is true, it must be a list of file name/store path When REFERENCES-GRAPHS is true, it must be a list of file name/store path
pairs. In that case, the reference graph of each store path is exported in pairs. In that case, the reference graph of each store path is exported in
the build environment in the corresponding file, in a simple text format." the build environment in the corresponding file, in a simple text format."
(define direct-store-path? (define direct-store-path?
@ -549,7 +549,7 @@ the build environment in the corresponding file, in a simple text format."
;; Some options are passed to the build daemon via the env. vars of ;; Some options are passed to the build daemon via the env. vars of
;; derivations (urgh!). We hide that from our API, but here is the place ;; derivations (urgh!). We hide that from our API, but here is the place
;; where we kludgify those options. ;; where we kludgify those options.
(match dependency-graphs (match references-graphs
(((file . path) ...) (((file . path) ...)
(let ((value (map (cut string-append <> " " <>) (let ((value (map (cut string-append <> " " <>)
file path))) file path)))
@ -744,7 +744,7 @@ they can refer to each other."
(env-vars '()) (env-vars '())
(modules '()) (modules '())
guile-for-build guile-for-build
dependency-graphs) references-graphs)
"Return a derivation that executes Scheme expression EXP as a builder "Return a derivation that executes Scheme expression EXP as a builder
for derivation NAME. INPUTS must be a list of (NAME DRV-PATH SUB-DRV) for derivation NAME. INPUTS must be a list of (NAME DRV-PATH SUB-DRV)
tuples; when SUB-DRV is omitted, \"out\" is assumed. MODULES is a list tuples; when SUB-DRV is omitted, \"out\" is assumed. MODULES is a list
@ -763,7 +763,7 @@ EXP returns #f, the build is considered to have failed.
EXP is built using GUILE-FOR-BUILD (a derivation). When GUILE-FOR-BUILD is EXP is built using GUILE-FOR-BUILD (a derivation). When GUILE-FOR-BUILD is
omitted or is #f, the value of the `%guile-for-build' fluid is used instead. omitted or is #f, the value of the `%guile-for-build' fluid is used instead.
See the `derivation' procedure for the meaning of DEPENDENCY-GRAPHS." See the `derivation' procedure for the meaning of REFERENCES-GRAPHS."
(define guile-drv (define guile-drv
(or guile-for-build (%guile-for-build))) (or guile-for-build (%guile-for-build)))
@ -881,4 +881,4 @@ See the `derivation' procedure for the meaning of DEPENDENCY-GRAPHS."
#:hash hash #:hash-algo hash-algo #:hash hash #:hash-algo hash-algo
#:outputs outputs #:outputs outputs
#:dependency-graphs dependency-graphs))) #:references-graphs references-graphs)))

View File

@ -296,7 +296,7 @@
(and (valid-path? %store p) (and (valid-path? %store p)
(equal? '(one two) (call-with-input-file p read))))))) (equal? '(one two) (call-with-input-file p read)))))))
(test-assert "derivation with #:dependency-graphs" (test-assert "derivation with #:references-graphs"
(let* ((input1 (add-text-to-store %store "foo" "hello" (let* ((input1 (add-text-to-store %store "foo" "hello"
(list %bash))) (list %bash)))
(input2 (add-text-to-store %store "bar" (input2 (add-text-to-store %store "bar"
@ -312,7 +312,7 @@
(list %mkdir))) (list %mkdir)))
(drv (derivation %store "closure-graphs" (drv (derivation %store "closure-graphs"
%bash `(,builder) %bash `(,builder)
#:dependency-graphs #:references-graphs
`(("bash" . ,%bash) `(("bash" . ,%bash)
("input1" . ,input1) ("input1" . ,input1)
("input2" . ,input2)) ("input2" . ,input2))
@ -652,14 +652,14 @@ Deriver: ~a~%"
(derivation-path->output-path final2)) (derivation-path->output-path final2))
(build-derivations %store (list final1 final2))))) (build-derivations %store (list final1 final2)))))
(test-assert "build-expression->derivation with #:dependency-graphs" (test-assert "build-expression->derivation with #:references-graphs"
(let* ((input (add-text-to-store %store "foo" "hello" (let* ((input (add-text-to-store %store "foo" "hello"
(list %bash %mkdir))) (list %bash %mkdir)))
(builder '(copy-file "input" %output)) (builder '(copy-file "input" %output))
(drv (build-expression->derivation %store "dependency-graphs" (drv (build-expression->derivation %store "references-graphs"
(%current-system) (%current-system)
builder '() builder '()
#:dependency-graphs #:references-graphs
`(("input" . ,input)))) `(("input" . ,input))))
(out (derivation-path->output-path drv))) (out (derivation-path->output-path drv)))
(define (deps path . deps) (define (deps path . deps)