nix-store --delete is intended to gc closures and simply does not do that #495

Closed
opened 2024-08-30 05:50:27 +00:00 by jade · 3 comments
Owner

If we look at the code for the garbage collector, we observe that it is actually supposed to delete the referrers:

https://git.lix.systems/lix-project/lix/src/370ac940dd7816ad4052fafa4e0f8d17784fa16b/src/libstore/gc.cc#L750-L760

This is also somewhat of a root cause of the UX issue in #282. That UX issue is still real, but it appears that this entire command is actually broken and not working as designed.

If we look at the code for the garbage collector, we observe that it is actually supposed to delete the referrers: https://git.lix.systems/lix-project/lix/src/370ac940dd7816ad4052fafa4e0f8d17784fa16b/src/libstore/gc.cc#L750-L760 This is also somewhat of a root cause of the UX issue in https://git.lix.systems/lix-project/lix/issues/282. That UX issue is still real, but it appears that this *entire command* is actually *broken* and not working as designed.
Author
Owner

this rings a bell but I'm not sure what about. it might be fixed, but i have no evidence.

this rings a bell but I'm not sure what about. it might be fixed, but i have no evidence.
Member

This issue was mentioned on Gerrit on the following CLs:

  • comment in cl/2783 ("libstore/gc: restore deletion of referrers")
  • commit message in cl/2786 ("libstore/gc: restore deletion of referrers")
  • commit message in cl/2783 ("libstore/gc: restore deletion of referrers")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2783", "number": 2783, "kind": "comment"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/2786", "number": 2786, "kind": "commit message"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/2783", "number": 2783, "kind": "commit message"}], "cl_meta": {"2783": {"change_title": "libstore/gc: restore deletion of referrers"}, "2786": {"change_title": "libstore/gc: restore deletion of referrers"}}} --> This issue was mentioned on Gerrit on the following CLs: * comment in [cl/2783](https://gerrit.lix.systems/c/lix/+/2783) ("libstore/gc: restore deletion of referrers") * commit message in [cl/2786](https://gerrit.lix.systems/c/lix/+/2786) ("libstore/gc: restore deletion of referrers") * commit message in [cl/2783](https://gerrit.lix.systems/c/lix/+/2783) ("libstore/gc: restore deletion of referrers")

I think this is a misreading of the code, the check that was preventing this was introduced at the same time as the deleteReferrersClosure function, in github.com/NixOS/nix@eab934cb2a (diff-07fc1ace3). I think the function name is meant only that it will try to delete referrers, if they're in the pathsToDelete or you're performing a garbage collection.

@lheckemann

I think this is a misreading of the code, the check that was preventing this was introduced at the same time as the `deleteReferrersClosure` function, in https://github.com/NixOS/nix/commit/eab934cb2a23595a7ac7c8a72373cd8096b606a9#diff-07fc1ace31833e9e15b43ff87b2e44726feba7431c541de3662e77220bb8698fR727. I think the function name is meant only that it will try to delete referrers, if they're in the `pathsToDelete` or you're performing a garbage collection. @lheckemann
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
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#495
No description provided.