From 4fca02077c4cdea13d32b4665e817460f6502726 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 12 Sep 2012 18:49:35 -0400 Subject: Handle gc-keep-outputs and gc-keep-derivations both enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tests/multiple-outputs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/multiple-outputs.sh') diff --git a/tests/multiple-outputs.sh b/tests/multiple-outputs.sh index 07276bb66681..29af691ead6f 100644 --- a/tests/multiple-outputs.sh +++ b/tests/multiple-outputs.sh @@ -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 -- cgit 1.4.1