summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-04-05 17:45:12 +0200
committerLudovic Courtès <ludo@gnu.org>2018-04-05 17:47:11 +0200
commit2feb3b8100d7a6e1db042ef24e9f2a897c953346 (patch)
treed4c54c3e617abd29aa77cb98b4e4ea79ddd87500 /bin
parentf090c0f4786c789070e2eae740914e06ab0ab989 (diff)
downloadcuirass-2feb3b8100d7a6e1db042ef24e9f2a897c953346.tar
cuirass-2feb3b8100d7a6e1db042ef24e9f2a897c953346.tar.gz
evaluate: Pass the file name and revision to the user procedure.
* bin/evaluate.in (main): Always pass an alist as the arguments to PROC, containing at least 'file-name' and 'revision'. * examples/random-jobs.scm (make-random-jobs): Display 'file-name' and 'revision' from ARGUMENTS.
Diffstat (limited to 'bin')
-rw-r--r--bin/evaluate.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/evaluate.in b/bin/evaluate.in
index 4c9efd5..c8d83e6 100644
--- a/bin/evaluate.in
+++ b/bin/evaluate.in
@@ -65,10 +65,15 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(unless (string-null? guix-package-path)
(set-guix-package-path! guix-package-path))
;; Call the entry point of FILE and print the resulting job sexp.
+ ;; Among the arguments, always pass 'file-name' and 'revision' like
+ ;; Hydra does.
(let* ((proc-name (assq-ref spec #:proc))
(proc (module-ref %user-module proc-name))
- (thunks (proc store (assq-ref spec #:arguments)))
(commit (assq-ref spec #:current-commit))
+ (args `((revision . ,commit)
+ (file-name . ,source)
+ ,@(or (assq-ref spec #:arguments) '())))
+ (thunks (proc store args))
(eval `((#:specification . ,(assq-ref spec #:name))
(#:revision . ,commit))))
(pretty-print