about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc12
-rw-r--r--src/libstore/misc.cc2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 39f6128aafd6..ce41752e6239 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -4166,10 +4166,20 @@ void Worker::markContentsGood(const Path & path)
 //////////////////////////////////////////////////////////////////////
 
 
+static void primeCache(Store & store, const PathSet & paths)
+{
+    PathSet willBuild, willSubstitute, unknown;
+    unsigned long long downloadSize, narSize;
+    store.queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
+}
+
+
 void LocalStore::buildPaths(const PathSet & drvPaths, BuildMode buildMode)
 {
     Worker worker(*this);
 
+    primeCache(*this, drvPaths);
+
     Goals goals;
     for (auto & i : drvPaths) {
         DrvPathWithOutputs i2 = parseDrvPathWithOutputs(i);
@@ -4220,6 +4230,8 @@ void LocalStore::ensurePath(const Path & path)
     /* If the path is already valid, we're done. */
     if (isValidPath(path)) return;
 
+    primeCache(*this, {path});
+
     Worker worker(*this);
     GoalPtr goal = worker.makeSubstitutionGoal(path);
     Goals goals = {goal};
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 8fa84d3a2787..a82aa4e9cfa5 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -107,6 +107,8 @@ void Store::queryMissing(const PathSet & targets,
     PathSet & willBuild_, PathSet & willSubstitute_, PathSet & unknown_,
     unsigned long long & downloadSize_, unsigned long long & narSize_)
 {
+    Activity act(*logger, lvlDebug, actUnknown, "querying info about missing paths");
+
     downloadSize_ = narSize_ = 0;
 
     ThreadPool pool;