mirror of https://notabug.org/mthl/cuirass.git
evaluate: Store evaluations in evaluate script.
parent
efb249b056
commit
fccd6fa60b
|
@ -87,13 +87,11 @@ if required."
|
|||
(assq-ref spec #:name) "/"
|
||||
(assq-ref spec #:load-path))
|
||||
(%package-cachedir)
|
||||
(object->string spec)))
|
||||
(object->string spec)
|
||||
(%package-database)))
|
||||
(jobs (read port)))
|
||||
(close-pipe port)
|
||||
;; 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))))
|
||||
jobs))
|
||||
|
||||
(define (build-packages store db jobs)
|
||||
"Build JOBS which is a list of <job> objects."
|
||||
|
@ -118,11 +116,7 @@ if required."
|
|||
(compile (string-append (%package-cachedir) "/"
|
||||
(assq-ref spec #:name)))
|
||||
(with-store store
|
||||
(let* ((jobs (evaluate store db spec)))
|
||||
(for-each (λ (job)
|
||||
(or (evaluation-exists? db job)
|
||||
(db-add-evaluation db job)))
|
||||
jobs)
|
||||
(let ((jobs (evaluate store db spec)))
|
||||
(set-build-options store #:use-substitutes? #f)
|
||||
(build-packages store db jobs))))
|
||||
jobspecs))
|
||||
|
|
|
@ -24,6 +24,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
|||
;;; along with Cuirass. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(use-modules (cuirass base)
|
||||
(cuirass database)
|
||||
(cuirass utils)
|
||||
(ice-9 match)
|
||||
(ice-9 pretty-print)
|
||||
|
@ -31,7 +32,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
|||
|
||||
(define* (main #:optional (args (command-line)))
|
||||
(match args
|
||||
((command load-path cachedir specstr)
|
||||
((command load-path cachedir specstr database)
|
||||
;; Load FILE, a Scheme file that defines Hydra jobs.
|
||||
(let ((%user-module (make-fresh-user-module))
|
||||
(spec (with-input-from-string specstr read))
|
||||
|
@ -54,13 +55,23 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
|||
stderr)
|
||||
(simple-format stderr "'build-things' arguments: ~S~%" args)
|
||||
(exit 1)))
|
||||
(parameterize ((%package-database database))
|
||||
;; Call the entry point of FILE and print the resulting job sexp.
|
||||
(pretty-print
|
||||
(let* ((proc (module-ref %user-module 'hydra-jobs))
|
||||
(thunks (proc store (assq-ref spec #:arguments))))
|
||||
(map (λ (thunk) (call-with-time-display thunk))
|
||||
thunks))
|
||||
stdout))))
|
||||
(thunks (proc store (assq-ref spec #:arguments)))
|
||||
(db (db-open))
|
||||
(spec-id (assq-ref 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*))
|
||||
thunks)
|
||||
stdout)
|
||||
(db-close db))))))
|
||||
((command _ ...)
|
||||
(simple-format (current-error-port) "Usage: ~A FILE
|
||||
Evaluate the Hydra jobs defined in FILE.~%"
|
||||
|
|
Loading…
Reference in New Issue