Merge pull request #2338 from bobvanderlinden/pr-cannot-delete-alive-why

mention `nix-store --query --roots` when a path cannot be deleted
This commit is contained in:
Domen Kožar 2019-09-30 14:06:52 +02:00 committed by GitHub
commit 2d2769f68c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -783,7 +783,11 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
assertStorePath(i);
tryToDelete(state, i);
if (state.dead.find(i) == state.dead.end())
throw Error(format("cannot delete path '%1%' since it is still alive") % i);
throw Error(format(
"cannot delete path '%1%' since it is still alive. "
"To find out why use: "
"nix-store --query --roots"
) % i);
}
} else if (options.maxFreed > 0) {