From b4bb9062eaa14e654f51a20b7c94656f7cd49858 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 21 May 2023 11:08:02 +0300 Subject: fix(tvix/eval): add path where useful to ErrorKind::IO These two places didn't add the path from the context to the ErrorKind, but simply relied on the impl From for tvix_eval::ErrorKind, which doesn't add the path. Change-Id: Ifc7dbbe305d24242b0705de1dea34e8923e9d2cb Reviewed-on: https://cl.tvl.fyi/c/depot/+/8603 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: flokli --- tvix/eval/src/nix_search_path.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tvix/eval/src/nix_search_path.rs b/tvix/eval/src/nix_search_path.rs index 5a650a55c7..8e23c2d9c2 100644 --- a/tvix/eval/src/nix_search_path.rs +++ b/tvix/eval/src/nix_search_path.rs @@ -48,7 +48,12 @@ fn canonicalise(path: PathBuf) -> Result { path } else { // TODO(tazjin): probably panics in wasm? - std::env::current_dir()?.join(path) + std::env::current_dir() + .map_err(|e| ErrorKind::IO { + path: Some(path.clone()), + error: e.into(), + })? + .join(path) } .clean(); @@ -80,7 +85,10 @@ impl NixSearchPathEntry { } }; - if io.path_exists(path.clone())? { + if io.path_exists(path.clone()).map_err(|e| ErrorKind::IO { + path: Some(path.clone()), + error: e.into(), + })? { Ok(Some(path)) } else { Ok(None) -- cgit 1.4.1