From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVCyE-0007rZ-DH for guix-patches@gnu.org; Wed, 12 Jul 2017 04:26:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVCyA-0006fz-Bg for guix-patches@gnu.org; Wed, 12 Jul 2017 04:26:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVCyA-0006fr-5D for guix-patches@gnu.org; Wed, 12 Jul 2017 04:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVCy9-00066c-UM for guix-patches@gnu.org; Wed, 12 Jul 2017 04:26:01 -0400 Subject: [bug#27664] [PATCH] cuirass: Add fallback parameter. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVCx6-0007Rn-VH for guix-patches@gnu.org; Wed, 12 Jul 2017 04:24:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVCx2-00063H-UM for guix-patches@gnu.org; Wed, 12 Jul 2017 04:24:56 -0400 Received: from mail-wr0-x232.google.com ([2a00:1450:400c:c0c::232]:33569) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVCx2-000635-NN for guix-patches@gnu.org; Wed, 12 Jul 2017 04:24:52 -0400 Received: by mail-wr0-x232.google.com with SMTP id r103so23184698wrb.0 for ; Wed, 12 Jul 2017 01:24:52 -0700 (PDT) From: Mathieu Othacehe Date: Wed, 12 Jul 2017 10:24:46 +0200 Message-Id: <20170712082446.24427-1-m.othacehe@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27664@debbugs.gnu.org Cc: Mathieu Othacehe From: Mathieu Othacehe * src/cuirass/base.scm (%fallback?): New exported parameter. (process-specs)[set-build-options]: Pass fallback parameter. * bin/cuirass.in (%options): Add fallback. (main): Set %fallback? parameter. (show-help): Update. --- bin/cuirass.in | 5 ++++- src/cuirass/base.scm | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/cuirass.in b/bin/cuirass.in index 61b9dd8..18edf1e 100644 --- a/bin/cuirass.in +++ b/bin/cuirass.in @@ -35,6 +35,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" --one-shot Evaluate and build jobs only once --cache-directory=DIR Use DIR for storing repository data + --fallback Fall back to building when the substituter fails. -L --load-path=DIR Prepend DIR to Guix package module search path. -S --specifications=SPECFILE Add specifications from SPECFILE to database. @@ -56,6 +57,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (port (single-char #\p) (value #t)) (interval (single-char #\I) (value #t)) (use-substitutes (value #f)) + (fallback (value #f)) (version (single-char #\V) (value #f)) (help (single-char #\h) (value #f)))) @@ -73,7 +75,8 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (option-ref opts 'cache-directory (%package-cachedir))) (%guix-package-path (option-ref opts 'load-path (%guix-package-path))) - (%use-substitutes? (option-ref opts 'use-substitutes #f))) + (%use-substitutes? (option-ref opts 'use-substitutes #f)) + (%fallback? (option-ref opts 'fallback #f))) (cond ((option-ref opts 'help #f) (show-help) diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index d0e77d9..b84cab7 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -43,7 +43,8 @@ ;; Parameters. %guix-package-path %package-cachedir - %use-substitutes?)) + %use-substitutes? + %fallback?)) (cond-expand (guile-2.2 @@ -56,6 +57,10 @@ ;; Define whether to use substitutes (make-parameter #f)) +(define %fallback? + ;; Define whether to fall back to building when the substituter fails. + (make-parameter #f)) + (define %package-cachedir ;; Define to location of cache directory of this package. (make-parameter (or (getenv "CUIRASS_CACHEDIR") @@ -210,6 +215,7 @@ directory and the sha1 of the top level commit in this directory." ;; failure. (set-build-options store #:use-substitutes? (%use-substitutes?) + #:fallback? (%fallback?) #:keep-going? #t) (let* ((spec* (acons #:current-commit commit spec)) -- 2.13.1