diff options
author | Marijan Petričević <marijan.petricevic94@gmail.com> | 2024-10-10T14·11-0500 |
---|---|---|
committer | Marijan Petričević <marijan.petricevic94@gmail.com> | 2024-10-11T17·18+0000 |
commit | e8040ec61f2119ece2d396704576973f704607f3 (patch) | |
tree | 94caa469edb4b6c5534eb19a9683d786f9b7e5bf /tvix/docs | |
parent | b4ccaac7ad135249eb0b1866acf4c8e68fd5bdb9 (diff) |
refactor(tvix/store): use strictly typed PathInfo struct r/8787
This switches the PathInfoService trait from using the proto-derived PathInfo struct to a more restrictive struct, and updates all implementations to use it. It removes a lot of the previous conversion and checks, as invalid states became nonrepresentable, and validations are expressed on the type level. PathInfoService implementations consuming protobuf need to convert and do the verification internally, and can only return the strongly typed variant. The nix_compat::narinfo::NarInfo conversions for the proto PathInfo are removed, we only keep a version showing a NarInfo representation for the strong struct. Converting back to a PathInfo requires the root node now, but is otherwise trivial, so left to the users. Co-Authored-By: Florian Klink <flokli@flokli.de> Change-Id: I6fdfdb44063efebb44a8f0097b6b81a828717e03 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12588 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/docs')
-rw-r--r-- | tvix/docs/src/TODO.md | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tvix/docs/src/TODO.md b/tvix/docs/src/TODO.md index 7ed20758122a..e3f867e11ac2 100644 --- a/tvix/docs/src/TODO.md +++ b/tvix/docs/src/TODO.md @@ -136,22 +136,6 @@ Similarly, we also don't properly populate the build environment for `fetchClosure` yet. (Note there already is `ExportedPathInfo`, so once `structuredAttrs` is there this should be easy. -### PathInfo Data types -Similar to the refactors done in tvix-castore, we want a stricter type for -PathInfo, and use the `tvix_castore::nodes::Node` type we now have as the root -node. - -This allows removing some checks, conversions and handling for invalid data in -many different places in different store implementations. - -Steps: - - - Define the stricter `PathInfo` type - - Update the `PathInfoService` trait to use the stricter types - - Update the grpc client impl to convert from the proto types to the - stricter types (and reject invalid ones) - - Update the grpc server wrapper to convert to the proto types - ### PathInfo: include references by content In the PathInfo struct, we currently only store references by their names and store path hash. Getting the castore node for the content at that store path |