fix(tvix/eval): use path_clean instead of fs::canonicalize for paths

Canonicalisation performs much more functionality than what C++ Nix
implements for paths, and causes some undesirable behaviour (e.g.
handling non-existant files becomes difficult, but should be possible
in literals).

Instead, the path_clean crate provides a pure normalisation method.

There is an intention to add this to Rust itself:
https://github.com/rust-lang/rfcs/issues/2208

Change-Id: I775d238136db0a52cf6b12a68985833c8fb32882
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6186
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-08-12 18:52:48 +03:00 committed by tazjin
parent 6fe5e2d752
commit de21d201ba
3 changed files with 14 additions and 10 deletions

7
tvix/eval/Cargo.lock generated
View file

@ -463,6 +463,12 @@ version = "11.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]]
name = "path-clean"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd"
[[package]]
name = "plotters"
version = "0.3.3"
@ -834,6 +840,7 @@ version = "0.1.0"
dependencies = [
"criterion",
"dirs",
"path-clean",
"rnix",
"rustyline",
"smol_str",