From 29a686688674dc875775305312513405fa396a06 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Jan 2018 17:15:41 +0100 Subject: 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. --- nix/libstore/globals.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nix/libstore/globals.cc') diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc index 65dad24d91..82d528dc98 100644 --- a/nix/libstore/globals.cc +++ b/nix/libstore/globals.cc @@ -45,7 +45,7 @@ Settings::Settings() useSshSubstituter = false; impersonateLinux26 = false; keepLog = true; - compressLog = true; + logCompression = COMPRESSION_BZIP2; maxLogSize = 0; cacheFailure = false; pollInterval = 5; @@ -162,7 +162,7 @@ void Settings::update() _get(useChroot, "build-use-chroot"); _get(impersonateLinux26, "build-impersonate-linux-26"); _get(keepLog, "build-keep-log"); - _get(compressLog, "build-compress-log"); + // _get(logCompression, "build-log-compression"); _get(maxLogSize, "build-max-log-size"); _get(cacheFailure, "build-cache-failure"); _get(pollInterval, "build-poll-interval"); -- cgit v1.2.3