fix(tvix/eval): parseDrvName should not coerce, and xfail test
builtins.parseDrvName should not coerce its argument to a string. This commit fixes that oversight in my previous commit, and adds an xfail test to cover this condition. Thanks to @sterni for noticing this. Signed-off-by: Adam Joseph <adam@westernsemico.com> Change-Id: I76bc78f1a82e1e08fe5c787c563a221d55de2639 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6991 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
01bc04b1d2
commit
a98cb9d56f
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
builtins.parseDrvName { outPath = "lol"; }
|
Loading…
Reference in a new issue