fix windows PATHEXT resolution for .cmd/.bat wrappers#269
fix windows PATHEXT resolution for .cmd/.bat wrappers#269F0rty-Tw0 wants to merge 1 commit intortk-ai:developfrom
Conversation
|
Hi, this PR has conflicts with master. Could you rebase on current master? Thanks! |
de135a4 to
a5eea5a
Compare
Should be done, plus updated the new commands with the utils. |
fbf2bec to
6a4b6f0
Compare
|
Hi @F0rty-Tw0, the approach is correct and the 28-file scope is justified given the goal. Centralizing binary resolution into Two things before we can merge:
The |
1. Remove `assert!` and `expect` when parsing action count. By default we only use the first action count found. Also add debug prints for weird cases. 2. Use `resolved_command` in rtk-ai#269 3. Return `Result` from all filter functions, and fall back to printing raw output if there is an error Other changes: 1. Add `run_bazel_filtered<F>` generic function to match Cargo and reduce code reuse 2. Merge stdout and stderr in `filter_bazel_query` (should probably refactor `bazel query` some more)
|
Review: LGTM ✅ — needs rebase Verified locally — cargo fmt clean, cargo clippy clean, 506/506 tests pass (1 pre-existing failure unrelated to this PR). Clean approach:
Action needed: Rebase on master — conflicts in Cargo.lock and Cargo.toml (version/dependency updates, should be trivial to resolve). git fetch origin master Resolve Cargo.toml conflict (keep both: your
|
a010a3e to
f743361
Compare
Should all be set, please check. @pszymkowiak - done |
babb108 to
15d4159
Compare
1. Remove `assert!` and `expect` when parsing action count. By default we only use the first action count found. Also add debug prints for weird cases. 2. Use `resolved_command` in rtk-ai#269 3. Return `Result` from all filter functions, and fall back to printing raw output if there is an error Other changes: 1. Add `run_bazel_filtered<F>` generic function to match Cargo and reduce code reuse 2. Merge stdout and stderr in `filter_bazel_query` (should probably refactor `bazel query` some more)
|
Tried the build with Working nicely for me 🎉 |
|
Hey @F0rty-Tw0, sorry for the confusion — there was a duplicate PR (#492) opened for the same fix. With so many PRs in flight right now, things got mixed up. Your PR was here first and already LGTM'd, so we're going with yours. Could you rebase on |
|
@pszymkowiak no problem at all. I'm on it today. |
15d4159 to
89c2153
Compare
|
@pszymkowiak we should be set now. Let me know if anything else is missing. |
- add PATHEXT-aware command resolution via which\n- migrate affected command runners to resolved_command\n- add regression coverage for wrapper/fallback behavior
6648d40 to
66eee97
Compare
What changed
whichcrate to resolve binary paths with proper PATH+PATHEXT handling before spawningresolve_binary(),resolved_command(), andtool_exists()helpers insrc/utils.rsCommand::new(...)withresolved_command(...)across all 16+ command modules (vitest, eslint, tsc, pnpm, playwright, prisma, next, pip, pytest, ruff, golangci-lint, etc.)which_command()/tool_exists()helpers from individual modules (pip_cmd.rs, pytest_cmd.rs, ccusage.rs)Impact on existing code
resolved_command()instead of rawCommand::new(). On non-Windows this resolves to the same binary path, so behavior is unchanged. On Windows, .CMD/.BAT/.PS1 shims installed by npm/pnpm are now found correctly.whichcrate adds three small transitive dependencies (env_home, winsafe, rustix — rustix was already present).which_command()helpers (pip, pytest, ccusage) now use the sharedtool_exists()from utils, removing ~40 lines of duplicated code.Test plan
rtk vitest run,rtk lint src/,rtk tscwith Node.js tools installed via pnpm/npm — should no longer fail with "program not found"cargo test --allto confirm no regressionsresolve_binary("cargo")returns a valid path in CI across all platformsCloses #212