about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
authorRyan Lahfa <tvl@lahfa.xyz>2023-12-26T03·14+0100
committerclbot <clbot@tvl.fyi>2024-01-03T18·50+0000
commitcc098b9aaa2dc033d3decf53cdfbd20a8ac22689 (patch)
tree86edadf889ce3dc687de154931a8b551d856497a /tvix/eval/src
parent951854defc536786f8e919d529f3db6f6d1f525d (diff)
feat(tvix/eval): contextful coercion of files r/7335
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 <tvl@lahfa.xyz>
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/value/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index aa32f558aa69..1558d2cc9c24 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())
                 }
                 (