Don't register invalid paths as GC roots

Unfortunately this doesn't work. Maybe we should keep separate roots
for each path.
This commit is contained in:
Eelco Dolstra 2019-06-04 20:34:08 +02:00
parent 4ec1a9ab40
commit 45b5c606ac
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -207,11 +207,16 @@ void makeFlakeClosureGCRoot(Store & store,
/* Note: due to lazy fetching, these paths might not exist
yet. */
for (auto & dep : flake.flakeInputs) {
closure.insert(dep.second.computeStorePath(store));
auto path = dep.second.computeStorePath(store);
if (store.isValidPath(path))
closure.insert(path);
queue.push(dep.second);
}
for (auto & dep : flake.nonFlakeInputs)
closure.insert(dep.second.computeStorePath(store));
for (auto & dep : flake.nonFlakeInputs) {
auto path = dep.second.computeStorePath(store);
if (store.isValidPath(path))
closure.insert(path);
}
}
if (closure.empty()) return;