Repository navigation
fix(cli): launch Windows package-manager shims through the spawn adapter - #250
Conversation
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Essentials Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. Summary by CodeRabbit
WalkthroughThe CLI spawn adapter now uses Merge Risk: ⚪ Minimal · up to Delegated CLI commands now support Windows .cmd shims while retaining argument-array execution and existing output behavior. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
commit: |
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Problem
The consolidated CLI delegates Composer and other commands through its own spawn adapter. That adapter used native node:child_process.spawn, which cannot execute Windows .cmd shims directly.
Reproduced
The first commit runs the real installed npm.cmd through the shipped adapter. Existing Windows CI failed with spawn EINVAL (-4071), while 951 other tests passed: https://github.com/prisma/prisma-cli/actions/runs/34236425789/job/102095202659.
Fix
Use cross-spawn at the owning adapter. Preserve argv arrays, inherited human stdio, structured diagnostic forwarding/backpressure, bounded drain, exit status, and signal forwarding. No blanket shell:true and no create-prisma workaround. Declare the runtime dependency in both published package manifests. Document the execution contract.
Verification
Scope
Fixes Windows delegated shim launch failures, not every CLI.SPAWN_FAILED, auth error, build failure, or install failure. Composer executable discovery is separate: prisma/composer#280.
Ready for review. All CI checks passed, including the native Windows regression.