summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-23 17:00:38 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-25 02:12:41 +0200
commitc7c9e918763cd0e4c3fb85fe610c3971a0040d87 (patch)
tree8551f106eace452996484ff05da017ce66c62bae /bin
parentcf7e290dc25fdc379d650bb4594628d4a654e59b (diff)
downloadcuirass-c7c9e918763cd0e4c3fb85fe610c3971a0040d87.tar
cuirass-c7c9e918763cd0e4c3fb85fe610c3971a0040d87.tar.gz
schema: Separate 'Evaluations' from 'Builds'.
Adapt src/cuirass/database.scm and its tests.
Diffstat (limited to 'bin')
-rw-r--r--bin/cuirass.in32
1 files changed, 18 insertions, 14 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index 5aa53c4..d0cd84a 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -90,9 +90,10 @@ if required."
(string-append "'" (object->string spec))))
(jobs (read port)))
(close-pipe port)
- (map (λ (job)
- (acons #:id (db-add-evaluation db job) job))
- jobs)))
+ ;; Keep track of SPEC id in the returned jobs.
+ (let ((spec-id (assq-ref spec #:id)))
+ (map (λ (job) (acons #:spec-id spec-id job))
+ jobs))))
(define (build-packages store db jobs)
"Build JOBS which is a list of <job> objects."
@@ -104,23 +105,26 @@ if required."
(format #t "building ~A...~%" drv)
(parameterize ((current-build-output-port log-port))
(build-derivations store (list drv))
- (db-add-build-log db job log-port)
+ ;; XXX: 'Builds' database table is not implemented yet.
+ ;; (db-add-build-log db job log-port)
(close-port log-port))
(format #t "~A~%" (derivation-path->output-path drv))))
jobs))
-(define (process-spec db spec)
- "Evaluate and build SPEC"
- (fetch-repository spec)
- (compile (string-append (%package-cachedir) "/" (assq-ref spec #:name)))
- (with-store store
- (let ((jobs (evaluate store db spec)))
- (set-build-options store #:use-substitutes? #f)
- (build-packages store db jobs))))
-
(define (process-specs db jobspecs)
"Evaluate and build JOBSPECS and store results in DB."
- (for-each (λ (spec) (process-spec db spec)) jobspecs))
+ (for-each (λ (spec)
+ (fetch-repository spec)
+ (compile (string-append (%package-cachedir) "/"
+ (assq-ref spec #:name)))
+ (with-store store
+ (let* ((id (db-add-specification db spec))
+ (spec* (acons #:id id spec))
+ (jobs (evaluate store db spec*)))
+ (db-add-evaluation db jobs)
+ (set-build-options store #:use-substitutes? #f)
+ (build-packages store db jobs))))
+ jobspecs))
;;;