From 05e44c121d25575e17ded0f6b407347e4b987d0d Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 25 Jul 2020 18:44:37 -0400 Subject: feat(3p/nix): Implement AddToStore proto handler Implement the proto handler for AddToStore, which adds a nix path to the store. This is implemented by adding a new (probably soon-to-be-generalized) Source concretion that wraps a grpc ServerReader for the stream of data we're receiving from the client - this is less than ideal, as it's perpetuating the source/sink thing that's going on and storing entire nars in memory, but is at the very worst an incremental step towards a functioning nix that we can refactor in the future. Paired-With: Perry Lorier Paired-With: Vincent Ambo Change-Id: I48db734e7460a47aee4a85dd5137b690980859e3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1441 Tested-by: BuildkiteCI Reviewed-by: kanepyork Reviewed-by: tazjin --- third_party/nix/src/libstore/store-api.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/libstore') diff --git a/third_party/nix/src/libstore/store-api.hh b/third_party/nix/src/libstore/store-api.hh index f5076e458d..327a08c852 100644 --- a/third_party/nix/src/libstore/store-api.hh +++ b/third_party/nix/src/libstore/store-api.hh @@ -408,9 +408,10 @@ class Store : public std::enable_shared_from_this, public Config { std::shared_ptr accessor = 0); /* Copy the contents of a path to the store and register the - validity the resulting path. The resulting path is returned. + validity of the resulting path. The resulting path is returned. The function object `filter' can be used to exclude files (see - libutil/archive.hh). */ + libutil/archive.hh). If recursive is set to true, the path will be treated + as a directory (eg cp -r vs cp) */ virtual Path addToStore(const std::string& name, const Path& srcPath, bool recursive = true, HashType hashAlgo = htSHA256, PathFilter& filter = defaultPathFilter, -- cgit 1.4.1