aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc14
-rw-r--r--src/libstore/download.cc2
-rw-r--r--src/libstore/store-api.cc7
3 files changed, 11 insertions, 12 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 257f02a49..1a1fc1dee 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -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. */
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 9ac4a65d5..71b720a3b 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -85,7 +85,7 @@ struct CurlDownloader : public Downloader
DownloadItem(CurlDownloader & downloader, const DownloadRequest & request)
: downloader(downloader)
, request(request)
- , act(actDownload, fmt("downloading '%s'", request.uri))
+ , act(*logger, actDownload, fmt("downloading '%s'", request.uri))
{
if (!request.expectedETag.empty())
requestHeaders = curl_slist_append(requestHeaders, ("If-None-Match: " + request.expectedETag).c_str());
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 5aa3dcfd2..f52021061 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -565,7 +565,7 @@ void Store::buildPaths(const PathSet & paths, BuildMode buildMode)
void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
const Path & storePath, RepairFlag repair, CheckSigsFlag checkSigs)
{
- Activity act(actCopyPath, fmt("copying path '%s'", storePath));
+ Activity act(*logger, actCopyPath, fmt("copying path '%s'", storePath));
auto info = srcStore->queryPathInfo(storePath);
@@ -621,7 +621,7 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
for (auto & path : storePaths)
if (!valid.count(path)) missing.insert(path);
- Activity act(actCopyPaths, fmt("copying %d paths", missing.size()));
+ Activity act(*logger, actCopyPaths, fmt("copying %d paths", missing.size()));
std::atomic<size_t> nrDone{0};
std::atomic<uint64_t> bytesExpected{0};
@@ -646,7 +646,7 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
auto info = srcStore->queryPathInfo(storePath);
bytesExpected += info->narSize;
- logger->event(evSetExpected, act, actCopyPath, bytesExpected);
+ act.setExpected(actCopyPath, bytesExpected);
return info->references;
},
@@ -655,7 +655,6 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
checkInterrupt();
if (!dstStore->isValidPath(storePath)) {
- printInfo("copying '%s'...", storePath);
MaintainCount<decltype(nrRunning)> mc(nrRunning);
showProgress();
copyStorePath(srcStore, dstStore, storePath, repair, checkSigs);