diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-12T12·27-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-12T17·50+0000 |
commit | c5f58d4af3eb47e6474a8793973889eca05f7978 (patch) | |
tree | 7dcd40620a07228890c0bc6b7777eb6becba0b2a /tvix/eval | |
parent | 2565a21aa9e88465c78634c763c9a34a2332f4f6 (diff) |
fix(tvix/eval): baseNameOf: propagate catchables r/7204
Change-Id: Id8dc772ea8f338dfd243210f4108f79072570c3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/10324 Autosubmit: Adam Joseph <adam@westernsemico.com> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval')
3 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index c2618a4066f4..554fc9d7e329 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -135,6 +135,7 @@ mod pure_builtins { async fn builtin_base_name_of(co: GenCo, s: Value) -> Result<Value, ErrorKind> { let span = generators::request_span(&co).await; let s = match s { + val @ Value::Catchable(_) => return Ok(val), // it is important that builtins.baseNameOf does not // coerce paths into strings, since this will turn them // into store paths, and `builtins.baseNameOf diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp new file mode 100644 index 000000000000..c508d5366f70 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp @@ -0,0 +1 @@ +false diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix new file mode 100644 index 000000000000..f47c6f22bbe3 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix @@ -0,0 +1 @@ +(builtins.tryEval ( builtins.baseNameOf (throw "jill") )).success |