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

child_process: change windowsHide default to true #21316

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Jun 13, 2018

This is likely the default that more Windows users are expecting.

Refs: libuv/libuv#1878
Refs: #21314

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@cjihrig cjihrig added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jun 13, 2018
@nodejs-github-bot nodejs-github-bot added the child_process Issues and PRs related to the child_process subsystem. label Jun 13, 2018
@cjihrig
Copy link
Contributor Author

cjihrig commented Jun 13, 2018

cc: @nodejs/platform-windows @nodejs/child_process and @codebytere

@refack
Copy link
Contributor

refack commented Jun 13, 2018

I'm -0 since this is a "potayto, potahto" change (RE ... likely ... users are expecting ...).
I'd rather open this as a configurable option, but we don't have a convenient way for setting protected process level globals.

@refack
Copy link
Contributor

refack commented Jun 14, 2018

Since this is a Windows preference issue, I'd like to see more buy-in from @nodejs/platform-windows.

refack
refack previously requested changes Jun 14, 2018
Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

Waiting for more Windows specific input.

@ryzokuken
Copy link
Contributor

@refack I see this less as a windows issue and more of an issue for embedders. While the strange behavior is usual (and completely avoidable if you just add a single config option) for windows, this is a huge pain when it comes to consistency among platforms and behaviors for embedders.

P.S. In that spirit, /cc @nodejs/delivery-channels

@refack
Copy link
Contributor

refack commented Jun 14, 2018

While the strange behavior is usual (and completely avoidable if you just add a single config option) for windows, this is a huge pain when it comes to consistency among platforms and behaviors for embedders.

I don't argue with the severity of the problem, but I want broader consensus on this specific solution.

P.S. Since this is semver-major there's no rush

