From dfc60f0f4246a542a45601f93572eca77bdff2f9 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:19:41 +0200 Subject: [PATCH] chore: bump node to v22.20.0 (37-x-y) (#48380) * chore: bump node in DEPS to v22.20.0 * chore: fixup patch indices * [v22.x-backport] lib: make domexception a native error https://github.com/nodejs/node/pull/59957 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- DEPS | 2 +- ..._to_foreground_task_runner_signature.patch | 4 +- patches/node/build_add_gn_build_files.patch | 6 +- .../build_compile_with_c_20_support.patch | 4 +- patches/node/build_enable_perfetto.patch | 16 +-- ...compilation_fails_if_not_using_a_new.patch | 8 +- ...f_original-fs_and_custom_embedder_js.patch | 2 +- ...e_clang_as_default_compiler_on_macos.patch | 2 +- ...e_expose_importmoduledynamically_and.patch | 8 +- ...cli_move_--trace-atomics-wait_to_eol.patch | 18 +-- .../node/cli_remove_deprecated_v8_flag.patch | 6 +- ...enable_crashpad_linux_node_processes.patch | 6 +- ..._values_for_variables_in_common_gypi.patch | 2 +- ...d_source_location_for_v8_task_runner.patch | 8 +- ...g_fileexists_fn_to_legacymainresolve.patch | 10 +- ...ssert_module_in_the_renderer_process.patch | 2 +- .../node/fix_cppgc_initializing_twice.patch | 4 +- ..._do_not_resolve_electron_entrypoints.patch | 13 +- ...se_readfilesync_override_for_modules.patch | 4 +- ...n_electron_module_via_the_esm_loader.patch | 24 ++-- ...ingssl_and_openssl_incompatibilities.patch | 26 ++-- ...in_esm_loaders_to_apply_asar_patches.patch | 8 +- ...ix_remove_deprecated_errno_constants.patch | 2 +- .../fix_remove_fastapitypedarray_usage.patch | 6 +- ...emove_outdated_v8_flags_from_node_cc.patch | 2 +- ...ch_cppgc_heap_on_v8_isolate_creation.patch | 32 ++--- ...not_use_soon-to-be-deprecated_v8_api.patch | 8 +- ..._on_wrapper-descriptor-based_cppheap.patch | 18 +-- .../node/support_v8_sandboxed_pointers.patch | 14 +-- ...st_formally_mark_some_tests_as_flaky.patch | 4 +- patches/v8/.patches | 1 + ...w_host_defined_serializer_of_jserror.patch | 114 ++++++++++++++++++ 32 files changed, 250 insertions(+), 134 deletions(-) create mode 100644 patches/v8/allow_host_defined_serializer_of_jserror.patch diff --git a/DEPS b/DEPS index 74ff89aa92ef..be5b2f6735bd 100644 --- a/DEPS +++ b/DEPS @@ -4,7 +4,7 @@ vars = { 'chromium_version': '138.0.7204.251', 'node_version': - 'v22.19.0', + 'v22.20.0', 'nan_version': 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': diff --git a/patches/node/add_v8_taskpirority_to_foreground_task_runner_signature.patch b/patches/node/add_v8_taskpirority_to_foreground_task_runner_signature.patch index e1497804ce73..8d89edc40754 100644 --- a/patches/node/add_v8_taskpirority_to_foreground_task_runner_signature.patch +++ b/patches/node/add_v8_taskpirority_to_foreground_task_runner_signature.patch @@ -8,10 +8,10 @@ naturally upstream, and we will be able to remove this patch in a future Node.js upgrade. diff --git a/src/node_platform.cc b/src/node_platform.cc -index b438b3774d0aa7680fdbc6c6bf39a87893d221b2..ec355061825fb861c17fa2e6cc967b4c7b8d4586 100644 +index b24e170cb247261d4a16d77ad40df4dfd33709d9..5e31f984b5655ae2d1d7559b1bd550ba6dc90fb4 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc -@@ -687,8 +687,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { +@@ -688,8 +688,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { return ForIsolate(isolate)->IdleTasksEnabled(); } diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index ed758f53ab54..9176dfe6f4e3 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -11,10 +11,10 @@ really in 20/21. We have to wait until 22 is released to be able to build with upstream GN files. diff --git a/configure.py b/configure.py -index 2415940835036226799a7ea14c6687cc0d56c523..0feb07afbccad97a92cee00954443407eb20ac67 100755 +index 91283ca577f580dbf1e0c4e2dbf851a9ceaa38ed..e8eaff30ec947677db2d45425f9180759d0c55de 100755 --- a/configure.py +++ b/configure.py -@@ -1722,7 +1722,7 @@ def configure_v8(o, configs): +@@ -1728,7 +1728,7 @@ def configure_v8(o, configs): # Until we manage to get rid of all those, v8_enable_sandbox cannot be used. # Note that enabling pointer compression without enabling sandbox is unsupported by V8, # so this can be broken at any time. @@ -68,7 +68,7 @@ index d4438f7fd61598afac2c1e3184721a759d22b10c..e2407027ab05e59b2f0f1c213b98ea46 assert(!node_enable_inspector || node_use_openssl, diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index b4acc40618e372b09d0cb5e3755034f08711a282..efeaaef7e4dc64a0adb5e6bdbbe18945890de62c 100644 +index b83aa87c969fb4e71cb202816713af869bb76283..c54df6fee333ddfe59b9df7e0ddd2935b4dcb33f 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -789,6 +789,7 @@ void BuiltinLoader::RegisterExternalReferences( diff --git a/patches/node/build_compile_with_c_20_support.patch b/patches/node/build_compile_with_c_20_support.patch index 4ea916a3b134..c7faa4e0db27 100644 --- a/patches/node/build_compile_with_c_20_support.patch +++ b/patches/node/build_compile_with_c_20_support.patch @@ -10,7 +10,7 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8 This can be removed when Electron upgrades to a version of Node.js containing the required V8 version. diff --git a/common.gypi b/common.gypi -index 3a1d2fc9d147a8c89f7b5231d63d37f29979965d..6425ee9e8dba993f3e899362ce9bd7b097f08883 100644 +index c28d6f5fe2c922f0b1e3f7e56289c78e7b91c294..95c56305926fc3e0e46e4cf99ec86d3d1b5576a7 100644 --- a/common.gypi +++ b/common.gypi @@ -539,7 +539,7 @@ @@ -22,7 +22,7 @@ index 3a1d2fc9d147a8c89f7b5231d63d37f29979965d..6425ee9e8dba993f3e899362ce9bd7b0 ], 'defines': [ '__STDC_FORMAT_MACROS' ], 'ldflags': [ '-rdynamic' ], -@@ -709,7 +709,7 @@ +@@ -719,7 +719,7 @@ ['clang==1', { 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', diff --git a/patches/node/build_enable_perfetto.patch b/patches/node/build_enable_perfetto.patch index a4aff646cb11..5f481d544c8e 100644 --- a/patches/node/build_enable_perfetto.patch +++ b/patches/node/build_enable_perfetto.patch @@ -64,10 +64,10 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327 module.exports = { diff --git a/node.gyp b/node.gyp -index d604e0ddd973174aa7be6f2d250af7b9c2b0fcfd..8e97aa3f44087213425927113fe72bca9ddef45b 100644 +index 0e0071b508f605bb9b7722f8304814dc176d907e..bcb9f371c4e4d8c665058115dc39eaa65125d679 100644 --- a/node.gyp +++ b/node.gyp -@@ -176,7 +176,6 @@ +@@ -174,7 +174,6 @@ 'src/timers.cc', 'src/timer_wrap.cc', 'src/tracing/agent.cc', @@ -75,7 +75,7 @@ index d604e0ddd973174aa7be6f2d250af7b9c2b0fcfd..8e97aa3f44087213425927113fe72bca 'src/tracing/node_trace_writer.cc', 'src/tracing/trace_event.cc', 'src/tracing/traced_value.cc', -@@ -304,7 +303,6 @@ +@@ -302,7 +301,6 @@ 'src/tcp_wrap.h', 'src/timers.h', 'src/tracing/agent.h', @@ -105,7 +105,7 @@ index 40c8aea35c931c46fc62b717c978eab0659645fd..348cdfb0b42aa18f352c220cea0b896c if (!json_writer_) return; diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc -index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187177fc3bd 100644 +index eddcf6c3bf91b730d6ca72960e3048ceed7e7844..184e8647b2148bc597d9d3eb63f86ae99917c642 100644 --- a/src/tracing/agent.cc +++ b/src/tracing/agent.cc @@ -2,7 +2,9 @@ @@ -144,7 +144,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187 // This thread should be created *after* async handles are created // (within NodeTraceWriter and NodeTraceBuffer constructors). -@@ -143,8 +151,10 @@ void Agent::StopTracing() { +@@ -148,8 +156,10 @@ void Agent::StopTracing() { return; // Perform final Flush on TraceBuffer. We don't want the tracing controller // to flush the buffer again on destruction of the V8::Platform. @@ -156,7 +156,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187 started_ = false; // Thread should finish when the tracing loop is stopped. -@@ -202,6 +212,7 @@ std::string Agent::GetEnabledCategories() const { +@@ -207,6 +217,7 @@ std::string Agent::GetEnabledCategories() const { return categories; } @@ -164,7 +164,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187 void Agent::AppendTraceEvent(TraceObject* trace_event) { for (const auto& id_writer : writers_) id_writer.second->AppendTraceEvent(trace_event); -@@ -211,18 +222,21 @@ void Agent::AddMetadataEvent(std::unique_ptr event) { +@@ -216,18 +227,21 @@ void Agent::AddMetadataEvent(std::unique_ptr event) { Mutex::ScopedLock lock(metadata_events_mutex_); metadata_events_.push_back(std::move(event)); } @@ -187,7 +187,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187 void TracingController::AddMetadataEvent( const unsigned char* category_group_enabled, const char* name, -@@ -246,6 +260,6 @@ void TracingController::AddMetadataEvent( +@@ -251,6 +265,6 @@ void TracingController::AddMetadataEvent( if (node_agent != nullptr) node_agent->AddMetadataEvent(std::move(trace_event)); } diff --git a/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch b/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch index c698eb182600..6c6d33c0276d 100644 --- a/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch +++ b/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch @@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new This should not be upstreamed, it is a quality-of-life patch for downstream module builders. diff --git a/common.gypi b/common.gypi -index e56ba31ed068b81f5c6fbd432cd82bb6916e9a85..3a1d2fc9d147a8c89f7b5231d63d37f29979965d 100644 +index 6b79de07be3f839af5b0644f19bfef9c33de590e..c28d6f5fe2c922f0b1e3f7e56289c78e7b91c294 100644 --- a/common.gypi +++ b/common.gypi @@ -89,6 +89,8 @@ @@ -42,10 +42,10 @@ index e56ba31ed068b81f5c6fbd432cd82bb6916e9a85..3a1d2fc9d147a8c89f7b5231d63d37f2 # list in v8/BUILD.gn. ['v8_enable_v8_checks == 1', { diff --git a/configure.py b/configure.py -index 0feb07afbccad97a92cee00954443407eb20ac67..5eccced7cf0212f229db68c76cc824a37e4a29bc 100755 +index e8eaff30ec947677db2d45425f9180759d0c55de..dc2d9d80059e845b33444f8bdc29e82d0fe0e26b 100755 --- a/configure.py +++ b/configure.py -@@ -1704,6 +1704,7 @@ def configure_library(lib, output, pkgname=None): +@@ -1710,6 +1710,7 @@ def configure_library(lib, output, pkgname=None): def configure_v8(o, configs): set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0) @@ -54,7 +54,7 @@ index 0feb07afbccad97a92cee00954443407eb20ac67..5eccced7cf0212f229db68c76cc824a3 o['variables']['v8_enable_javascript_promise_hooks'] = 1 o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0 diff --git a/src/node.h b/src/node.h -index 835c78145956de3d8c52b6cc0581bcfef600f90b..174fd4d1af4c8cd75aec09f4548a674fd5539fb2 100644 +index a336f44dc1e785ea237865077216d41ab032c0af..96c599aa6448e2aa8e57e84f811564a5281c139a 100644 --- a/src/node.h +++ b/src/node.h @@ -22,6 +22,12 @@ diff --git a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch index 270f96dc50c2..27bb1db444b5 100644 --- a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch +++ b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch @@ -34,7 +34,7 @@ index 0244a214b187e67e0cb89f26cd019855963ec93a..b65a3be6bcb0e28f7f43367d0fa9da53 let kResistStopPropagation; diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index efeaaef7e4dc64a0adb5e6bdbbe18945890de62c..557972987abeaa56918362638a17a9b6e0763238 100644 +index c54df6fee333ddfe59b9df7e0ddd2935b4dcb33f..4b288e0f89e0156cb5b0555c0259b2c1150770db 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -35,6 +35,7 @@ using v8::Value; diff --git a/patches/node/build_restore_clang_as_default_compiler_on_macos.patch b/patches/node/build_restore_clang_as_default_compiler_on_macos.patch index e03a0c393202..085cae86bc2a 100644 --- a/patches/node/build_restore_clang_as_default_compiler_on_macos.patch +++ b/patches/node/build_restore_clang_as_default_compiler_on_macos.patch @@ -11,7 +11,7 @@ node-gyp will use the result of `process.config` that reflects the environment in which the binary got built. diff --git a/common.gypi b/common.gypi -index 6425ee9e8dba993f3e899362ce9bd7b097f08883..95d66f75b582b3fd3b833109dfe110ae5b196f83 100644 +index 95c56305926fc3e0e46e4cf99ec86d3d1b5576a7..45bb2c4ff94ceac377c9117da4497cdc5ac41171 100644 --- a/common.gypi +++ b/common.gypi @@ -128,6 +128,7 @@ diff --git a/patches/node/chore_expose_importmoduledynamically_and.patch b/patches/node/chore_expose_importmoduledynamically_and.patch index 3f44ec26449e..072c465e1185 100644 --- a/patches/node/chore_expose_importmoduledynamically_and.patch +++ b/patches/node/chore_expose_importmoduledynamically_and.patch @@ -40,10 +40,10 @@ index 9b41db8b0714b7408f79cbd5b4c460d9bc08f239..35ecfb9bbaf2c8e7351e1c69da84c82a /** diff --git a/src/module_wrap.cc b/src/module_wrap.cc -index e317a84e55714af0a93719336d02ac26410ad724..e3880111172363feafb53b51deb08c93596cd4f4 100644 +index c52e20d742942667f43ea3e151fc6702260b176b..cbb3e7f4df72f83cb8a1afc25a7429218792e964 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc -@@ -895,7 +895,7 @@ MaybeLocal ModuleWrap::ResolveModuleCallback( +@@ -901,7 +901,7 @@ MaybeLocal ModuleWrap::ResolveModuleCallback( return module->module_.Get(isolate); } @@ -52,7 +52,7 @@ index e317a84e55714af0a93719336d02ac26410ad724..e3880111172363feafb53b51deb08c93 Local context, Local host_defined_options, Local resource_name, -@@ -967,12 +967,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( +@@ -973,12 +973,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( Realm* realm = Realm::GetCurrent(args); HandleScope handle_scope(isolate); @@ -68,7 +68,7 @@ index e317a84e55714af0a93719336d02ac26410ad724..e3880111172363feafb53b51deb08c93 } void ModuleWrap::HostInitializeImportMetaObjectCallback( -@@ -1014,13 +1015,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( +@@ -1020,13 +1021,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( Realm* realm = Realm::GetCurrent(args); Isolate* isolate = realm->isolate(); diff --git a/patches/node/cli_move_--trace-atomics-wait_to_eol.patch b/patches/node/cli_move_--trace-atomics-wait_to_eol.patch index b2451d795d6a..394ae7770d0c 100644 --- a/patches/node/cli_move_--trace-atomics-wait_to_eol.patch +++ b/patches/node/cli_move_--trace-atomics-wait_to_eol.patch @@ -15,10 +15,10 @@ Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yagiz Nizipli diff --git a/doc/api/cli.md b/doc/api/cli.md -index 8cabb58e621a9951acd5551afb85c192f2b1c690..b69bacebef3e5e5e5b191c61aa5fe0f71c1edfb3 100644 +index 9a0e83b95a72486ab9751b3b8818f4beeb527041..1da7126b9d51238e9b89ee6bed602df3f5598a9e 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md -@@ -2712,39 +2712,6 @@ added: v12.0.0 +@@ -2727,39 +2727,6 @@ added: v12.0.0 Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support for TLSv1.2, which is not as secure as TLSv1.3. @@ -58,7 +58,7 @@ index 8cabb58e621a9951acd5551afb85c192f2b1c690..b69bacebef3e5e5e5b191c61aa5fe0f7 ### `--trace-deprecation`