On 02/15/2015 09:54 AM, James Cook wrote:
Hard linking is an impurity which can
cause bugs, as Wout pointed out at the start of the thread (e.g.
https://github.com/NixOS/nixpkgs/issues/4266).

Implementation question: how would nix know when it can delete a file
in /nix/store/.links?

If you can find some difference by looking at the files (to find if it shares some data), then it's an impurity. Maybe there are FS-specific tools for such queries; or we could maintain the information in some separate database, but that's probably too complex to be worth of implementing (from my point of view).

For anyone interested in space cost of /nix/store/.links on btrfs:
I just tried to remove my ~0.6 mil. links, which freed ~0.19 GB space of metadata (reported by btrfs fi df). That's fairly small amount compared to the total usage of ~80 GB; moreover it's on rotating HDD, so the difference should be even halved on an SSDs (no meta duplication in there by default).


Vladimir


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to