From 2c26985835cf82ed5d2979c3a400f72f6aeba32f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 May 2012 16:42:05 -0400 Subject: Add option ‘build-keep-log’ to enable/disable writing of build logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #26. --- src/libstore/build.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 789a7f617c2c..985ea5e98e05 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2032,6 +2032,8 @@ string drvsLogDir = "drvs"; Path DerivationGoal::openLogFile() { + if (!queryBoolSetting("build-keep-log", true)) return ""; + /* Create a log file. */ Path dir = (format("%1%/%2%") % nixLogDir % drvsLogDir).str(); createDirs(dir); @@ -2071,7 +2073,8 @@ void DerivationGoal::handleChildOutput(int fd, const string & data) { if (verbosity >= buildVerbosity) writeToStderr((unsigned char *) data.data(), data.size()); - writeFull(fdLogFile, (unsigned char *) data.data(), data.size()); + if (fdLogFile != -1) + writeFull(fdLogFile, (unsigned char *) data.data(), data.size()); } if (hook && fd == hook->fromHook.readSide) -- cgit 1.4.1