diff options
-rw-r--r-- | src/libnix/exec.cc | 8 | ||||
-rw-r--r-- | src/libnix/exec.hh | 3 | ||||
-rw-r--r-- | src/libnix/normalise.cc | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/libnix/exec.cc b/src/libnix/exec.cc index a51b605d8100..4934712f9e4e 100644 --- a/src/libnix/exec.cc +++ b/src/libnix/exec.cc @@ -16,14 +16,14 @@ static string pathNullDevice = "/dev/null"; /* Run a program. */ void runProgram(const string & program, - const Strings & args, const Environment & env) + const Strings & args, const Environment & env, + const string & logFileName) { /* Create a log file. */ - string logFileName = nixLogDir + "/run.log"; string logCommand = verbosity >= lvlDebug - ? "tee -a " + logFileName + " >&2" - : "cat >> " + logFileName; + ? "tee " + logFileName + " >&2" + : "cat > " + logFileName; /* !!! auto-pclose on exit */ FILE * logFile = popen(logCommand.c_str(), "w"); /* !!! escaping */ if (!logFile) diff --git a/src/libnix/exec.hh b/src/libnix/exec.hh index 8d410e404383..fc5bd6ac8d0b 100644 --- a/src/libnix/exec.hh +++ b/src/libnix/exec.hh @@ -15,7 +15,8 @@ typedef map<string, string> Environment; /* Run a program. */ void runProgram(const string & program, - const Strings & args, const Environment & env); + const Strings & args, const Environment & env, + const string & logFileName); #endif /* !__EXEC_H */ diff --git a/src/libnix/normalise.cc b/src/libnix/normalise.cc index 196fcad2e92c..0ce38d68a88f 100644 --- a/src/libnix/normalise.cc +++ b/src/libnix/normalise.cc @@ -164,7 +164,8 @@ Path normaliseNixExpr(const Path & _nePath, PathSet pending) /* Run the builder. */ msg(lvlChatty, format("building...")); - runProgram(ne.derivation.builder, ne.derivation.args, env); + runProgram(ne.derivation.builder, ne.derivation.args, env, + nixLogDir + "/" + baseNameOf(nePath)); msg(lvlChatty, format("build completed")); } else |