diff --git a/crates/loader/src/local.rs b/crates/loader/src/local.rs index ddea5ab7ab..869645e220 100644 --- a/crates/loader/src/local.rs +++ b/crates/loader/src/local.rs @@ -30,8 +30,7 @@ impl LocalLoader { files_mount_strategy: FilesMountStrategy, cache_root: Option, ) -> Result { - let app_root = app_root - .canonicalize() + let app_root = safe_canonicalize(app_root) .with_context(|| format!("Invalid manifest dir `{}`", app_root.display()))?; Ok(Self { app_root, @@ -390,6 +389,17 @@ impl LocalLoader { } } +#[cfg(not(windows))] +fn safe_canonicalize(path: &Path) -> std::io::Result { + path.canonicalize() +} + +#[cfg(windows)] +fn safe_canonicalize(path: &Path) -> std::io::Result { + use path_absolutize::Absolutize; + Ok(path.absolutize()?.into_owned()) +} + fn locked_metadata( details: v2::AppDetails, trigger_types: impl Iterator,