You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xtask desktop: resolve pnpm explicitly on Windows (.exe preferred, .cmd via cmd /c)
Rust Command (CreateProcess) only resolves .exe on PATH, not the
.cmd shims a pnpm install leaves behind, so build_frontend failed
with 'failed to run pnpm: program not found' on Windows. Resolve
PATH/PATHEXT explicitly; fail closed naming pnpm and the fix when
absent. Linux/macOS behavior unchanged.
None => Err("pnpm not found on PATH (install the pnpm version pinned in the packageManager field of package.json and ensure it is on PATH)".to_string()),
468
+
}
469
+
}
470
+
471
+
/// Resolve `stem` against `dirs` honoring `pathext`, preferring a real
472
+
/// `.exe` (CreateProcess runs it directly) over shell shims. Returns the
473
+
/// resolved path plus whether it needs a shell (`cmd /c`): batch shims
474
+
/// such as `pnpm.cmd` cannot run directly. `.exe` wins even from a later
475
+
/// directory so a directly-runnable binary is never routed through a
476
+
/// shell. Extension case follows the `pathext` entry as written; the
477
+
/// Windows filesystem matches it case-insensitively.
478
+
fnresolve_windows_program(
479
+
stem:&str,
480
+
dirs:&[std::path::PathBuf],
481
+
pathext:&str,
482
+
) -> Option<(std::path::PathBuf,bool)>{
483
+
for dir in dirs {
484
+
let exe = dir.join(format!("{stem}.exe"));
485
+
if exe.is_file(){
486
+
returnSome((exe,false));
487
+
}
488
+
}
489
+
for ext in pathext
490
+
.split(';')
491
+
.map(str::trim)
492
+
.filter(|ext| !ext.is_empty())
493
+
{
494
+
if ext.eq_ignore_ascii_case(".exe"){
495
+
continue;
496
+
}
497
+
let ext = ext.strip_prefix('.').unwrap_or(ext);
498
+
for dir in dirs {
499
+
let candidate = dir.join(format!("{stem}.{ext}"));
0 commit comments