about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2023-06-20T14·21+0200
committerclbot <clbot@tvl.fyi>2023-06-21T07·48+0000
commit66047063e02be3188a558958de8938c9015c0f89 (patch)
tree9c8369d81c07bd670b581eb3b9f6f01271b6011b /tvix/eval/src/compiler
parent399d23eaf62a08e49d085daa7d4b4c2433e85090 (diff)
fix(tvix/eval): use realpaths for import cache r/6341
I've noticed this behavior when writing the admittedly cursed test case
included in this CL. Alternatively we could use some sort of machinery
using `builtins.trace`, but I don't think we capture stderr anywhere.

I've elected to put this into the eval cache itself while C++ Nix does
it in builtins.import already, namely via `realisePath`. We don't have
an equivalent for this yet, since we don't support any kind of IfD, but
we could revise that later. In any case, it seems good to encapsulate
`ImportCache` in this way, as it'll also allow using file hashes as
identifiers, for example.

C++ Nix also does our equivalent of canon_path in `builtins.import`
which we still don't, but I suspect it hardly makes a difference.

Change-Id: I05004737ca2458a4c67359d9e7d9a2f2154a0a0f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8839
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/import.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/import.rs b/tvix/eval/src/compiler/import.rs
index 7e1aabbf1f8b..59e3d92e8127 100644
--- a/tvix/eval/src/compiler/import.rs
+++ b/tvix/eval/src/compiler/import.rs
@@ -24,6 +24,7 @@ async fn import_impl(
     source: SourceCode,
     mut args: Vec<Value>,
 ) -> Result<Value, ErrorKind> {
+    // TODO(sterni): canon_path()?
     let mut path = coerce_value_to_path(&co, args.pop().unwrap()).await?;
 
     if path.is_dir() {