From 979a019014569eee7d0071605f6ff500b544f6ac Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 17 May 2024 18:18:38 +0200 Subject: [PATCH] Improve nix-store --delete failure message On several occasions I've found myself confused when trying to delete a store path, because I am told it's still alive, but nix-store --query --roots doesn't show anything. Let's save future users this confusion by mentioning that a path might be alive due to having referrers, not just roots. --- src/libstore/gc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 8286dff27..d3fa88f59 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -781,7 +781,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) throw Error( "Cannot delete path '%1%' since it is still alive. " "To find out why, use: " - "nix-store --query --roots", + "nix-store --query --roots and nix-store --query --referrers", printStorePath(i)); }