diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-12T11·01-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-12T17·21+0000 |
commit | 29464fc65be0fb98b1ee1592ef99ed102be0e073 (patch) | |
tree | 66472a6ba22a050c841f6a3715a752ce88862e90 | |
parent | 012b44244bd75ad3480141debda6011370195c2b (diff) |
fix(tvix/eval): propagate catchables through builtins.splitVersion r/7196
This fixes our implementation of builtins.splitVersion so it propagates catchables like cppnix does. Change-Id: Id5d83ea76229f8c8f202aa42353cb609e67de43f Reviewed-on: https://cl.tvl.fyi/c/depot/+/10305 Autosubmit: Adam Joseph <adam@westernsemico.com> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
3 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index b7649e7995ed..d85d6567ea8a 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -931,6 +931,9 @@ mod pure_builtins { #[builtin("splitVersion")] async fn builtin_split_version(co: GenCo, s: Value) -> Result<Value, ErrorKind> { + if s.is_catchable() { + return Ok(s); + } let s = s.to_str()?; let s = VersionPartsIter::new(s.as_str()); diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp new file mode 100644 index 000000000000..c508d5366f70 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp @@ -0,0 +1 @@ +false diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix new file mode 100644 index 000000000000..0668ec7de2ef --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix @@ -0,0 +1 @@ +(builtins.tryEval (builtins.splitVersion (throw "fred"))).success |