guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: services: cuirass: Allow for gexps in specifications.


From: Ludovic Courtès
Subject: 04/05: services: cuirass: Allow for gexps in specifications.
Date: Sun, 1 Jan 2017 22:31:26 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 8de938d59aa48a43b71d9fa687d762c807f59136
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jan 1 22:52:35 2017 +0100

    services: cuirass: Allow for gexps in specifications.
    
    * gnu/services/cuirass.scm (<cuirass-configuration>)[specifications]:
    Change default value to #~'().
    (cuirass-shepherd-service): Remove conditional for "--specifications".
    Use 'scheme-file' instead of 'plain-file'.  Change file name to
    "cuirass-specs.scm".
    * doc/guix.texi (Continuous Integration): Change the example to use a
    gexp where #:file refers to a file within Cuirass.  Adjust
    documentation.
---
 doc/guix.texi            |   31 +++++++++++++++++++------------
 gnu/services/cuirass.scm |   13 +++++--------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 42fb439..45657ed 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13,7 +13,7 @@
 @set OPENPGP-SIGNING-KEY-ID BCA689B636553801C3C62150197A5888235FACAC
 
 @copying
-Copyright @copyright{} 2012, 2013, 2014, 2015, 2016 Ludovic address@hidden
+Copyright @copyright{} 2012, 2013, 2014, 2015, 2016, 2017 Ludovic 
address@hidden
 Copyright @copyright{} 2013, 2014, 2016 Andreas address@hidden
 Copyright @copyright{} 2013 Nikita address@hidden
 Copyright @copyright{} 2014, 2015, 2016 Alex address@hidden
@@ -12028,16 +12028,22 @@ defining a build job based on a specification that 
can be found in
 Cuirass source tree.
 
 @example
-(let ((spec `((#:name . "guix")
-              (#:url . "git://git.savannah.gnu.org/guix.git")
-              (#:load-path . ".")
-              ;; Adapt to a valid absolute file name.
-              (#:file . "/.../cuirass/tests/gnu-system.scm")
-              (#:proc . hydra-jobs)
-              (#:arguments (subset . "hello"))
-              (#:branch . "master"))))
+(let ((spec #~((#:name . "guix")
+               (#:url . "git://git.savannah.gnu.org/guix.git")
+               (#:load-path . ".")
+
+               ;; Here we must provide an absolute file name.
+               ;; We take jobs from one of the examples provided
+               ;; by Cuirass.
+               (#:file . #$(file-append
+                            cuirass
+                            "/tests/gnu-system.scm"))
+
+               (#:proc . hydra-jobs)
+               (#:arguments (subset . "hello"))
+               (#:branch . "master"))))
   (cuirass-service #:config (cuirass-configuration
-                             (specifications (list spec)))))
+                             (specifications #~(list #$spec)))))
 @end example
 
 While information related to build jobs are located directly in the
@@ -12068,8 +12074,9 @@ Cuirass jobs.
 Location of sqlite database which contains the build results and previously
 added specifications.
 
address@hidden @code{specifications} (default: @code{'()})
-A list of specifications, where a specification is an association list
address@hidden @code{specifications} (default: @code{#~'()})
+A gexp (@pxref{G-Expressions}) that evaluates to a list of specifications,
+where a specification is an association list
 (@pxref{Associations Lists,,, guile, GNU Guile Reference Manual}) whose
 keys are keywords (@code{#:keyword-example}) as shown in the example
 above.
diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index 67265e5..4dc802f 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Mathieu Lirzin <address@hidden>
-;;; Copyright © 2016 Ludovic Courtès <address@hidden>
+;;; Copyright © 2016, 2017 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,8 +57,8 @@
                     (default 60))
   (database         cuirass-configuration-database ;string (file-name)
                     (default "/var/run/cuirass/cuirass.db"))
-  (specifications   cuirass-configuration-specifications ;specification-alist
-                    (default '()))
+  (specifications   cuirass-configuration-specifications
+                    (default #~'())) ;gexp that evaluates to 
specification-alist
   (use-substitutes? cuirass-configuration-use-substitutes? ;boolean
                     (default #f))
   (one-shot?        cuirass-configuration-one-shot? ;boolean
@@ -85,11 +85,8 @@
             (start #~(make-forkexec-constructor
                       (list (string-append #$cuirass "/bin/cuirass")
                             "--cache-directory" #$cache-directory
-                            #$@(if (null? specs)
-                                   '()
-                                   (let ((str (format #f "'~S" specs)))
-                                     (list "--specifications"
-                                           (plain-file "specs.scm" str))))
+                            "--specifications"
+                            #$(scheme-file "cuirass-specs.scm" specs)
                             "--database" #$database
                             "--interval" #$(number->string interval)
                             #$@(if use-substitutes? '("--use-substitutes") '())



reply via email to

[Prev in Thread] Current Thread [Next in Thread]