mirror of https://notabug.org/mthl/cuirass.git
cuirass: Optionally support using of substitutes.
* bin/cuirass.in (options): Add --use-substitutes. (show-help): Idem. (main): Set %use-substitutes?. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>pull/3/head
parent
ff7c3a11f2
commit
fca42b010e
|
@ -35,6 +35,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
||||||
Add specifications from SPECFILE to database.
|
Add specifications from SPECFILE to database.
|
||||||
-D --database=DB Use DB to store build results.
|
-D --database=DB Use DB to store build results.
|
||||||
-I, --interval=N Wait N seconds between each poll
|
-I, --interval=N Wait N seconds between each poll
|
||||||
|
--use-substitutes Allow usage of pre-built substitutes
|
||||||
-V, --version Display version
|
-V, --version Display version
|
||||||
-h, --help Display this help message")
|
-h, --help Display this help message")
|
||||||
(newline)
|
(newline)
|
||||||
|
@ -46,6 +47,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
||||||
(specifications (single-char #\S) (value #t))
|
(specifications (single-char #\S) (value #t))
|
||||||
(database (single-char #\D) (value #t))
|
(database (single-char #\D) (value #t))
|
||||||
(interval (single-char #\I) (value #t))
|
(interval (single-char #\I) (value #t))
|
||||||
|
(use-substitutes (value #f))
|
||||||
(version (single-char #\V) (value #f))
|
(version (single-char #\V) (value #f))
|
||||||
(help (single-char #\h) (value #f))))
|
(help (single-char #\h) (value #f))))
|
||||||
|
|
||||||
|
@ -60,7 +62,8 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
||||||
((%program-name (car args))
|
((%program-name (car args))
|
||||||
(%package-database (option-ref opts 'database (%package-database)))
|
(%package-database (option-ref opts 'database (%package-database)))
|
||||||
(%package-cachedir
|
(%package-cachedir
|
||||||
(option-ref opts 'cache-directory (%package-cachedir))))
|
(option-ref opts 'cache-directory (%package-cachedir)))
|
||||||
|
(%use-substitutes? (option-ref opts 'use-substitutes #f)))
|
||||||
(cond
|
(cond
|
||||||
((option-ref opts 'help #f)
|
((option-ref opts 'help #f)
|
||||||
(show-help)
|
(show-help)
|
||||||
|
|
|
@ -44,8 +44,9 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
||||||
(string-append cachedir "/" (assq-ref spec #:name))
|
(string-append cachedir "/" (assq-ref spec #:name))
|
||||||
(primitive-load (assq-ref spec #:file)))))
|
(primitive-load (assq-ref spec #:file)))))
|
||||||
(with-store store
|
(with-store store
|
||||||
;; Make sure we don't resort to substitutes.
|
(unless (assoc-ref spec #:use-substitutes?)
|
||||||
(set-build-options store #:use-substitutes? #f #:substitute-urls '())
|
;; Make sure we don't resort to substitutes.
|
||||||
|
(set-build-options store #:use-substitutes? #f #:substitute-urls '()))
|
||||||
;; Grafts can trigger early builds. We do not want that to happen
|
;; Grafts can trigger early builds. We do not want that to happen
|
||||||
;; during evaluation, so use a sledgehammer to catch such problems.
|
;; during evaluation, so use a sledgehammer to catch such problems.
|
||||||
(set! build-things
|
(set! build-things
|
||||||
|
@ -54,7 +55,8 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
||||||
stderr)
|
stderr)
|
||||||
(simple-format stderr "'build-things' arguments: ~S~%" args)
|
(simple-format stderr "'build-things' arguments: ~S~%" args)
|
||||||
(exit 1)))
|
(exit 1)))
|
||||||
(parameterize ((%package-database database))
|
(parameterize ((%package-database database)
|
||||||
|
(%use-substitutes? (assoc-ref spec #:use-substitutes?)))
|
||||||
;; Call the entry point of FILE and print the resulting job sexp.
|
;; Call the entry point of FILE and print the resulting job sexp.
|
||||||
(let* ((proc (module-ref %user-module 'hydra-jobs))
|
(let* ((proc (module-ref %user-module 'hydra-jobs))
|
||||||
(thunks (proc store (assq-ref spec #:arguments)))
|
(thunks (proc store (assq-ref spec #:arguments)))
|
||||||
|
|
|
@ -34,7 +34,12 @@
|
||||||
build-packages
|
build-packages
|
||||||
process-specs
|
process-specs
|
||||||
;; Parameters.
|
;; Parameters.
|
||||||
%package-cachedir))
|
%package-cachedir
|
||||||
|
%use-substitutes?))
|
||||||
|
|
||||||
|
(define %use-substitutes?
|
||||||
|
;; Define whether to use substitutes
|
||||||
|
(make-parameter #f))
|
||||||
|
|
||||||
(define %package-cachedir
|
(define %package-cachedir
|
||||||
;; Define to location of cache directory of this package.
|
;; Define to location of cache directory of this package.
|
||||||
|
@ -149,7 +154,8 @@ if required."
|
||||||
(with-store store
|
(with-store store
|
||||||
(let* ((spec* (acons #:current-commit commit spec))
|
(let* ((spec* (acons #:current-commit commit spec))
|
||||||
(jobs (evaluate store db spec*)))
|
(jobs (evaluate store db spec*)))
|
||||||
(set-build-options store #:use-substitutes? #f)
|
(unless (%use-substitutes?)
|
||||||
|
(set-build-options store #:use-substitutes? #f))
|
||||||
(build-packages store db jobs))))
|
(build-packages store db jobs))))
|
||||||
(db-add-stamp db spec commit)))
|
(db-add-stamp db spec commit)))
|
||||||
jobspecs))
|
jobspecs))
|
||||||
|
|
Loading…
Reference in New Issue