feat(tvix/store): add NARCalculationService trait and impl

This adds a NARCalculationService trait, which will take a root node,
and provide a proto::CalculateNarResponse in return.

It also adds a NonCachingNARCalculationService implementation, that will
simply always render the NAR in memory to calculate the size and sha256,
without any caching.

Change-Id: Id1ffb18559212fa6001f70f2634bbc3dfd0aa343
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8096
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2023-02-13 16:47:22 +01:00 committed by flokli
parent ab02fc668c
commit 419f7d0f0c
5 changed files with 98 additions and 4 deletions

View file

@ -1246,6 +1246,21 @@ rec {
];
};
"count-write" = rec {
crateName = "count-write";
version = "0.1.0";
edition = "2018";
sha256 = "11bswmgr81s3jagdci1pr6qh9vnz9zsbbf2dqpi260daa2mhgmff";
authors = [
"SOFe <sofe2038@gmail.com>"
];
features = {
"futures" = [ "futures-io-preview" ];
"futures-io-preview" = [ "dep:futures-io-preview" ];
"tokio" = [ "tokio-io" ];
"tokio-io" = [ "dep:tokio-io" ];
};
};
"countme" = rec {
crateName = "countme";
version = "3.0.1";
@ -8252,6 +8267,10 @@ rec {
packageId = "clap 4.1.4";
features = [ "derive" "env" ];
}
{
name = "count-write";
packageId = "count-write";
}
{
name = "data-encoding";
packageId = "data-encoding";
@ -8272,6 +8291,10 @@ rec {
name = "prost";
packageId = "prost";
}
{
name = "sha2";
packageId = "sha2 0.10.6";
}
{
name = "sled";
packageId = "sled";