feat(tvix/eval): add generator "name" to NativeError kind

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>
This commit is contained in:
Vincent Ambo 2023-03-12 21:49:29 +03:00 committed by clbot
parent ea80e0d3f8
commit 5095e4f269
3 changed files with 29 additions and 12 deletions

View file

@ -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 {