Skip to content
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

Add windowsVerbatimArguments docs for child_process.spawn #16299

Closed
wants to merge 1 commit into from

Conversation

andrewstucki
Copy link

This resurrects nodejs/node-v0.x-archive#4259.

I changed a bit of the documentation to more closely mirror the docs found in the header http://docs.libuv.org/en/v1.x/process.html by taking the wording from https://nikhilm.github.io/uvbook/processes.html

Checklist
  • documentation is changed or added
  • commit message follows [commit guidelines]
Affected core subsystem(s)

doc

@nodejs-github-bot nodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations. labels Oct 18, 2017
@@ -405,6 +405,7 @@ changes:
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
[Default Windows Shell][]. **Default:** `false` (no shell).
* `windowsVerbatimArguments` {Boolean} No quoting or escaping of arguments is done on Windows. Ignored on Unix.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: long line. need to wrap at <= 80 chars

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated and pushed.

@@ -405,6 +405,8 @@ changes:
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
[Default Windows Shell][]. **Default:** `false` (no shell).
* `windowsVerbatimArguments` {Boolean} No quoting or escaping of arguments is
Copy link
Contributor

@cjihrig cjihrig Oct 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supported on other child process methods. There are some additional details that should probably be included. It is enabled unconditionally when the shell option is true on Windows. This means it's also turned on for exec() for example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, just to make sure, you want me to both:

  1. Add the doc to the methods that call spawn under the hood (exec family as well as fork from the looks of it)
  2. Mention that it is automatically set when shell is set to true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add the doc to the methods that call spawn under the hood (exec family as well as fork from the looks of it)

Yes. I'm not a huge fan of it, but we repeat the options in this file a lot.

  1. Mention that it is automatically set when shell is set to true

Yes, but only on Windows. exec() and execSync() are a bit special because you can't disable shell, and thus cannot disable WVA.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I updated the docs for fork, spawn, and spawnSync since the exec family always enables shell (fork always disables shell, but windowsVerbatimArguments is still able to be overwritten).

Also added in that the default value for windowsVerbatimArguments is false.

@@ -339,6 +339,8 @@ changes:
When this option is provided, it overrides `silent`. If the array variant
is used, it must contain exactly one item with value `'ipc'` or an error
will be thrown. For instance `[0, 1, 2, 'ipc']`.
* `windowsVerbatimArguments` {Boolean} No quoting or escaping of arguments is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit: primitive types are lowercased, so this should be {boolean} here and in other additions,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@andrewstucki
Copy link
Author

Any updates?

@joyeecheung
Copy link
Member

AFAICT should be good to go with a green linter CI: https://ci.nodejs.org/job/node-test-linter/13043/

@joyeecheung
Copy link
Member

Filled in a wrong ref, new CI: https://ci.nodejs.org/job/node-test-linter/13045/

@joyeecheung
Copy link
Member

Just realized the linter does not verify the docs...anyway a full CI: https://ci.nodejs.org/job/node-test-pull-request/11048/

(should totally get the doc CI setup)

@andrewstucki
Copy link
Author

So, it looks like the build for this was potentially manually aborted and that the checks that aren't "completed" won't because the build is aborted. Are there any changes for me to make or is this just waiting for the doc CI to work?

@joyeecheung
Copy link
Member

@andrewstucki The windows job got cancelled probably because of the disk space issue that we had over the weekend. New CI: https://ci.nodejs.org/job/node-test-pull-request/11110/

@andrewstucki
Copy link
Author

@joyeecheung so this looks like it's green on the linter, but failing for a bunch of unrelated reasons on the platform-dependent builds.

@joyeecheung
Copy link
Member

Landed in 41611f9, thanks!

@joyeecheung joyeecheung closed this Nov 2, 2017
joyeecheung pushed a commit that referenced this pull request Nov 2, 2017
doc: Add windowsVerbatimArguments docs for
child_process spawn, spawnSync, execFile, and fork

PR-URL: #16299
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
cjihrig pushed a commit to cjihrig/node that referenced this pull request Nov 6, 2017
doc: Add windowsVerbatimArguments docs for
child_process spawn, spawnSync, execFile, and fork

PR-URL: nodejs#16299
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@cjihrig cjihrig mentioned this pull request Nov 6, 2017
@MylesBorins
Copy link
Contributor

This does not land cleanly in v6.x LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported

gibfahn pushed a commit that referenced this pull request Nov 14, 2017
doc: Add windowsVerbatimArguments docs for
child_process spawn, spawnSync, execFile, and fork

PR-URL: #16299
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@gibfahn gibfahn mentioned this pull request Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants