about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
authorRyan Lahfa <tvl@lahfa.xyz>2024-03-25T00·01+0100
committerraitobezarius <tvl@lahfa.xyz>2024-03-31T12·40+0000
commit8bccc9dca99bbd4d0f02d591fd11e425bf3aecc4 (patch)
tree74138e3d1ccf06c8db9e6667eb3ca4e781a880f3 /tvix/eval/src/value
parent94185f75604aca63c3d0e09a42503610f1dd822d (diff)
feat(tvix/eval): implement `unsafeDiscardOutputDependency` r/7806
This builtin only transforms any `NixContextElement::Derivation` into the trivial `NixContextElement::Plain`.

This is a forgetful functor on derivation-deep context strings.

The test coverage of this change is done in cl/11264.

Change-Id: Icd00778c97766be6db8a6bdabaa59e9724353ec5
Signed-off-by: Ryan Lahfa <tvl@lahfa.xyz>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11262
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/string.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs
index 6ce0d190c0a0..dd027895fd1c 100644
--- a/tvix/eval/src/value/string.rs
+++ b/tvix/eval/src/value/string.rs
@@ -48,6 +48,12 @@ impl From<NixContextElement> for NixContext {
     }
 }
 
+impl From<HashSet<NixContextElement>> for NixContext {
+    fn from(value: HashSet<NixContextElement>) -> Self {
+        Self(value)
+    }
+}
+
 impl NixContext {
     /// Creates an empty context that can be populated
     /// and passed to form a contextful [NixString], albeit