Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions crates/vite_task_bin/tests/e2e_snapshots/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,16 +425,19 @@ fn run_case(

let argv = step.argv();

// Only vt and vtt are allowed as step programs.
let program = argv[0].as_str();
assert!(
program == "vt" || program == "vtt",
"step program must be 'vt' or 'vtt', got '{program}'"
);
let exe_env = vite_str::format!("CARGO_BIN_EXE_{program}");
let resolved =
env::var_os(exe_env.as_str()).unwrap_or_else(|| panic!("{exe_env} not set"));
let mut cmd = CommandBuilder::new(resolved);
// Resolve the locally built task binaries exactly. Other programs
// are resolved through the prepared PATH, allowing ignored tests
// to opt into external toolchains without weakening the default
// suite's self-contained execution.
let mut cmd = if matches!(program, "vt" | "vtt") {
let exe_env = vite_str::format!("CARGO_BIN_EXE_{program}");
let resolved =
env::var_os(exe_env.as_str()).unwrap_or_else(|| panic!("{exe_env} not set"));
CommandBuilder::new(resolved)
} else {
CommandBuilder::new(program)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve Windows command shims before spawning external steps

On Windows, external tools provisioned under packages/tools/node_modules/.bin (such as vite) are pnpm-generated .cmd/.ps1 shims rather than native executables. portable_pty::CommandBuilder launches the program directly, so CommandBuilder::new("vite") cannot execute those shims; setting PATHEXT later only configures the child environment and does not route the initial launch through a command interpreter. Consequently, ignored external-tool E2Es still fail to spawn on Windows unless the harness resolves and invokes the appropriate shim explicitly.

AGENTS.md reference: AGENTS.md:L147-L152

Useful? React with 👍 / 👎.

};
for arg in &argv[1..] {
cmd.arg(arg.as_str());
}
Expand Down
Loading