diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 62a03f751a..e8a70296fd 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2810,12 +2810,12 @@ void SubstitutionGoal::finished() return; } - canonicalisePathMetaData(destPath, -1); - - worker.store.optimisePath(destPath); // FIXME: combine with hashPath() - if (repair) replaceValidPath(storePath, destPath); + canonicalisePathMetaData(storePath, -1); + + worker.store.optimisePath(storePath); // FIXME: combine with hashPath() + ValidPathInfo info2; info2.path = storePath; info2.hash = hash.first;