-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix spawn on windows #7049
test: fix spawn on windows #7049
Conversation
@@ -3,7 +3,13 @@ const cp = require('child_process'); | |||
const common = require('../common'); | |||
const assert = require('assert'); | |||
|
|||
const p = cp.spawn('echo'); | |||
const opts = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just do const opts = {shell: common.isWindows};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
LGTM. How was this working on the CI machines? |
@cjihrig Probably they have some sort of mingw/cygwin/etc. environment installed? I noticed it while running tests on a local Windows 7 VM that doesn't have any of that kind of stuff installed. |
cddfef0
to
883f253
Compare
Windows CI machines have Git for Windows installed, and use the executables provided by that. There should be a few more tools required to run the tests, I once compiled a list but it should be quite outdated now: https://github.com/nodejs/node/wiki/Installation#building-on-windows (bottom of that section). It's good to see one of those dependencies go away, LGTM. |
94cd580
to
b04f1ba
Compare
CI one last time before landing: https://ci.nodejs.org/job/node-test-pull-request/2942/ |
LGTM |
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: nodejs#7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
b04f1ba
to
e18a926
Compare
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: #7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: #7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: #7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: #7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: #7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: #7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
@thealphanerd While this landed cleanly on V4 it doesn't work and the test case still fails there. The shell:true option only exists in V6 and later. I'm submitting a separate PR to implement the fix differently in that branch |
Checklist
Affected core subsystem(s)
Description of change
Most Windows systems do not have an external
echo
program installed, so any attempts to spawnecho
as a child process will fail withENOENT
. This commit forces the use of the built-inecho
provided bycmd.exe
.