hydra: evaluate: Add the checkout to the store.
* build-aux/hydra/evaluate.scm <top level>: Add call to 'add-to-store'. Use that as the 'file-name' attribute. Call 'primitive-load' in a directory excursion to SOURCE.
This commit is contained in:
parent
59fb5c1cdb
commit
65ff85dcee
|
@ -22,6 +22,8 @@
|
||||||
;;; arguments and outputs an sexp of the jobs on standard output.
|
;;; arguments and outputs an sexp of the jobs on standard output.
|
||||||
|
|
||||||
(use-modules (guix store)
|
(use-modules (guix store)
|
||||||
|
(guix git-download)
|
||||||
|
((guix build utils) #:select (with-directory-excursion))
|
||||||
(srfi srfi-19)
|
(srfi srfi-19)
|
||||||
(ice-9 match)
|
(ice-9 match)
|
||||||
(ice-9 pretty-print)
|
(ice-9 pretty-print)
|
||||||
|
@ -81,11 +83,6 @@ Otherwise return THING."
|
||||||
;; Load FILE, a Scheme file that defines Hydra jobs.
|
;; Load FILE, a Scheme file that defines Hydra jobs.
|
||||||
(let ((port (current-output-port))
|
(let ((port (current-output-port))
|
||||||
(real-build-things build-things))
|
(real-build-things build-things))
|
||||||
(save-module-excursion
|
|
||||||
(lambda ()
|
|
||||||
(set-current-module %user-module)
|
|
||||||
(primitive-load file)))
|
|
||||||
|
|
||||||
(with-store store
|
(with-store store
|
||||||
;; Make sure we don't resort to substitutes.
|
;; Make sure we don't resort to substitutes.
|
||||||
(set-build-options store
|
(set-build-options store
|
||||||
|
@ -104,23 +101,37 @@ Otherwise return THING."
|
||||||
"'build-things' arguments: ~s~%" args)
|
"'build-things' arguments: ~s~%" args)
|
||||||
(apply real-build-things store args)))
|
(apply real-build-things store args)))
|
||||||
|
|
||||||
;; Call the entry point of FILE and print the resulting job sexp.
|
;; Add %TOP-SRCDIR to the store with a proper Git predicate so we work
|
||||||
(pretty-print
|
;; from a clean checkout
|
||||||
(match ((module-ref %user-module
|
(let ((source (add-to-store store "guix-source" #t
|
||||||
(if (equal? cuirass? "cuirass")
|
"sha256" %top-srcdir
|
||||||
'cuirass-jobs
|
#:select? (git-predicate %top-srcdir))))
|
||||||
'hydra-jobs))
|
(with-directory-excursion source
|
||||||
store `((guix
|
(save-module-excursion
|
||||||
. ((file-name . ,%top-srcdir)))))
|
(lambda ()
|
||||||
(((names . thunks) ...)
|
(set-current-module %user-module)
|
||||||
(map (lambda (job thunk)
|
(format (current-error-port)
|
||||||
(format (current-error-port) "evaluating '~a'... " job)
|
"loading '~a' relative to '~a'...~%"
|
||||||
(force-output (current-error-port))
|
file source)
|
||||||
(cons job
|
(primitive-load file))))
|
||||||
(assert-valid-job job
|
|
||||||
(call-with-time-display thunk))))
|
;; Call the entry point of FILE and print the resulting job sexp.
|
||||||
names thunks)))
|
(pretty-print
|
||||||
port))))
|
(match ((module-ref %user-module
|
||||||
|
(if (equal? cuirass? "cuirass")
|
||||||
|
'cuirass-jobs
|
||||||
|
'hydra-jobs))
|
||||||
|
store `((guix
|
||||||
|
. ((file-name . ,source)))))
|
||||||
|
(((names . thunks) ...)
|
||||||
|
(map (lambda (job thunk)
|
||||||
|
(format (current-error-port) "evaluating '~a'... " job)
|
||||||
|
(force-output (current-error-port))
|
||||||
|
(cons job
|
||||||
|
(assert-valid-job job
|
||||||
|
(call-with-time-display thunk))))
|
||||||
|
names thunks)))
|
||||||
|
port)))))
|
||||||
((command _ ...)
|
((command _ ...)
|
||||||
(format (current-error-port) "Usage: ~a FILE [cuirass]
|
(format (current-error-port) "Usage: ~a FILE [cuirass]
|
||||||
Evaluate the Hydra or Cuirass jobs defined in FILE.~%"
|
Evaluate the Hydra or Cuirass jobs defined in FILE.~%"
|
||||||
|
|
Loading…
Reference in New Issue