about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/builtins/mod.rs4
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-fail-parsedrvname-coerce.nix1
2 files changed, 3 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index a3aaf33bf4af..0b19a89aa316 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -381,10 +381,10 @@ fn pure_builtins() -> Vec<Builtin> {
                 Ok(Value::attrs(NixAttrs::from_map(res)))
             },
         ),
-        Builtin::new("parseDrvName", &[true], |args: Vec<Value>, vm: &mut VM| {
+        Builtin::new("parseDrvName", &[true], |args: Vec<Value>, _vm: &mut VM| {
             // This replicates cppnix's (mis?)handling of codepoints
             // above U+007f following 0x2d ('-')
-            let s = args[0].coerce_to_string(CoercionKind::Weak, vm)?;
+            let s = args[0].to_str()?;
             let slice: &[u8] = s.as_str().as_ref();
             let (name, dash_and_version) = slice.split_at(
                 slice
diff --git a/tvix/eval/src/tests/tvix_tests/eval-fail-parsedrvname-coerce.nix b/tvix/eval/src/tests/tvix_tests/eval-fail-parsedrvname-coerce.nix
new file mode 100644
index 000000000000..a1218de3fe58
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-fail-parsedrvname-coerce.nix
@@ -0,0 +1 @@
+builtins.parseDrvName { outPath = "lol"; }