about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2022-10-10T20·50-0400
committergrfn <grfn@gws.fyi>2022-10-10T23·51+0000
commit06ec4bebe7e3a9a06a7f300f0a9f7c090d809f08 (patch)
tree4f614e96aa3477ab2facf0269d27497a9542524a /tvix/eval/src/builtins
parent90ec632fd11a8767954f064a9344af8830d9fdc6 (diff)
fix(tvix/eval): Actually trace spans for thunks r/5097
Currently, the span on *all* thunk force errors is the span at which the
thunk is forced, which for recursive thunk forcing ends up just being
the same span over and over again. This changes the span on thunk force
errors to be the span at which point the thunk is *created*, which is a
bit more helpful (though the printing atm is a little... crowded). To
make this work, we have to thread through the span at which a thunk is
created into a field on the thunk itself.

Change-Id: I81474810a763046e2eb3a8f07acf7d8ec708824a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6932
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: Adam Joseph <adam@westernsemico.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/impure.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/builtins/impure.rs b/tvix/eval/src/builtins/impure.rs
index 2315904f143b..26422e263002 100644
--- a/tvix/eval/src/builtins/impure.rs
+++ b/tvix/eval/src/builtins/impure.rs
@@ -151,7 +151,7 @@ pub fn builtins_import(
 
             // Compilation succeeded, we can construct a thunk from whatever it spat
             // out and return that.
-            Ok(Value::Thunk(Thunk::new(result.lambda)))
+            Ok(Value::Thunk(Thunk::new(result.lambda, vm.current_span())))
         },
     )
 }