mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Handle gc-keep-outputs and gc-keep-derivations both enabled
If the options gc-keep-outputs and gc-keep-derivations are both enabled, you can get a cycle in the liveness graph. There was a hack to handle this, but it didn't work with multiple-output derivations, causing the garbage collector to fail with errors like ‘error: cannot delete path `...' because it is in use by `...'’. The garbage collector now handles strongly connected components in the liveness graph as a unit and decides whether to delete all or none of the paths in an SCC.
This commit is contained in:
parent
479e9172b3
commit
4fca02077c
2 changed files with 101 additions and 96 deletions
|
@ -55,4 +55,6 @@ if nix-build multiple-outputs.nix -A cyclic --no-out-link; then
|
|||
fi
|
||||
|
||||
echo "collecting garbage..."
|
||||
nix-store --gc
|
||||
rm $TEST_ROOT/result*
|
||||
nix-store --gc --option gc-keep-derivations true --option gc-keep-outputs true
|
||||
nix-store --gc --print-roots
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue