about summary refs log tree commit diff
path: root/tvix/nix-compat/src/derivation/tests/mod.rs
diff options
context:
space:
mode:
authorPeter Kolloch <info@eigenvalue.net>2024-02-21T11·31+0700
committerclbot <clbot@tvl.fyi>2024-02-21T11·38+0000
commitfde488ec6dc444561ae353f979d87c8ae87261fb (patch)
treec9b673d9d0fc19709f61c88ceb59092f11d7facd /tvix/nix-compat/src/derivation/tests/mod.rs
parent035f617b7f11f2ec4a9e08e3a31a175e71a6544b (diff)
feat(tvix/nix-compat): Use `StorePath` in `Output` r/7585
https: //b.tvl.fyi/issues/264
Change-Id: Icb09be9643245cc68d09f01d7723af2d44d6bd1a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11001
Autosubmit: Peter Kolloch <info@eigenvalue.net>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/derivation/tests/mod.rs')
-rw-r--r--tvix/nix-compat/src/derivation/tests/mod.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/tvix/nix-compat/src/derivation/tests/mod.rs b/tvix/nix-compat/src/derivation/tests/mod.rs
index fcfea2047e..2bf09265bc 100644
--- a/tvix/nix-compat/src/derivation/tests/mod.rs
+++ b/tvix/nix-compat/src/derivation/tests/mod.rs
@@ -170,7 +170,7 @@ fn derivation_with_trimmed_output_paths(derivation: &Derivation) -> Derivation {
         trimmed_outputs.insert(
             output_name.to_string(),
             Output {
-                path: "".to_string(),
+                path: None,
                 ..output.clone()
             },
         );
@@ -314,7 +314,7 @@ fn output_path_construction() {
     bar_drv.outputs.insert(
         "out".to_string(),
         Output {
-            path: "".to_string(), // will be calculated
+            path: None, // will be calculated
             ca_hash: Some(crate::nixhash::CAHash::Nar(
                 crate::nixhash::from_algo_and_digest(
                     crate::nixhash::HashAlgo::Sha256,
@@ -365,7 +365,16 @@ fn output_path_construction() {
 
     // assemble foo env
     let foo_env = &mut foo_drv.environment;
-    foo_env.insert("bar".to_string(), bar_output_path.to_owned().into());
+    // foo_env.insert("bar".to_string(), StorePathRef:: bar_output_path.to_owned().try_into().unwrap());
+    foo_env.insert(
+        "bar".to_string(),
+        bar_output_path
+            .as_ref()
+            .unwrap()
+            .to_absolute_path()
+            .as_bytes()
+            .into(),
+    );
     foo_env.insert("builder".to_string(), ":".into());
     foo_env.insert("name".to_string(), "foo".into());
     foo_env.insert("out".to_string(), "".into()); // will be calculated
@@ -375,7 +384,7 @@ fn output_path_construction() {
     foo_drv.outputs.insert(
         "out".to_string(),
         Output {
-            path: "".to_string(), // will be calculated
+            path: None, // will be calculated
             ca_hash: None,
         },
     );