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.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index dbfde447e48b..881f2dac8899 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1329,7 +1329,8 @@ void SubstitutionGoal::init()
 
     for (PathSet::iterator i = references.begin();
          i != references.end(); ++i)
-        addWaitee(worker.makeSubstitutionGoal(*i));
+        if (*i != storePath) /* ignore self-references */
+            addWaitee(worker.makeSubstitutionGoal(*i));
 
     if (waitees.empty()) /* to prevent hang (no wake-up event) */
         referencesValid();
@@ -1347,7 +1348,8 @@ void SubstitutionGoal::referencesValid()
 
     for (PathSet::iterator i = references.begin();
          i != references.end(); ++i)
-        assert(isValidPath(*i));
+        if (*i != storePath) /* ignore self-references */
+            assert(isValidPath(*i));
     
     tryNext();
 }