summary refs log tree commit diff
path: root/nix/libstore/globals.hh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-01-05 17:15:41 +0100
committerLudovic Courtès <ludo@gnu.org>2018-01-07 23:47:22 +0100
commit29a686688674dc875775305312513405fa396a06 (patch)
tree9e5f286444b8e663f3f99503c8bdc526aeb67c14 /nix/libstore/globals.hh
parent896fec476f728183b331cbb6e2afb891207b4205 (diff)
downloadguix-29a686688674dc875775305312513405fa396a06.tar.gz
daemon: Add gzip log compression.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_LOG_COMPRESSION): New macro.
(options): Mark "disable-log-compression" as hidden and add
"log-compression".
(parse_opt): Handle GUIX_OPT_LOG_COMPRESSION.
* nix/libstore/build.cc (DerivationGoal): Add 'gzLogFile'.
(openLogFile): Initialize it when 'logCompression' is COMPRESSION_GZIP.
(closeLogFile, handleChildOutput): Honor 'gzLogFile'.
* nix/libstore/globals.hh (Settings)[compressLog]: Remove.
[logCompression]: New field.
(CompressionType): New enum.
* nix/libstore/globals.cc (Settings::Settings): Initialize it.
(update): Remove '_get' call for 'compressLog'.
* nix/local.mk (guix_daemon_LDADD, guix_register_LDADD): Add -lz.
* guix/store.scm (log-file): Handle '.gz' log files.
* tests/guix-daemon.sh: Add test with '--log-compression=gzip'.
* doc/guix.texi (Invoking guix-daemon): Adjust accordingly.
* config-daemon.ac: Check for libz and zlib.h.
Diffstat (limited to 'nix/libstore/globals.hh')
-rw-r--r--nix/libstore/globals.hh8
1 files changed, 7 insertions, 1 deletions
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index 7beb1a55ca..81cf2f52d4 100644
--- a/nix/libstore/globals.hh
+++ b/nix/libstore/globals.hh
@@ -8,6 +8,12 @@
 
 namespace nix {
 
+enum CompressionType
+{
+    COMPRESSION_NONE = 0,
+    COMPRESSION_GZIP = 1,
+    COMPRESSION_BZIP2 = 2
+};
 
 struct Settings {
 
@@ -169,7 +175,7 @@ struct Settings {
     bool keepLog;
 
     /* Whether to compress logs. */
-    bool compressLog;
+    enum CompressionType logCompression;
 
     /* Maximum number of bytes a builder can write to stdout/stderr
        before being killed (0 means no limit). */