mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 20:12:11 +02:00
store: Add #:timeout build option.
* guix/serialization.scm (write-string-pairs): New procedure.
* guix/store.scm (write-arg): Add 'string-pairs' case.
(set-build-options): Add 'timeout' keyword parameter. Honor it.
* tests/derivations.scm ("build-expression->derivation and timeout"):
New test.
This commit is contained in:
@@ -446,6 +446,20 @@
|
||||
(build-derivations store (list drv))
|
||||
#f)))
|
||||
|
||||
(test-assert "build-expression->derivation and timeout"
|
||||
(let* ((store (let ((s (open-connection)))
|
||||
(set-build-options s #:timeout 1)
|
||||
s))
|
||||
(builder '(begin (sleep 100) (mkdir %output) #t))
|
||||
(drv (build-expression->derivation store "slow" builder))
|
||||
(out-path (derivation->output-path drv)))
|
||||
(guard (c ((nix-protocol-error? c)
|
||||
(and (string-contains (nix-protocol-error-message c)
|
||||
"failed")
|
||||
(not (valid-path? store out-path)))))
|
||||
(build-derivations store (list drv))
|
||||
#f)))
|
||||
|
||||
(test-assert "build-expression->derivation and derivation-prerequisites-to-build"
|
||||
(let ((drv (build-expression->derivation %store "fail" #f)))
|
||||
;; The only direct dependency is (%guile-for-build) and it's already
|
||||
|
||||
Reference in New Issue
Block a user