about summary refs log tree commit diff
path: root/tvix/nix-compat/src/derivation
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-21T14·29+0200
committerclbot <clbot@tvl.fyi>2023-12-21T16·28+0000
commit9065089b0c4b16237cacf7c0878779cffb7f520f (patch)
treed7a210dce95aa47cabf759cefea675d81b4ccc3a /tvix/nix-compat/src/derivation
parentea8fdb9304f17beb6d967ddaf8913512732e3432 (diff)
refactor(tvix/nix-compat): have helpers interact with StorePathRef r/7236
In most case, we don't actually need an owned `StorePath` struct, but a
`StorePathRef<'_>` is sufficient. The lifetime is only due to it holding
onto the name, but that one is mostly left untouched.

`Derivation::calculate_derivation_path` still needs to return
`StorePath`, as its name has a `.drv` appended.

Change-Id: Ie0d52f369d785711bb0658ea2b0bd2617fd9f45e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10389
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Diffstat (limited to 'tvix/nix-compat/src/derivation')
-rw-r--r--tvix/nix-compat/src/derivation/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tvix/nix-compat/src/derivation/mod.rs b/tvix/nix-compat/src/derivation/mod.rs
index d62a339b77..b3f3adc55b 100644
--- a/tvix/nix-compat/src/derivation/mod.rs
+++ b/tvix/nix-compat/src/derivation/mod.rs
@@ -115,6 +115,7 @@ impl Derivation {
         };
 
         build_text_path(name, self.to_aterm_bytes(), references)
+            .map(|s| s.to_owned())
             .map_err(|_e| DerivationError::InvalidOutputName(name.to_string()))
     }