From 25336fc47b02fe90bf489402ed84f8259aa80ca8 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Wed, 12 Oct 2022 21:58:42 -0700 Subject: refactor(tvix/eval): factor out all calls to canon_path Right now we're pretending that the Rust library path_clean does the same thing that cppnix's canonPath() does. This is not true. It's close enough for the test suite, but may come back to bite us. Let's create our own canon_path() function and call that in all the places where we intend to match the behavior of cppnix's canonPath(). That way when we fix this we can fix it once, in one place. Signed-off-by: Adam Joseph Change-Id: Ia6f9577f62f49ef352ff9cfa5efdf37c32d31b11 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6993 Tested-by: BuildkiteCI Reviewed-by: grfn --- tvix/eval/src/compiler/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tvix/eval/src/compiler/mod.rs') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 9bd37cef8578..e4c2c159da40 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -17,7 +17,6 @@ mod bindings; mod scope; use codemap::Span; -use path_clean::PathClean; use rnix::ast::{self, AstToken}; use smol_str::SmolStr; use std::cell::RefCell; @@ -300,7 +299,7 @@ impl Compiler<'_> { // TODO: Use https://github.com/rust-lang/rfcs/issues/2208 // once it is available - let value = Value::Path(path.clean()); + let value = Value::Path(crate::value::canon_path(path)); self.emit_constant(value, node); } -- cgit 1.4.1