From 2949ee08f10f11a79af9b90933022ea40039462a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 12 Dec 2023 01:52:39 -0800 Subject: fix(tvix/eval): calling a catchable is catchable When attempting to call a Value, if it is a Value::Catchable we must not cause an uncatchable failure. This commit simply reuses the Value::Catchable as the result of attempting to call it. This is safe because nix is designed so that nix code cannot distinguish between different catchable failures -- they all look the same to the interpreted code. This fixes b/351. Change-Id: Ibf763a08753e541843626182ff59fdbf15ea2959 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10300 Autosubmit: Adam Joseph Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix | 1 + 2 files changed, 2 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix (limited to 'tvix/eval/src/tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp new file mode 100644 index 0000000000..c508d5366f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp @@ -0,0 +1 @@ +false diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix new file mode 100644 index 0000000000..f4ef72a88b --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix @@ -0,0 +1 @@ +(builtins.tryEval (throw "fred" 5)).success -- cgit 1.4.1