about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/mod.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-03-12T18·49+0300
committerclbot <clbot@tvl.fyi>2023-03-17T19·31+0000
commit5095e4f2696ef85ee7c6ae0515eb8d1586459f8c (patch)
tree8a7a6c5d17fa73a430256a170b80358e2d21f189 /tvix/eval/src/compiler/mod.rs
parentea80e0d3f88576ef593b1f9237bd51da9c3f335b (diff)
feat(tvix/eval): add generator "name" to NativeError kind r/6024
This produces traces in which we can see what kind of native code was
run. Note that these "names" are named after the generator message, so
these aren't *really* intended for end-user consumption, but we can
give them saner names later.

Example:
https://gist.github.com/tazjin/82b24e92ace8e821008954867ee05057

This already makes the traces a little easier to parse.

Change-Id: Idcd601baf84f492211b732ea0f04b377112e10d0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8268
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/compiler/mod.rs')
-rw-r--r--tvix/eval/src/compiler/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 9cbbf62dbd..51dc492428 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -1340,7 +1340,10 @@ fn compile_src_builtin(
             weak.upgrade().unwrap(),
             &mut crate::observer::NoOpObserver {},
         )
-        .map_err(|e| ErrorKind::NativeError(Box::new(e)))?;
+        .map_err(|e| ErrorKind::NativeError {
+            gen_type: "derivation",
+            err: Box::new(e),
+        })?;
 
         if !result.errors.is_empty() {
             return Err(ErrorKind::ImportCompilerError {