about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 7be1571cbb16..9316c069eaa0 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -3132,6 +3132,11 @@ void SubstitutionGoal::tryNext()
     sub = subs.front();
     subs.pop_front();
 
+    if (sub->storeDir != worker.store.storeDir) {
+        tryNext();
+        return;
+    }
+
     try {
         // FIXME: make async
         info = sub->queryPathInfo(storePath);