1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 11:11:03 -04:00

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 /* Note: due to lazy fetching, these paths might not exist
yet. */ yet. */
for (auto & dep : flake.flakeInputs) { 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); queue.push(dep.second);
} }
for (auto & dep : flake.nonFlakeInputs) for (auto & dep : flake.nonFlakeInputs) {
closure.insert(dep.second.computeStorePath(store)); auto path = dep.second.computeStorePath(store);
if (store.isValidPath(path))
closure.insert(path);
}
} }
if (closure.empty()) return; if (closure.empty()) return;