feat(tvix): Implement AddToStoreNar

Implement both the client and server sides of AddToStoreNar, using a
templated generalization of the sources and sinks we were using for
AddToStore on both ends.

Change-Id: I73d0ed34118c711b125851dff99a7518ced4af35
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1686
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
This commit is contained in:
Griffin Smith 2020-08-05 22:46:21 -04:00 committed by glittershark
parent cc01059d40
commit 7db734afad
4 changed files with 129 additions and 33 deletions

View file

@ -33,6 +33,8 @@ service WorkerService {
rpc EnsurePath(StorePath) returns (google.protobuf.Empty);
// TODO: What does this do?
// TODO(grfn): This should not actually take a StorePath, as it's not a
// StorePath
rpc AddTempRoot(StorePath) returns (google.protobuf.Empty);
// TODO: What does this do?
@ -260,6 +262,10 @@ message PathInfo {
repeated string sigs = 7;
// If non-empty, an assertion that the path is content-addressed
string ca = 8;
// Only used for AddToStoreNarRequest
bool repair = 12;
bool check_sigs = 13;
}
message SubstitutablePathInfos {
@ -318,9 +324,9 @@ message AddSignaturesRequest {
}
message AddToStoreNarRequest {
oneof add_oneoff {
oneof add_oneof {
PathInfo path_info = 1;
bytes chunk = 2;
bytes data = 2;
}
}