about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-10-13T04·58-0700
committerAdam Joseph <adam@westernsemico.com>2022-10-13T09·07+0000
commit25336fc47b02fe90bf489402ed84f8259aa80ca8 (patch)
treefdeb65567b25173052fae52e4229e4ba8b77406b /tvix/eval/src/vm.rs
parent534a2f95f86f3b0340040261ffc428d604210512 (diff)
refactor(tvix/eval): factor out all calls to canon_path r/5119
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 <adam@westernsemico.com>
Change-Id: Ia6f9577f62f49ef352ff9cfa5efdf37c32d31b11
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6993
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index c54c005b00..4e92c152a8 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -3,8 +3,6 @@
 
 use std::{cell::RefMut, path::PathBuf, rc::Rc};
 
-use path_clean::PathClean;
-
 use crate::{
     chunk::Chunk,
     errors::{Error, ErrorKind, EvalResult},
@@ -396,7 +394,7 @@ impl<'o> VM<'o> {
                             &v.coerce_to_string(CoercionKind::Weak, self)
                                 .map_err(|ek| self.error(ek))?,
                         );
-                        PathBuf::from(path).clean().into()
+                        crate::value::canon_path(PathBuf::from(path)).into()
                     }
                     _ => fallible!(self, arithmetic_op!(&a, &b, +)),
                 };