nix-store --delete doesn't work on binary caches
@shlevy is already working on this.
Since Apr 1, 2018.
- Dominant language
- C++
- Stars
- 17.7k
- Forks
- 2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 80
Description
Currently there is no real way to manage the size of a binary cache. The functionality required to enable this use case is NIX_REMOTE=file:///path/to/binary/cache nix-store --delete <path>, which currently returns: error: requested operation is not supported by store.
Not all of us who host nix channels and binary caches have infinite storage.
To implement this effectively, support for the operation nix-store --query --referrers will also have to be implemented for binary caches, since nix-store --delete needs to fail if you attempt to delete something that is referred to by another path in the store.
It seems like this should be really easy to implement: to implement --query --referrers, search for the path reference in all of the .narinfo files, and return the ones that contain it. To implement --delete, first check that there are no referrers, and then delete the .narinfo and the .nar if there are none.
I would implement this but I suck at writing C++.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.