diff --git a/DEPS b/DEPS index d7ed10436381f..fb693b6529f0b 100644 --- a/DEPS +++ b/DEPS @@ -17,7 +17,7 @@ vars = { 'chromium_version': '95.0.4612.5', 'node_version': - 'v16.7.0', + 'v16.8.0', 'nan_version': # The following commit hash of NAN is v2.14.2 with *only* changes to the # test suite. This should be updated to a specific tag when one becomes diff --git a/patches/node/.patches b/patches/node/.patches index 5bdf45a79cb78..ba1e0f67fe1c8 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -1,5 +1,4 @@ make_module_globalpaths_a_reference.patch -fix_don_t_create_console_window_when_creating_process.patch refactor_alter_child_process_fork_to_use_execute_script_with.patch feat_add_uv_loop_watcher_queue_code.patch feat_initialize_asar_support.patch diff --git a/patches/node/add_should_read_node_options_from_env_option_to_disable_node_options.patch b/patches/node/add_should_read_node_options_from_env_option_to_disable_node_options.patch index 920f9a0b27ab7..6b8419ed0db25 100644 --- a/patches/node/add_should_read_node_options_from_env_option_to_disable_node_options.patch +++ b/patches/node/add_should_read_node_options_from_env_option_to_disable_node_options.patch @@ -21,7 +21,7 @@ index 1cc7da1ce15f43905ce607adcc1a23ed9d92948a..16af6aec3791df1363682f1ed024c522 Isolate* isolate, const std::vector& args, diff --git a/src/env.h b/src/env.h -index 0877f5b1fe2db42acf908e0e1085626fc258ef54..25a8027b9e4ab7817e5ec153ddeccb3c1438912e 100644 +index 33f34ed79452b004b5fb40e70cda6e3d0ee2d1e2..e729ff349931b512052ad3557c62af6808b36c38 100644 --- a/src/env.h +++ b/src/env.h @@ -1142,6 +1142,8 @@ class Environment : public MemoryRetainer { @@ -47,7 +47,7 @@ index 6302bb925339d709a54151a8fc8b58f1a2253881..48a9eedfaf6350fc05fb104a1f44e85b ParseNodeOptionsEnvVar(node_options, errors); diff --git a/src/node_worker.cc b/src/node_worker.cc -index 43a3862cc69dc39b95b329f713691b19de3b8d7e..7782e8488f797a8cf83b1e02f012797ef256afe7 100644 +index 3e3cb67d9e8c8b1ea867ff31d96a81709b47cc8d..679282e688258314fcd594bab7fd711cac2c9e48 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -457,6 +457,7 @@ void Worker::New(const FunctionCallbackInfo& args) { diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 39189c753043c..2fc32730dcce0 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -968,10 +968,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636 +} diff --git a/filenames.json b/filenames.json new file mode 100644 -index 0000000000000000000000000000000000000000..4f5588c17cf9720dab05a82ee64ba56b1860ab78 +index 0000000000000000000000000000000000000000..5804390a6185cbc5eac85af592eb0f40632d82ff --- /dev/null +++ b/filenames.json -@@ -0,0 +1,548 @@ +@@ -0,0 +1,549 @@ +// This file is automatically generated by generate_gn_filenames_json.py +// DO NOT EDIT +{ @@ -1197,6 +1197,7 @@ index 0000000000000000000000000000000000000000..4f5588c17cf9720dab05a82ee64ba56b + "lib/internal/util/inspect.js", + "lib/internal/util/iterable_weak_map.js", + "lib/internal/streams/add-abort-signal.js", ++ "lib/internal/streams/duplexify.js", + "lib/internal/streams/destroy.js", + "lib/internal/streams/legacy.js", + "lib/internal/streams/passthrough.js", @@ -1726,7 +1727,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483 + args = rebase_path(inputs + outputs, root_build_dir) +} diff --git a/src/node_version.h b/src/node_version.h -index ee1263b8eaaab696b213b308d4aeb01359a289c8..5c4bda9aa24ee8f5db89d20772c28e66d574bcaa 100644 +index fc09960e70b4999635889615f584588ed1ca76d5..9b4de7c6015a700206c331c0c083e4aec200c939 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -89,7 +89,10 @@ diff --git a/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch b/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch index b431071f4ea3f..42ac178a2f53e 100644 --- a/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch +++ b/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch @@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid out in memory on 64-bit machines, and will summarily fail to work. diff --git a/common.gypi b/common.gypi -index df463864778a30b2d2fd769a82ab3c066730b559..ae3f2d69f76f46cbb8cb3f8b32da592160b66009 100644 +index f1f921f92ed4d504f2cf41bded1821def565c9a3..9525a6639f084136ed25c9b1790a00a461f24b11 100644 --- a/common.gypi +++ b/common.gypi @@ -64,7 +64,7 @@ diff --git a/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch b/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch index 819451d863bd1..7187eced6cdb9 100644 --- a/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch +++ b/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch @@ -67,7 +67,7 @@ index 3ee25ebbd67a01d607456e5158c98ca2fdea396b..6302bb925339d709a54151a8fc8b58f1 std::string tz; if (credentials::SafeGetenv("TZ", &tz) && !tz.empty()) { diff --git a/src/node.h b/src/node.h -index 4348dfba5b2be8973eda7f36bfb9479a744a07f6..4e533cab0b74221219752aea7533866830067c09 100644 +index 049163bf27cc7c1d6433b65becab0d7761491f09..09cb7a317cc46e88e5d214996dc87dc6e8730b1a 100644 --- a/src/node.h +++ b/src/node.h @@ -213,6 +213,8 @@ namespace node { diff --git a/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch b/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch index 4fabeb0a0c297..c0d0ad68c4a44 100644 --- a/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch +++ b/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch @@ -7,7 +7,7 @@ common.gypi is a file that's included in the node header bundle, despite the fact that we do not build node with gyp. diff --git a/common.gypi b/common.gypi -index fcd1cebeb560079b8b3b520e85c6c53bd1e779e0..df463864778a30b2d2fd769a82ab3c066730b559 100644 +index 8db2c0dec6ecfef968a945b570fdbd77ee62bdb8..f1f921f92ed4d504f2cf41bded1821def565c9a3 100644 --- a/common.gypi +++ b/common.gypi @@ -81,6 +81,23 @@ diff --git a/patches/node/fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch b/patches/node/fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch index 5225469d81010..90f9b8cc2a814 100644 --- a/patches/node/fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch +++ b/patches/node/fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch @@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this. diff --git a/common.gypi b/common.gypi -index ae3f2d69f76f46cbb8cb3f8b32da592160b66009..9e25bbed1802c9531701235c438fe33076c3f326 100644 +index 9525a6639f084136ed25c9b1790a00a461f24b11..7c3fb852e1eb0e4382b25e6406c7d6514cf4fd21 100644 --- a/common.gypi +++ b/common.gypi @@ -65,6 +65,7 @@ diff --git a/patches/node/fix_allow_preventing_initializeinspector_in_env.patch b/patches/node/fix_allow_preventing_initializeinspector_in_env.patch index 17adcc66aee17..43229508452e0 100644 --- a/patches/node/fix_allow_preventing_initializeinspector_in_env.patch +++ b/patches/node/fix_allow_preventing_initializeinspector_in_env.patch @@ -11,10 +11,10 @@ initialize it in the browser process. This adds a new EnvironmentFlags option which allows preventing that invocation. diff --git a/src/api/environment.cc b/src/api/environment.cc -index de29d45adde76587f2a9cd50392ba45b8e24839e..09c0d22ff91856704f61024646c946a39baf53d8 100644 +index 523d252e08974a10f9a53fb46d3345669cec3380..5bf19a0dda42849159d954181058897c45d280fd 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -341,12 +341,14 @@ Environment* CreateEnvironment( +@@ -344,12 +344,14 @@ Environment* CreateEnvironment( Environment* env = new Environment( isolate_data, context, args, exec_args, nullptr, flags, thread_id); #if HAVE_INSPECTOR @@ -36,11 +36,11 @@ index de29d45adde76587f2a9cd50392ba45b8e24839e..09c0d22ff91856704f61024646c946a3 #endif diff --git a/src/env-inl.h b/src/env-inl.h -index b3b1ea908253b9240cc37931f34b2a8c8c9fa3ab..dc37298aa0e13bb79030123f38070d0254691b28 100644 +index 061897d95d8b5f61968c59260e609d7be724b88f..7c7ee3207089bf3e51db646a367bdd6deba18628 100644 --- a/src/env-inl.h +++ b/src/env-inl.h -@@ -877,6 +877,10 @@ inline bool Environment::tracks_unmanaged_fds() const { - return flags_ & EnvironmentFlags::kTrackUnmanagedFds; +@@ -881,6 +881,10 @@ inline bool Environment::hide_console_windows() const { + return flags_ & EnvironmentFlags::kHideConsoleWindows; } +inline bool Environment::should_initialize_inspector() const { @@ -51,31 +51,31 @@ index b3b1ea908253b9240cc37931f34b2a8c8c9fa3ab..dc37298aa0e13bb79030123f38070d02 return emit_filehandle_warning_; } diff --git a/src/env.h b/src/env.h -index 24b4a48b5f9657cc115aaa50e0f7354534ed5484..0877f5b1fe2db42acf908e0e1085626fc258ef54 100644 +index 8760bc4361f199a2e3471c4ca435f8e178c78e7e..33f34ed79452b004b5fb40e70cda6e3d0ee2d1e2 100644 --- a/src/env.h +++ b/src/env.h -@@ -1198,6 +1198,7 @@ class Environment : public MemoryRetainer { - inline bool owns_process_state() const; +@@ -1199,6 +1199,7 @@ class Environment : public MemoryRetainer { inline bool owns_inspector() const; inline bool tracks_unmanaged_fds() const; + inline bool hide_console_windows() const; + inline bool should_initialize_inspector() const; inline uint64_t thread_id() const; inline worker::Worker* worker_context() const; Environment* worker_parent_env() const; diff --git a/src/node.h b/src/node.h -index 41f79ef869128636ac04093919e8e5816b39bef9..691c16ba60b0ce8633555825e44c3ace96c5000f 100644 +index b7f3e97873ef90b635e0648639f1a287a0bd88fa..48e378079f6d05e7cc1141a8875450b125028789 100644 --- a/src/node.h +++ b/src/node.h -@@ -405,7 +405,11 @@ enum Flags : uint64_t { - kNoRegisterESMLoader = 1 << 3, - // Set this flag to make Node.js track "raw" file descriptors, i.e. managed - // by fs.open() and fs.close(), and close them during FreeEnvironment(). -- kTrackUnmanagedFds = 1 << 4 -+ kTrackUnmanagedFds = 1 << 4, +@@ -409,7 +409,11 @@ enum Flags : uint64_t { + // Set this flag to force hiding console windows when spawning child + // processes. This is usually used when embedding Node.js in GUI programs on + // Windows. +- kHideConsoleWindows = 1 << 5 ++ kHideConsoleWindows = 1 << 5, + // Controls whether or not the Environment should call InitializeInspector. + // This control is needed by embedders who may not want to initialize the V8 + // inspector in situations where it already exists. -+ kNoInitializeInspector = 1 << 5 ++ kNoInitializeInspector = 1 << 6 }; } // namespace EnvironmentFlags 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 deleted file mode 100644 index 7016b8334c927..0000000000000 --- a/patches/node/fix_don_t_create_console_window_when_creating_process.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Mon, 30 Jul 2018 10:23:05 -0700 -Subject: fix: don't create console window when creating process - -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 https://github.com/nodejs/node/pull/21316 - -diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c -index 4038fbfd290d1acc91a27ad38e248a2deb06eb68..1ebc0f50e3f0cccb4d8887322b75e61c5284ba2f 100644 ---- a/deps/uv/src/win/process.c -+++ b/deps/uv/src/win/process.c -@@ -1098,6 +1098,9 @@ int uv_spawn(uv_loop_t* loop, - process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP; - } - -+ /* Don't create console window. */ -+ process_flags |= CREATE_NO_WINDOW; -+ - if (!CreateProcessW(application_path, - arguments, - NULL, diff --git a/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch b/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch index cec5aba4439a4..eabb5e6ebcc20 100644 --- a/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch +++ b/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch @@ -7,10 +7,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead This API is used by Electron to create Node's tracing controller. diff --git a/src/api/environment.cc b/src/api/environment.cc -index b7e213602b57d5cf15890726ae773d6067877c44..de29d45adde76587f2a9cd50392ba45b8e24839e 100644 +index 0fb750c5abbe00740f2095ec397c823e26666199..523d252e08974a10f9a53fb46d3345669cec3380 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -456,6 +456,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { +@@ -459,6 +459,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { return env->platform(); } @@ -22,7 +22,7 @@ index b7e213602b57d5cf15890726ae773d6067877c44..de29d45adde76587f2a9cd50392ba45b int thread_pool_size, node::tracing::TracingController* tracing_controller) { diff --git a/src/node.h b/src/node.h -index 4e533cab0b74221219752aea7533866830067c09..41f79ef869128636ac04093919e8e5816b39bef9 100644 +index 09cb7a317cc46e88e5d214996dc87dc6e8730b1a..b7f3e97873ef90b635e0648639f1a287a0bd88fa 100644 --- a/src/node.h +++ b/src/node.h @@ -118,6 +118,7 @@ namespace node { @@ -33,7 +33,7 @@ index 4e533cab0b74221219752aea7533866830067c09..41f79ef869128636ac04093919e8e581 class TracingController; } -@@ -484,6 +485,8 @@ NODE_EXTERN v8::MaybeLocal PrepareStackTraceCallback( +@@ -488,6 +489,8 @@ NODE_EXTERN v8::MaybeLocal PrepareStackTraceCallback( NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env); NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env); diff --git a/patches/node/src_allow_embedders_to_provide_a_custom_pageallocator_to.patch b/patches/node/src_allow_embedders_to_provide_a_custom_pageallocator_to.patch index 92276d143327b..96102714f1a79 100644 --- a/patches/node/src_allow_embedders_to_provide_a_custom_pageallocator_to.patch +++ b/patches/node/src_allow_embedders_to_provide_a_custom_pageallocator_to.patch @@ -12,10 +12,10 @@ allocator that does handle these cases. Upstreamed in https://github.com/nodejs/node/pull/38362. diff --git a/src/api/environment.cc b/src/api/environment.cc -index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095984e4381 100644 +index 5bf19a0dda42849159d954181058897c45d280fd..03078ff3869fcd17101f1cdaf77f725dbbfa43e8 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -472,8 +472,9 @@ MultiIsolatePlatform* CreatePlatform( +@@ -475,8 +475,9 @@ MultiIsolatePlatform* CreatePlatform( MultiIsolatePlatform* CreatePlatform( int thread_pool_size, @@ -27,7 +27,7 @@ index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095 .release(); } -@@ -483,8 +484,9 @@ void FreePlatform(MultiIsolatePlatform* platform) { +@@ -486,8 +487,9 @@ void FreePlatform(MultiIsolatePlatform* platform) { std::unique_ptr MultiIsolatePlatform::Create( int thread_pool_size, @@ -40,7 +40,7 @@ index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095 MaybeLocal GetPerContextExports(Local context) { diff --git a/src/node.h b/src/node.h -index 691c16ba60b0ce8633555825e44c3ace96c5000f..ccb452bbe941c30fdc8c4eb616eb6f0259aa8b8e 100644 +index 48e378079f6d05e7cc1141a8875450b125028789..22e095804bca9d73d22707169c5aff2b13994344 100644 --- a/src/node.h +++ b/src/node.h @@ -313,7 +313,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { @@ -53,7 +53,7 @@ index 691c16ba60b0ce8633555825e44c3ace96c5000f..ccb452bbe941c30fdc8c4eb616eb6f02 }; enum IsolateSettingsFlags { -@@ -494,7 +495,8 @@ NODE_EXTERN node::tracing::Agent* CreateAgent(); +@@ -498,7 +499,8 @@ NODE_EXTERN node::tracing::Agent* CreateAgent(); NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead", NODE_EXTERN MultiIsolatePlatform* CreatePlatform( int thread_pool_size, diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 7bf1e9f611d74..b5796649a77b4 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -450,13 +450,15 @@ node::Environment* NodeBindings::CreateEnvironment( node::CreateIsolateData(context->GetIsolate(), uv_loop_, platform); node::Environment* env; + uint64_t flags = node::EnvironmentFlags::kDefaultFlags | + node::EnvironmentFlags::kHideConsoleWindows; + if (browser_env_ != BrowserEnvironment::kBrowser) { // Only one ESM loader can be registered per isolate - // in renderer processes this should be blink. We need to tell Node.js // not to register its handler (overriding blinks) in non-browser processes. - uint64_t flags = node::EnvironmentFlags::kDefaultFlags | - node::EnvironmentFlags::kNoRegisterESMLoader | - node::EnvironmentFlags::kNoInitializeInspector; + flags |= node::EnvironmentFlags::kNoRegisterESMLoader | + node::EnvironmentFlags::kNoInitializeInspector; v8::TryCatch try_catch(context->GetIsolate()); env = node::CreateEnvironment( isolate_data_, context, args, exec_args, @@ -470,7 +472,9 @@ node::Environment* NodeBindings::CreateEnvironment( << process_type; } } else { - env = node::CreateEnvironment(isolate_data_, context, args, exec_args); + env = node::CreateEnvironment( + isolate_data_, context, args, exec_args, + static_cast(flags)); DCHECK(env); }