summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-26 16:53:57 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-27 14:17:09 +0200
commitd493a58823aed8c556bf795d02207e57718b96c9 (patch)
tree1fbb66eda8315b3d7cfa5074049779c02462c920 /bin
parent0225d696424b0826af210fdeef770a2310252c64 (diff)
downloadcuirass-d493a58823aed8c556bf795d02207e57718b96c9.tar
cuirass-d493a58823aed8c556bf795d02207e57718b96c9.tar.gz
schema: Separate "Derivations" from "Evaluations".
* src/schema.sql (Derivations): New table. (Evaluations): Remove 'derivation' and 'job_name' columns. Add 'id' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. (db-get-derivation, db-add-derivation): New procedures. (evaluation-exists?, db-get-evaluation): Delete. * bin/evaluate.in (main): Adapt. * tests/database.scm ("sqlite-exec"): Likewise. ("db-add-derivation", "db-get-derivation"): New tests. ("db-add-evaluation", "db-get-evaluation"): Delete.
Diffstat (limited to 'bin')
-rw-r--r--bin/evaluate.in14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/evaluate.in b/bin/evaluate.in
index 878732f..6c5a53f 100644
--- a/bin/evaluate.in
+++ b/bin/evaluate.in
@@ -57,17 +57,17 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(exit 1)))
(parameterize ((%package-database database))
;; Call the entry point of FILE and print the resulting job sexp.
- (let* ((proc (module-ref %user-module 'hydra-jobs))
- (thunks (proc store (assq-ref spec #:arguments)))
- (db (db-open))
- (spec-id (assq-ref spec #:id)))
+ (let* ((proc (module-ref %user-module 'hydra-jobs))
+ (thunks (proc store (assq-ref spec #:arguments)))
+ (db (db-open))
+ (spec-id (assq-ref spec #:id))
+ (eval-id (db-add-evaluation db spec-id)))
(pretty-print
(map (λ (thunk)
(let* ((job (call-with-time-display thunk))
;; Keep track of SPEC id in the returned jobs.
- (job* (acons #:spec-id spec-id job)))
- (or (evaluation-exists? db job*)
- (db-add-evaluation db job*))
+ (job* (acons #:eval-id eval-id job)))
+ (db-add-derivation db job*)
job*))
thunks)
stdout)