Nix: Tell user why a given path is live when it can't be deleted (continued from #171)

Created on 20 Jan 2018  路  4Comments  路  Source: NixOS/nix

Continuation of #171 (due to https://github.com/NixOS/nix/issues/171#issuecomment-359180537).

CC subscribers from over there: @shlevy @jb55 @qknight @nh2 @edolstra

Original problem:


$ nix-store --delete  /nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc
finding garbage collector roots...
error: cannot delete path `/nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc' since it is still alive
0 store paths deleted, 0.00 MiB freed

And

$ nix-store -q --roots  /nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc
/nix/var/nix/profiles/system-53-link`

Would be nice if instead the first command output:

$ nix-store --delete  /nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc
finding garbage collector roots...
error: cannot delete path `/nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc' since it is still alive (reachable from /nix/var/nix/profiles/system-53-link)
0 store paths deleted, 0.00 MiB freed
UX improvement

Most helpful comment

Hello,

I am looking for an excuse to dive in the nix-store garbage collector code. I'm fixing this one if it's ok with @shlevy :)

All 4 comments

Hello,

I am looking for an excuse to dive in the nix-store garbage collector code. I'm fixing this one if it's ok with @shlevy :)

@NinjaTrappeur looks like you already got steps in the right direction. What is the current status? Did you run into a problem? Can I help get this merged into Nix?

Hey @bobvanderlinden ,

So, I made a UI proposal there, and tested it a bit in order to spot obvious regressions.

I am waiting for some feedback. Both for the feature by itself as well as for the code.

For me it was because it was still used by direnv (with use nix), and I imported the package in my shell.nix. I forget sometimes that direnv is on the background.

Just sharing my finding. Hope it helps someone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewbauer picture matthewbauer  路  3Comments

dasJ picture dasJ  路  3Comments

vizanto picture vizanto  路  3Comments

eqyiel picture eqyiel  路  3Comments

luc65r picture luc65r  路  3Comments