fix(scripts): avoid DEP0190 when spawning .cmd files on Windows (Node.js v24)#62910
Conversation
Greptile SummaryThis PR fixes DEP0190 on Node.js v24 by refactoring Confidence Score: 5/5Safe to merge — the fix correctly eliminates the DEP0190 pattern while preserving the existing security validation. No P0 or P1 findings. The arg-folding logic is equivalent to what Node.js was doing internally before v24, assertSafeWindowsShellArgs runs before the join, and non-Windows code paths are untouched. No files require special attention.
|
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. source-backed: current main can select Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this refreshed cmd.exe wrapper implementation after required CI/checks pass, or an equivalent patch that removes Do we have a high-confidence way to reproduce the issue? Yes, source-backed: current main can select Is this the best way to solve the issue? Yes: using the existing What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ac5acaeb8f68. |
fc2d117 to
87ace89
Compare
|
Maintainer prep complete for #62910. What changed:
Prepared head: Verification:
Notes:
Re-review progress:
|
87ace89 to
bb4f159
Compare
|
Maintainer refresh: rebased the prepared branch onto current main after main moved.\n\nNew prepared head: |
bb4f159 to
f9aba20
Compare
|
@greptile-apps[bot] Thanks for the review — the Greptile summary matches an older head (it references the The branch has been rebased onto current If you want an updated bot pass, a Greptile re-trigger on the refreshed head should re-summarize against the current diff. Re-review progress:
|
f9aba20 to
252f744
Compare
|
Maintainer prep refresh for #62910. Prepared head: What I changed:
Verification:
Fresh CI should start on the prepared head. Not merging until required/full checks are green. |
4fd2844 to
c49f3d5
Compare
|
Maintainer refresh:
Local verification passed: I’ll wait for fresh GitHub checks before merging. |
|
Merged with squash after the refreshed head Merge commit: Linked issue #62881 was already closed, and this landing keeps the Windows |
Summary
Fixes #62881
On Node.js v24,
child_process.spawn/spawnSyncwith{ shell: true }and a separateargsarray triggers DEP0190: Node warns because arguments are only concatenated, not escaped.In
scripts/ui.js, Windows UI runners that resolve to.cmd/.batlaunchers (for examplepnpm.cmd) used to take the guardedshell: truepath and could hit that pattern.Fix (current):
resolveSpawnCalldetects Windows.cmd/.batrunner paths (shouldUseCmdExeForCommand) and launches them viaComSpec(cmd.exe) with/d /s /c, using a single command line frombuildCmdExeCommandLine(scripts/windows-cmd-helpers.mjs), withshell: falseandwindowsVerbatimArguments: true. That removes the DEP0190 trigger without ad-hoc string joining and keeps argument boundaries explicit..exe/.comlaunchers and non-Windows paths still spawn the resolved executable directly withshell: false.An earlier revision folded args for
shell: true; the branch was rebased onto currentmainand now follows the shared cmd.exe helper path described in maintainer prep.Test plan
node scripts/ui.js install— no DEP0190 warning should appearnode scripts/ui.js devandnode scripts/ui.js build— UI builds/serves correctlypnpm exec oxfmt --check --threads=1 scripts/ui.js test/scripts/ui.test.ts CHANGELOG.mdpnpm exec vitest run --config test/vitest/vitest.unit-fast.config.ts test/scripts/ui.test.tsgit diff --check