guix-commits
[Top][All Lists]
Advanced

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

04/04: services: guix: Add 'log-compression' option.


From: Ludovic Courtès
Subject: 04/04: services: guix: Add 'log-compression' option.
Date: Mon, 8 Jan 2018 04:43:58 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit f4596f7630ba8d281b972ebd40fd9947ef79e957
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 8 10:38:39 2018 +0100

    services: guix: Add 'log-compression' option.
    
    * gnu/services/base.scm (<guix-configuration>)[log-compression]: New
    field.
    (guix-shepherd-service): Use 'match-record' instead of 'match'.  Honor
    'log-compression'.
    * doc/guix.texi (Base Services): Document 'log-compression'.
---
 .dir-locals.el        |  1 +
 doc/guix.texi         |  4 +++
 gnu/services/base.scm | 68 +++++++++++++++++++++++++--------------------------
 3 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 949f7e0..dac6cb1 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -24,6 +24,7 @@
    (eval . (put 'guard 'scheme-indent-function 1))
    (eval . (put 'lambda* 'scheme-indent-function 1))
    (eval . (put 'substitute* 'scheme-indent-function 1))
+   (eval . (put 'match-record 'scheme-indent-function 2))
 
    ;; 'modify-phases' and its keywords.
    (eval . (put 'modify-phases 'scheme-indent-function 1))
diff --git a/doc/guix.texi b/doc/guix.texi
index f51593a..bde0b5d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9929,6 +9929,10 @@ The number of seconds of silence and the number of 
seconds of activity,
 respectively, after which a build process times out.  A value of zero
 disables the timeout.
 
address@hidden @code{log-compression} (default: @code{'bzip2})
+The type of compression used for build logs---one of @code{gzip},
address@hidden, or @code{none}.
+
 @item @code{extra-options} (default: @code{'()})
 List of extra command-line options for @command{guix-daemon}.
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index f4681c8..7c20232 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2015, 2016 Alex Kost <address@hidden>
 ;;; Copyright © 2015, 2016 Mark H Weaver <address@hidden>
 ;;; Copyright © 2015 Sou Bunnbu <address@hidden>
@@ -1438,6 +1438,8 @@ failed to register hydra.gnu.org public key: ~a~%" 
status))))))))
                     (default 0))
   (timeout          guix-configuration-timeout    ;integer
                     (default 0))
+  (log-compression  guix-configuration-log-compression
+                    (default 'bzip2))
   (extra-options    guix-configuration-extra-options ;list of strings
                     (default '()))
   (log-file         guix-configuration-log-file   ;string
@@ -1452,39 +1454,37 @@ failed to register hydra.gnu.org public key: ~a~%" 
status))))))))
 
 (define (guix-shepherd-service config)
   "Return a <shepherd-service> for the Guix daemon service with CONFIG."
-  (match config
-    (($ <guix-configuration> guix build-group build-accounts
-                             authorize-key? keys
-                             use-substitutes? substitute-urls
-                             max-silent-time timeout
-                             extra-options
-                             log-file http-proxy tmpdir)
-     (list (shepherd-service
-            (documentation "Run the Guix daemon.")
-            (provision '(guix-daemon))
-            (requirement '(user-processes))
-            (start
-             #~(make-forkexec-constructor
-                (list #$(file-append guix "/bin/guix-daemon")
-                      "--build-users-group" #$build-group
-                      "--max-silent-time" #$(number->string max-silent-time)
-                      "--timeout" #$(number->string timeout)
-                      #$@(if use-substitutes?
-                             '()
-                             '("--no-substitutes"))
-                      "--substitute-urls" #$(string-join substitute-urls)
-                      address@hidden)
-
-                #:environment-variables
-                (list #$@(if http-proxy
-                             (list (string-append "http_proxy=" http-proxy))
-                             '())
-                      #$@(if tmpdir
-                             (list (string-append "TMPDIR=" tmpdir))
-                             '()))
-
-                #:log-file #$log-file))
-            (stop #~(make-kill-destructor)))))))
+  (match-record config <guix-configuration>
+    (guix build-group build-accounts authorize-key? authorized-keys
+          use-substitutes? substitute-urls max-silent-time timeout
+          log-compression extra-options log-file http-proxy tmpdir)
+    (list (shepherd-service
+           (documentation "Run the Guix daemon.")
+           (provision '(guix-daemon))
+           (requirement '(user-processes))
+           (start
+            #~(make-forkexec-constructor
+               (list #$(file-append guix "/bin/guix-daemon")
+                     "--build-users-group" #$build-group
+                     "--max-silent-time" #$(number->string max-silent-time)
+                     "--timeout" #$(number->string timeout)
+                     "--log-compression" #$(symbol->string log-compression)
+                     #$@(if use-substitutes?
+                            '()
+                            '("--no-substitutes"))
+                     "--substitute-urls" #$(string-join substitute-urls)
+                     address@hidden)
+
+               #:environment-variables
+               (list #$@(if http-proxy
+                            (list (string-append "http_proxy=" http-proxy))
+                            '())
+                     #$@(if tmpdir
+                            (list (string-append "TMPDIR=" tmpdir))
+                            '()))
+
+               #:log-file #$log-file))
+           (stop #~(make-kill-destructor))))))
 
 (define (guix-accounts config)
   "Return the user accounts and user groups for CONFIG."



reply via email to

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