From eb84898c177b5c4157efebc44c56459b9cf1ccf7 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 22 Nov 2023 20:11:22 +0200 Subject: feat(nix-compat/narinfo): drop .drv from Narinfo.deriver field We always know this needs to end with a .drv, and fail parsing if it doesn't, so there's no need to hang onto these 4 bytes. This will make it much easier to synthesize a NarInfo<'_> later on from a PathInfo proto, because we don't have to make this ".drv" appear out of thin air. Change-Id: Id95e7fd937d7c9a420a39b5a4bab73985640ca3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/10084 Tested-by: BuildkiteCI Reviewed-by: edef Reviewed-by: raitobezarius Autosubmit: flokli --- tvix/store/src/proto/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tvix/store') diff --git a/tvix/store/src/proto/mod.rs b/tvix/store/src/proto/mod.rs index 558d7bc2831d..3e14f26e2761 100644 --- a/tvix/store/src/proto/mod.rs +++ b/tvix/store/src/proto/mod.rs @@ -212,10 +212,7 @@ impl From<&nix_compat::narinfo::NarInfo<'_>> for NarInfo { signatures, reference_names: value.references.iter().map(|r| r.to_string()).collect(), deriver: value.deriver.as_ref().map(|sp| StorePath { - // The parser already errors out with an error if the .drv suffix was missing, - // so you can only miss the suffix if you're manually constructing, - // which means we can unwrap here. - name: sp.name().strip_suffix(".drv").unwrap().to_owned(), + name: sp.name().to_owned(), digest: Bytes::copy_from_slice(sp.digest()), }), ca, -- cgit 1.4.1