@@ -131,6 +131,9 @@ exec('"my script.cmd" a b', (err, stdout, stderr) => {
<!-- YAML
added: v0.1.90
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/PR-XXXXX
Copy link
Member

Choose a reason for hiding this comment

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

These have to be changed before / while landing to https://github.com/nodejs/node/pull/21316.

@cjihrig
Copy link
Contributor Author

cjihrig commented Jun 18, 2018

@refack how long are you planning to leave this blocked?

@cjihrig cjihrig dismissed refack’s stale review June 20, 2018 13:05

This has been open for a week, blocked on feedback for 6 days, and bzoz has approved the PR.

@cjihrig
Copy link
Contributor Author

cjihrig commented Jun 20, 2018

@@ -698,6 +698,9 @@ values are `'rr'` and `'none'`.
<!-- YAML
added: v0.7.1
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/PR-XXXXX
Copy link
Member

Choose a reason for hiding this comment

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

This one seems like a oversight :-)

This is likely the default that more Windows users are
expecting.

PR-URL: nodejs#21316
Refs: libuv/libuv#1878
Refs: nodejs#21314
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@cjihrig cjihrig merged commit 420d8af into nodejs:master Jun 20, 2018
@cjihrig cjihrig deleted the win-hide branch June 20, 2018 15:03
codebytere added a commit to electron/node that referenced this pull request Jul 30, 2018
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
codebytere added a commit to electron/node that referenced this pull request Sep 13, 2018
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
nornagon pushed a commit to electron/node that referenced this pull request Sep 13, 2018
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
jasnell added a commit that referenced this pull request Oct 17, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[#22617](#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [#21316](#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [#21649](#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [#20442](#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [#22754](#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [#22146](#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[#20735](#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [#20270](#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [#22951](#22951)
* Internal
  * Windows performance-counter support has been removed.
    [#22485](#22485)
  * The `--expose-http2` command-line option has been removed.
    [#20887](#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [#20002](#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [#22281](#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [#22756](#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [#21914](#21914)
jasnell added a commit that referenced this pull request Oct 17, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[#22617](#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [#21316](#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [#21649](#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [#20442](#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [#22754](#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [#22146](#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[#20735](#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [#20270](#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [#22951](#22951)
* Internal
  * Windows performance-counter support has been removed.
    [#22485](#22485)
  * The `--expose-http2` command-line option has been removed.
    [#20887](#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [#20002](#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [#22281](#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [#22756](#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [#21914](#21914)
jasnell added a commit that referenced this pull request Oct 21, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[#22617](#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [#21316](#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [#21649](#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [#20442](#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [#22754](#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [#22146](#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[#20735](#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [#20270](#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [#22951](#22951)
* Internal
  * Windows performance-counter support has been removed.
    [#22485](#22485)
  * The `--expose-http2` command-line option has been removed.
    [#20887](#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [#20002](#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [#22281](#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [#22756](#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [#21914](#21914)
jasnell added a commit that referenced this pull request Oct 22, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[#22617](#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [#21316](#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [#21649](#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [#20442](#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [#22754](#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [#22146](#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[#20735](#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [#20270](#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [#22951](#22951)
* Internal
  * Windows performance-counter support has been removed.
    [#22485](#22485)
  * The `--expose-http2` command-line option has been removed.
    [#20887](#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [#20002](#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [#22281](#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [#22756](#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [#21914](#21914)
devsnek pushed a commit to devsnek/node that referenced this pull request Oct 23, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[nodejs#22617](nodejs#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [nodejs#21316](nodejs#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [nodejs#21649](nodejs#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [nodejs#20442](nodejs#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [nodejs#22754](nodejs#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [nodejs#22146](nodejs#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[nodejs#20735](nodejs#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [nodejs#20270](nodejs#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [nodejs#22951](nodejs#22951)
* Internal
  * Windows performance-counter support has been removed.
    [nodejs#22485](nodejs#22485)
  * The `--expose-http2` command-line option has been removed.
    [nodejs#20887](nodejs#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [nodejs#20002](nodejs#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [nodejs#22281](nodejs#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [nodejs#22756](nodejs#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [nodejs#21914](nodejs#21914)
MarshallOfSound pushed a commit to electron/node that referenced this pull request Oct 25, 2018
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
@zerdos
Copy link

zerdos commented Oct 31, 2018

cypress-io/cypress#2699

@MarshallOfSound
Copy link
Member

Sorry y'all, missed this when it landed but worth noting now that this breaks any node script that spawns a GUI application. E.g. Electron

It makes all old releases of Electron basically un-usable on node 11 because the window never appears (see electron/electron#15467). We can explicitly set windowsHide to false in future releases but there's nothing we can do about older releases.

Just putting this here for discoverability when people start wondering why there window isn't appearing 😆

@Trott
Copy link
Member

Trott commented Nov 1, 2018

@MarshallOfSound (or anyone else on the Electron team): How big a deal is this for Electron? Is this something we should consider reverting in your opinion? Or is this a fine default and a minor nuisance that can be worked around without inconveniencing too many users?

/cc @nodejs/embedders

(Cypress is a testing tool rather than something for end users, so I'm slightly less concerned about the answer being "update to a newer version of Cypress to work with Node.js 11". But if it's a bigger problem than that attitude suggests, set me straight on that too.)

@MarshallOfSound
Copy link
Member

MarshallOfSound commented Nov 1, 2018

@Trott IMO not worth reverting, this only impacts developers not production Electron apps and I think the solutions of "don't use node 11" or "upgrade to latest Electron" are perfectly reasonable when people start raising issues.

We've already landed fixes for this on Electron's side in our 1-8-x, 2-0-x, 3-0-x and 4-0-x release lines so the next release of those will fix these issues.

The question for us (Electron) to think about though is that as of Electron 5 we will be embedding node 11 so this would be a breaking change for all of our consumers as well and significantly more likely to impact Electron apps than node scripts (people spawn GUI applications all the time from within Electron apps). We might have to look at changing this default for Electron, I'll raise it at our next meeting 🤔

EDIT: I didn't actually realize this change was added kind of for us as part of an upstreaming effort, I don't think it had the intended effect (cc @codebytere )

@Trott
Copy link
Member

Trott commented Nov 1, 2018

I didn't actually realize this change was added kind of for us as part of an upstreaming effort,

Yeah, I noticed that too and got really confused....

@Trott
Copy link
Member

Trott commented Nov 2, 2018

Opened this to hopefully prompt discussion (rather than piling up comments in this merged PR): #24034

deepak1556 pushed a commit to electron/node that referenced this pull request Dec 10, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[#22617](nodejs/node#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [#21316](nodejs/node#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [#21649](nodejs/node#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [#20442](nodejs/node#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [#22754](nodejs/node#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [#22146](nodejs/node#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[#20735](nodejs/node#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [#20270](nodejs/node#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [#22951](nodejs/node#22951)
* Internal
  * Windows performance-counter support has been removed.
    [#22485](nodejs/node#22485)
  * The `--expose-http2` command-line option has been removed.
    [#20887](nodejs/node#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [#20002](nodejs/node#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [#22281](nodejs/node#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [#22756](nodejs/node#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [#21914](nodejs/node#21914)
deepak1556 pushed a commit to electron/node that referenced this pull request Dec 10, 2018
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
deepak1556 pushed a commit to electron/node that referenced this pull request Dec 19, 2018
Notable changes:

* Build
  * FreeBSD 10 is no longer supported.[#22617](nodejs/node#22617)
* `child_process`
  * The default value of the `windowsHide` option has been changed
    to `true`. [#21316](nodejs/node#21316)
* `console`
  * `console.countReset()` will emit a warning if the timer
    being reset does not exist. [#21649](nodejs/node#21649)
  * `console.time()` will no longer reset a timer if it already
    exists. [#20442](nodejs/node#20442)
* Dependencies
  * V8 has been updated to 7.0.
    [#22754](nodejs/node#22754)
* `fs`
  * The `fs.read()` method now requires a callback.
    [#22146](nodejs/node#22146)
  * The previously deprecated `fs.SyncWriteStream` utility has been
    removed.[#20735](nodejs/node#20735)
* `http`
  * The `http`, `https`, and `tls` modules now use the WHATWG URL parser
    by default. [#20270](nodejs/node#20270)
* General
  * Use of `process.binding()` has been deprecated. Userland code using
    `process.binding()` should re-evaluate that use and begin migrating. If
    there are no supported API alternatives, please open an issue in the
    Node.js GitHub repository so that a suitable alternative may be discussed.
  * An experimental implementation of `queueMicrotask()` has been added.
    [#22951](nodejs/node#22951)
* Internal
  * Windows performance-counter support has been removed.
    [#22485](nodejs/node#22485)
  * The `--expose-http2` command-line option has been removed.
    [#20887](nodejs/node#20887)
* Timers
  * Interval timers will be rescheduled even if previous interval threw
    an error. [#20002](nodejs/node#20002)
* `util`
  * The WHATWG `TextEncoder` and `TextDecoder` are now globals.
    [#22281](nodejs/node#22281)
  * `util.inspect()` output size is limited to 128 MB by default.
    [#22756](nodejs/node#22756)
  * A runtime warning will be emitted when `NODE_DEBUG` is set for
    either `http` or `http2`. [#21914](nodejs/node#21914)
deepak1556 pushed a commit to electron/node that referenced this pull request Dec 19, 2018
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
nornagon pushed a commit to electron/node that referenced this pull request Feb 27, 2019
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
nitsakh pushed a commit to electron/node that referenced this pull request Mar 1, 2019
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
nitsakh pushed a commit to electron/node that referenced this pull request Mar 22, 2019
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
nitsakh pushed a commit to electron/node that referenced this pull request Mar 26, 2019
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
zcbenz pushed a commit to electron/node that referenced this pull request Apr 16, 2019
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
codebytere added a commit to electron/node that referenced this pull request Jun 20, 2019
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes nodejs/node#21316
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. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.