From 4481b12c68e17e7d65fa2e70137f6e6fd8d47bda Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Tue, 4 Jan 2022 16:36:19 -0800 Subject: [PATCH 1/4] fix: Don't create console window when creating process --- patches/node/.patches | 2 ++ ...console_window_when_creating_process.patch | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 patches/node/fix_don_t_create_console_window_when_creating_process.patch diff --git a/patches/node/.patches b/patches/node/.patches index 859927b9153ac..c04289af54b21 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -29,3 +29,5 @@ fix_event_with_invalid_timestamp_in_trace_log.patch test_fix_test-datetime-change-notify_after_daylight_change.patch test_add_fixture_trim_option.patch fix_crash_caused_by_gethostnamew_on_windows_7.patch +fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch +fix_don_t_create_console_window_when_creating_process.patch diff --git a/patches/node/fix_don_t_create_console_window_when_creating_process.patch b/patches/node/fix_don_t_create_console_window_when_creating_process.patch new file mode 100644 index 0000000000000..964d9c18690c4 --- /dev/null +++ b/patches/node/fix_don_t_create_console_window_when_creating_process.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Raymond Zhao +Date: Tue, 4 Jan 2022 16:11:41 -0800 +Subject: fix: Don't create console window when creating process + +This patch prevents console windows from being created during +execSync calls, or spawnSync calls where shell is true. Otherwise, +Windows users will see command prompts pop up for those calls. + +The patch can be removed when the windowsHide parameter +for those calls is changed to have a default value of true. + +diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc +index 1141aceae984fba6ed07cd272a79d4007b9b03fe..afd08519d7f8974adff4060513f6160519a0b6b3 100644 +--- a/src/spawn_sync.cc ++++ b/src/spawn_sync.cc +@@ -810,6 +810,9 @@ Maybe SyncProcessRunner::ParseOptions(Local js_value) { + if (js_win_hide->BooleanValue(isolate)) + uv_process_options_.flags |= UV_PROCESS_WINDOWS_HIDE; + ++ if (env()->hide_console_windows()) ++ uv_process_options_.flags |= UV_PROCESS_WINDOWS_HIDE_CONSOLE; ++ + Local js_wva = + js_options->Get(context, env()->windows_verbatim_arguments_string()) + .ToLocalChecked(); From 2e8a5e57b557fbb9adfde8ea1002d13bc743f696 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Thu, 6 Jan 2022 11:34:38 -0800 Subject: [PATCH 2/4] Update patches/node/fix_don_t_create_console_window_when_creating_process.patch Co-authored-by: Robo --- .../fix_don_t_create_console_window_when_creating_process.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/node/fix_don_t_create_console_window_when_creating_process.patch b/patches/node/fix_don_t_create_console_window_when_creating_process.patch index 964d9c18690c4..8ad3f64e44815 100644 --- a/patches/node/fix_don_t_create_console_window_when_creating_process.patch +++ b/patches/node/fix_don_t_create_console_window_when_creating_process.patch @@ -7,7 +7,7 @@ This patch prevents console windows from being created during execSync calls, or spawnSync calls where shell is true. Otherwise, Windows users will see command prompts pop up for those calls. -The patch can be removed when the windowsHide parameter +The patch has been upstreamed with https://github.com/nodejs/node/pull/41412 for those calls is changed to have a default value of true. diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc From f54ced4c2c319f406f70af0adcdb03d4e2dd2cea Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Thu, 6 Jan 2022 11:46:33 -0800 Subject: [PATCH 3/4] Remove extra line in description --- ...fix_don_t_create_console_window_when_creating_process.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/node/fix_don_t_create_console_window_when_creating_process.patch b/patches/node/fix_don_t_create_console_window_when_creating_process.patch index 8ad3f64e44815..2ae896f558c86 100644 --- a/patches/node/fix_don_t_create_console_window_when_creating_process.patch +++ b/patches/node/fix_don_t_create_console_window_when_creating_process.patch @@ -7,8 +7,7 @@ This patch prevents console windows from being created during execSync calls, or spawnSync calls where shell is true. Otherwise, Windows users will see command prompts pop up for those calls. -The patch has been upstreamed with https://github.com/nodejs/node/pull/41412 -for those calls is changed to have a default value of true. +The patch has been upstreamed at https://github.com/nodejs/node/pull/41412. diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 1141aceae984fba6ed07cd272a79d4007b9b03fe..afd08519d7f8974adff4060513f6160519a0b6b3 100644 From 954b9d9435c0696cb68accc237bbd9b58f68a84d Mon Sep 17 00:00:00 2001 From: Robo Date: Sun, 9 Jan 2022 18:22:34 -0800 Subject: [PATCH 4/4] Update .patches --- patches/node/.patches | 1 - 1 file changed, 1 deletion(-) diff --git a/patches/node/.patches b/patches/node/.patches index c04289af54b21..f20ee20945ca0 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -29,5 +29,4 @@ fix_event_with_invalid_timestamp_in_trace_log.patch test_fix_test-datetime-change-notify_after_daylight_change.patch test_add_fixture_trim_option.patch fix_crash_caused_by_gethostnamew_on_windows_7.patch -fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch fix_don_t_create_console_window_when_creating_process.patch