From 96111c6ef3c138a2fa186a522da7633ffa998948 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 17 Sep 2025 21:36:06 +0200 Subject: [PATCH] extension_host: Sanitize cwd path for ResolvedTask (#38357) Ensures build task's CWD paths use POSIX-friendly path separator on Windows host so that `std::path::Path` ops work as expected within the Wasm guest. Release Notes: - N/A --- crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs index 84794d5386eda1517808d181eb259a3264f7b82d..e879ed0cb01f70f24a9b2b52438e1ff7d405f2d6 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs @@ -309,7 +309,14 @@ impl TryFrom for ResolvedTask { command: value.command.context("missing command")?, args: value.args, env: value.env.into_iter().collect(), - cwd: value.cwd.map(|s| s.to_string_lossy().into_owned()), + cwd: value.cwd.map(|s| { + let s = s.to_string_lossy(); + if cfg!(target_os = "windows") { + s.replace('\\', "/") + } else { + s.into_owned() + } + }), }) } }