fix(cli): resolve Windows Alchemy executable shims - #280
Conversation
Regression intentionally fails on Windows until resolver supports installed cmd/exe shims. Existing POSIX resolver tests pass. 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 selected for processing (4)
Included review availability: 1 review is 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 now resolves Merge Risk: ⚪ Minimal · up to Composer now resolves local and hoisted Windows Alchemy executable shims in a documented order while retaining POSIX behavior. The supplied coverage indicates the intended Windows resolution and argument handling are ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
commit: |
Local resolver/runner tests and CLI typecheck pass. Windows execution is verified by the existing CI matrix, pending at commit time. Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
…ter (#250) ## 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 - Windows after fix: the same npm.cmd regression passes; all 61 CLI test files pass, 952 tests passed and 10 platform skips: https://github.com/prisma/prisma-cli/actions/runs/34237016724/job/102097241940. - Linux CI passed: https://github.com/prisma/prisma-cli/actions/runs/34237016724/job/102097242011. - macOS locally: all 61 CLI test files passed (960 tests, 2 platform skips). - Repository typecheck and lint passed. - No workflows added and no production deployment needed for the command-launch reproduction. ## 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. --------- Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Problem
Composer only looked for node_modules/.bin/alchemy. Windows package managers can install alchemy.exe or alchemy.cmd without that extensionless file, so Composer incorrectly reports DEPLOY.ALCHEMY_BIN_MISSING before launching anything.
Fix
Resolve the nearest installed Windows executable in order: alchemy.exe, alchemy.cmd, then the extensionless shim. Continue searching ancestors for hoisted installations; POSIX behavior is unchanged. No PATH/global fallback, application workaround, or dependency change. Update the deployment guide and core-concepts skill with the resolution contract.
Verification
Related owning-repo fix
prisma/prisma-cli#250 fixes the consolidated CLI adapter that launches the resolved command. Its native Windows regression reproduced spawn EINVAL on npm.cmd before the fix.
Limits
This does not claim all Windows assembly or deployment failures share this cause, or enable local Windows dev support. Deployment verification ran through the existing CI E2E jobs; no manual production deployment was performed.