guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

add-to-store, add-text-to-store, and store path hash parts


From: Caleb Ristvedt
Subject: add-to-store, add-text-to-store, and store path hash parts
Date: Sun, 12 May 2019 15:54:39 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

I'm currently focusing on two particular RPCs that we use, addToStore
and addTextToStore. In the Nix thesis I only see reference to
addToStore. What's the difference between the two? I see that
addTextToStore allows specifying references while addToStore doesn't,
and addTextToStore is specifically for regular files. What's the
motivation for the split? Additionally, the hash part of the resulting
path is computed differently for addTextToStore, addToStore, and
addToStore with recursive set. This means that there could be three
regular files with the exact same contents and the exact same name, but
different hash parts. It doesn't violate any store invariants or
anything, of course, but I'm wondering why it's done.

Especially puzzling to me is what the purpose of the recursive flag is
for addToStore. It causes the path hash to be calculated differently and
makes sure that non-regular files cause errors, but why?

Thanks in advance for any answers y'all can give.

- reepca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]