From 969e678ed9f907764e6412386432dfbddf493f71 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 20 May 2013 18:14:55 +0200 Subject: Add `--max-silent-time' to `guix build' and `guix package'. * guix/scripts/build.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-build): Pass `max-silent-time' to `set-build-options'. * guix/scripts/package.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-package): Pass `max-silent-time' to `set-build-options'. * guix/ui.scm (string->number*): New procedure. * tests/derivations.scm ("build-expression->derivation and max-silent-time"): New test. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--max-silent-time'. --- tests/derivations.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/derivations.scm b/tests/derivations.scm index a50c1af878..0cba98e1e8 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -353,6 +353,21 @@ (equal? '(hello guix) (call-with-input-file (string-append p "/test") read)))))) +(test-assert "build-expression->derivation and max-silent-time" + (let* ((store (let ((s (open-connection))) + (set-build-options s #:max-silent-time 1) + s)) + (builder '(sleep 100)) + (drv-path (build-expression->derivation %store "silent" + (%current-system) + builder '())) + (out-path (derivation-path->output-path drv-path))) + (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-path))))) + (test-assert "build-expression->derivation and derivation-prerequisites-to-build" (let-values (((drv-path drv) (build-expression->derivation %store "fail" (%current-system) -- cgit 1.4.1