From c5c38d1ce5384812049a69e359286c3095bf760b Mon Sep 17 00:00:00 2001 From: megaproxy Date: Sat, 9 May 2026 01:15:58 +0100 Subject: [PATCH] =?UTF-8?q?Don't=20canonicalize=20roots=20=E2=80=94=20\\?= =?UTF-8?q?=3F\UNC\...=20prefix=20breaks=20downstream=20Path=20ops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/paths.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/paths.rs b/src-tauri/src/paths.rs index 0ee0bf1..b8d8e6e 100644 --- a/src-tauri/src/paths.rs +++ b/src-tauri/src/paths.rs @@ -137,13 +137,14 @@ pub fn resolve_roots( } } - // Canonicalize + dedupe. canonicalize() can fail on UNC paths on some - // Windows builds; if so, fall back to the raw path so we don't drop hits. + // Dedup raw — DO NOT canonicalize. On Windows, canonicalize() rewrites + // `\\wsl$\...` to `\\?\UNC\wsl$\...` (NT-namespace form), and `Path` + // operations like `.parent()` and `.join()` get inconsistent on that + // prefix, breaking downstream lookups (e.g. tier detection). let mut canon: Vec = Vec::new(); for p in roots { - let c = std::fs::canonicalize(&p).unwrap_or(p); - if !canon.contains(&c) { - canon.push(c); + if !canon.contains(&p) { + canon.push(p); } }