nix store delete/nix-store --delete cannot delete paths with self-references #494

Open
opened 2024-08-30 05:27:39 +00:00 by jade · 1 comment
Owner

Reproducer:

builtins.derivation {
  name = "undeletable";
  system = "x86_64-linux";
  builder = "/bin/sh";
  args = ["-c" "echo $out > $out"];
}
lix/lix3 » nix build -f undeletable.nix --print-out-paths --no-link
/nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable
lix/lix3 » nix-store --query --referrers /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable
/nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable
lix/lix3 » nix-store --query --roots /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable
removing stale link from '/nix/var/nix/gcroots/auto/s5n71qi0f9l7g1bg70b5wlz8c6yinvnr' to '/home/jade/lix/lix3/result'
lix/lix3 » nix store delete /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable
0 store paths deleted, 0.00 MiB freed
error: Cannot delete path '/nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable' since it is still alive. To find out why, use: nix-store --query --roots and nix-store --query --referrers

This is an instance of #282, probably not the only one.

nix store delete should just delete the path in such an instance, the "references" are nonsense.

Reproducer: ```nix builtins.derivation { name = "undeletable"; system = "x86_64-linux"; builder = "/bin/sh"; args = ["-c" "echo $out > $out"]; } ``` ``` lix/lix3 » nix build -f undeletable.nix --print-out-paths --no-link /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable lix/lix3 » nix-store --query --referrers /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable lix/lix3 » nix-store --query --roots /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable removing stale link from '/nix/var/nix/gcroots/auto/s5n71qi0f9l7g1bg70b5wlz8c6yinvnr' to '/home/jade/lix/lix3/result' lix/lix3 » nix store delete /nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable 0 store paths deleted, 0.00 MiB freed error: Cannot delete path '/nix/store/fy2kwhzh8xiiw5dx549i37nv9giyj1hj-undeletable' since it is still alive. To find out why, use: nix-store --query --roots and nix-store --query --referrers ``` This is an instance of https://git.lix.systems/lix-project/lix/issues/282, probably not the only one. `nix store delete` should just delete the path in such an instance, the "references" are nonsense.
jade added the
ux
bug
E/help wanted
labels 2024-08-30 05:27:40 +00:00
jade added the
Area/store
label 2024-08-30 05:55:32 +00:00
Author
Owner

Beware while fixing this: this might be more properly fixed by fixing the root cause, #495

Beware while fixing this: this might be more properly fixed by fixing the root cause, https://git.lix.systems/lix-project/lix/issues/495
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#494
No description provided.