mirror of
https://github.com/NixOS/nix
synced 2025-07-01 12:37:59 +02:00
Add option ‘build-keep-log’ to enable/disable writing of build logs
Fixes #26.
This commit is contained in:
parent
8058dab26e
commit
2c26985835
3 changed files with 36 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue