1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

Fix GC when there are cycles in the referrers graph

(where "referrers" includes the reverse of derivation outputs and
derivers). Now we do a full traversal to look if we can reach any
root. If not, all paths reached can be deleted.
This commit is contained in:
Eelco Dolstra 2021-10-08 16:58:19 +02:00
parent e31a48366f
commit 35c98a59c5
2 changed files with 45 additions and 34 deletions

View file

@ -240,11 +240,10 @@ private:
struct GCState;
bool tryToDelete(
bool canReachRoot(
GCState & state,
StorePathSet & visited,
const StorePath & path,
bool recursive);
const StorePath & path);
void deleteFromStore(GCState & state, std::string_view baseName);