diff --git a/doc/manual/conf-file.xml b/doc/manual/conf-file.xml
index 1e164b823..25a009de9 100644
--- a/doc/manual/conf-file.xml
+++ b/doc/manual/conf-file.xml
@@ -276,6 +276,18 @@ build-use-chroot = /dev /proc /bin
+ build-keep-log
+
+ If set to true (the default),
+ Nix will write the build log of a derivation (i.e. the standard
+ output and error of its builder) to the directory
+ /nix/var/log/nix/drvs. The build log can be
+ retrieved using the command nix-store -l
+ path.
+
+
+
+
system
This option specifies the canonical Nix system
diff --git a/doc/manual/release-notes.xml b/doc/manual/release-notes.xml
index 1c2a52d56..3250c81a4 100644
--- a/doc/manual/release-notes.xml
+++ b/doc/manual/release-notes.xml
@@ -6,6 +6,26 @@
+
+
+Release 1.1 (TBA)
+
+This release has the following improvements:
+
+
+
+
+ The creation of build logs in
+ /nix/var/log/nix/drvs can be disabled by
+ setting the new option build-keep-log to
+ false
+
+
+
+
+
+
+
Release 1.0 (May 11, 2012)
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 789a7f617..985ea5e98 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)