From cc098b9aaa2dc033d3decf53cdfbd20a8ac22689 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Tue, 26 Dec 2023 04:14:37 +0100 Subject: feat(tvix/eval): contextful coercion of files In the past reference tracking system, `tvix-io` glue was appending plain paths in the known path state. Now, we make up for this by just making contextful coercion of file imports. Change-Id: Ieb9b04dd83302c77909252d5f7733857ac3cf8fd Reviewed-on: https://cl.tvl.fyi/c/depot/+/10443 Tested-by: BuildkiteCI Autosubmit: raitobezarius Reviewed-by: tazjin --- tvix/eval/src/value/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tvix/eval/src/value') diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index aa32f558aa..1558d2cc9c 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -352,6 +352,11 @@ impl Value { }, ) => { let imported = generators::request_path_import(co, *p).await; + // When we import a path from the evaluator, we must attach + // its original path as its context. + context = context.append(NixContextElement::Plain( + imported.to_string_lossy().to_string(), + )); Ok(imported.to_string_lossy().into_owned()) } ( -- cgit 1.4.1