1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

Progress indicator: Cleanup

This commit is contained in:
Eelco Dolstra 2017-08-16 16:38:23 +02:00
parent dff12b38f9
commit 40bffe0a43
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 105 additions and 151 deletions

View file

@ -335,8 +335,8 @@ public:
{
actDerivations.progress(doneBuilds, expectedBuilds + doneBuilds, runningBuilds, failedBuilds);
actSubstitutions.progress(doneSubstitutions, expectedSubstitutions + doneSubstitutions, runningSubstitutions, failedSubstitutions);
logger->event(evSetExpected, act, actDownload, expectedDownloadSize + doneDownloadSize);
logger->event(evSetExpected, act, actCopyPath, expectedNarSize + doneNarSize);
act.setExpected(actDownload, expectedDownloadSize + doneDownloadSize);
act.setExpected(actCopyPath, expectedNarSize + doneNarSize);
}
};
@ -1386,7 +1386,7 @@ void DerivationGoal::tryToBuild()
bool buildLocally = buildMode != bmNormal || drv->willBuildLocally();
auto started = [&]() {
act = std::make_unique<Activity>(actBuild, fmt("building '%s'", drvPath));
act = std::make_unique<Activity>(*logger, actBuild, fmt("building '%s'", drvPath));
mcRunningBuilds = std::make_unique<MaintainCount<uint64_t>>(worker.runningBuilds);
worker.updateProgress();
};
@ -3257,7 +3257,7 @@ void DerivationGoal::flushLine()
logTail.push_back(currentLogLine);
if (logTail.size() > settings.logLines) logTail.pop_front();
}
logger->event(evBuildOutput, *act, currentLogLine);
act->progress(currentLogLine);
currentLogLine = "";
currentLogLinePos = 0;
}
@ -3647,9 +3647,9 @@ static bool working = false;
Worker::Worker(LocalStore & store)
: act(actRealise)
, actDerivations(actBuilds)
, actSubstitutions(actCopyPaths)
: act(*logger, actRealise)
, actDerivations(*logger, actBuilds)
, actSubstitutions(*logger, actCopyPaths)
, store(store)
{
/* Debugging: prevent recursive workers. */