about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2024-07-26T11·16+0000
committeredef <edef@edef.eu>2024-07-27T21·31+0000
commitf3c80c10b95b73ce4f9b334e3a9f2be128007fae (patch)
treec71472a79b671477b3af2c35b017526821c76a30 /tvix
parent0b987a509f189bb0b984c1b306a1b05e928b2296 (diff)
feat(tvix/tools/narinfo2parquet): preserve the deriver r/8417
Change-Id: Idbada585b87eef81cad5d40cb7592a7890704695
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12037
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/tools/narinfo2parquet/src/main.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/tvix/tools/narinfo2parquet/src/main.rs b/tvix/tools/narinfo2parquet/src/main.rs
index bbfa5c8c31e0..b96b134f103a 100644
--- a/tvix/tools/narinfo2parquet/src/main.rs
+++ b/tvix/tools/narinfo2parquet/src/main.rs
@@ -113,6 +113,9 @@ struct FrameBuilder {
     store_path_hash_str: StringChunkedBuilder,
     store_path_hash: BinaryChunkedBuilder,
     store_path_name: StringChunkedBuilder,
+    deriver_hash_str: StringChunkedBuilder,
+    deriver_hash: BinaryChunkedBuilder,
+    deriver_name: StringChunkedBuilder,
     nar_hash: BinaryChunkedBuilder,
     nar_size: PrimitiveChunkedBuilder<UInt64Type>,
     references: ListBinaryChunkedBuilder,
@@ -132,6 +135,9 @@ impl Default for FrameBuilder {
             store_path_hash_str: StringChunkedBuilder::new("store_path_hash_str", 0, 0),
             store_path_hash: BinaryChunkedBuilder::new("store_path_hash", 0, 0),
             store_path_name: StringChunkedBuilder::new("store_path_name", 0, 0),
+            deriver_hash_str: StringChunkedBuilder::new("deriver_hash_str", 0, 0),
+            deriver_hash: BinaryChunkedBuilder::new("deriver_hash", 0, 0),
+            deriver_name: StringChunkedBuilder::new("deriver_name", 0, 0),
             nar_hash: BinaryChunkedBuilder::new("nar_hash", 0, 0),
             nar_size: PrimitiveChunkedBuilder::new("nar_size", 0),
             references: ListBinaryChunkedBuilder::new("references", 0, 0),
@@ -158,10 +164,20 @@ impl FrameBuilder {
     fn push(&mut self, entry: &NarInfo) {
         self.store_path_hash_str
             .append_value(nixbase32::encode(entry.store_path.digest()));
-
         self.store_path_hash.append_value(entry.store_path.digest());
         self.store_path_name.append_value(entry.store_path.name());
 
+        if let Some(deriver) = &entry.deriver {
+            self.deriver_hash_str
+                .append_value(nixbase32::encode(deriver.digest()));
+            self.deriver_hash.append_value(deriver.digest());
+            self.deriver_name.append_value(deriver.name());
+        } else {
+            self.deriver_hash_str.append_null();
+            self.deriver_hash.append_null();
+            self.deriver_name.append_null();
+        }
+
         self.nar_hash.append_value(&entry.nar_hash);
         self.nar_size.append_value(entry.nar_size);
 
@@ -228,6 +244,9 @@ impl FrameBuilder {
             "store_path_hash_str" => self.store_path_hash_str.finish().into_series(),
             "store_path_hash" => self.store_path_hash.finish().into_series(),
             "store_path_name" => self.store_path_name.finish().into_series(),
+            "deriver_hash_str" => self.deriver_hash_str.finish().into_series(),
+            "deriver_hash" => self.deriver_hash.finish().into_series(),
+            "deriver_name" => self.deriver_name.finish().into_series(),
             "nar_hash" => self.nar_hash.finish().into_series(),
             "nar_size" => self.nar_size.finish().into_series(),
             "references" => self.references.finish().into_series(),