diff --git a/DEPS b/DEPS index c333a6e13b26..37160ea6c0ab 100644 --- a/DEPS +++ b/DEPS @@ -4,7 +4,7 @@ vars = { 'chromium_version': '134.0.6998.205', 'node_version': - 'v22.15.1', + 'v22.16.0', 'nan_version': 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': diff --git a/patches/node/.patches b/patches/node/.patches index baf653372b7e..f80c3bc864e3 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -43,5 +43,4 @@ linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch build_option_to_use_custom_inspector_protocol_path.patch fix_ensure_traverseparent_bails_on_resource_path_exit.patch -zlib_fix_pointer_alignment.patch fix_expose_readfilesync_override_for_modules.patch 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 43b5a271bedf..e1497804ce73 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 65a9b79ae6ac8b7589e8f8109a709acb41d12b97..743ac069ad579a208a632ef5096ae46c8a0dfd74 100644 +index b438b3774d0aa7680fdbc6c6bf39a87893d221b2..ec355061825fb861c17fa2e6cc967b4c7b8d4586 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc -@@ -556,8 +556,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { +@@ -687,8 +687,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { return ForIsolate(isolate)->IdleTasksEnabled(); } @@ -23,10 +23,10 @@ index 65a9b79ae6ac8b7589e8f8109a709acb41d12b97..743ac069ad579a208a632ef5096ae46c } diff --git a/src/node_platform.h b/src/node_platform.h -index dde2d1b5687a5b52a4f09183bb4ff88d7d3e4d01..0a99f5b4b5eeb221ef3a34db7a50955c32d3c163 100644 +index a0222b4a1b074c6708e390d58d04221717069ac1..8015ca1801573c3a7c4a5db6d0f10b4016a9267c 100644 --- a/src/node_platform.h +++ b/src/node_platform.h -@@ -177,7 +177,7 @@ class NodePlatform : public MultiIsolatePlatform { +@@ -213,7 +213,7 @@ class NodePlatform : public MultiIsolatePlatform { void (*callback)(void*), void* data) override; std::shared_ptr GetForegroundTaskRunner( diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 96131e36265a..583ea9cea093 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -55,10 +55,10 @@ index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3f assert(!node_enable_inspector || node_use_openssl, diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index e85860de93dd5753dd4542ecee9f0888af93898a..04eab49c368c8f86837ed2c1384bf3c63e4bde24 100644 +index defb657a62a0316224a02b68505ac1142fd89d03..d637faac88875bfa110e2b8d1f53962061d98279 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -783,6 +783,7 @@ void BuiltinLoader::RegisterExternalReferences( +@@ -785,6 +785,7 @@ void BuiltinLoader::RegisterExternalReferences( registry->Register(GetNatives); RegisterExternalReferencesForInternalizedBuiltinCode(registry); @@ -67,7 +67,7 @@ index e85860de93dd5753dd4542ecee9f0888af93898a..04eab49c368c8f86837ed2c1384bf3c6 } // namespace builtins diff --git a/src/node_builtins.h b/src/node_builtins.h -index a73de23a1debfdac66873e0baccf882e383bfc36..7ac5291be093773ee7efd39e77e01bf5d5ce5247 100644 +index f9426599f2d5dc6ad061407f0c4eb2c9203a4433..302030f610965f07dd6998d282275c1bdf738009 100644 --- a/src/node_builtins.h +++ b/src/node_builtins.h @@ -74,6 +74,8 @@ using BuiltinCodeCacheMap = @@ -250,10 +250,10 @@ index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd1 if sys.platform == 'win32': files = [ x.replace('\\', '/') for x in files ] diff --git a/unofficial.gni b/unofficial.gni -index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50ae50a3d8 100644 +index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187f3c04c5c 100644 --- a/unofficial.gni +++ b/unofficial.gni -@@ -142,32 +142,39 @@ template("node_gn_build") { +@@ -142,32 +142,42 @@ template("node_gn_build") { public_configs = [ ":node_external_config", "deps/googletest:googletest_config", @@ -288,7 +288,10 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50 "$node_v8_path:v8_libplatform", ] -+ cflags_cc = [ "-Wno-unguarded-availability-new" ] ++ cflags_cc = [ ++ "-Wno-unguarded-availability-new", ++ "-Wno-return-stack-address" ++ ] + sources = [ + "src/node_snapshot_stub.cc", @@ -296,7 +299,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50 "$target_gen_dir/node_javascript.cc", ] + gypi_values.node_sources -@@ -190,7 +197,7 @@ template("node_gn_build") { +@@ -190,7 +200,7 @@ template("node_gn_build") { } if (node_use_openssl) { deps += [ "deps/ncrypto" ] @@ -305,7 +308,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50 sources += gypi_values.node_crypto_sources } if (node_enable_inspector) { -@@ -214,6 +221,10 @@ template("node_gn_build") { +@@ -214,6 +224,10 @@ template("node_gn_build") { } } @@ -316,7 +319,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50 executable(target_name) { forward_variables_from(invoker, "*") -@@ -288,6 +299,7 @@ template("node_gn_build") { +@@ -288,6 +302,7 @@ template("node_gn_build") { } executable("node_js2c") { @@ -324,7 +327,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50 deps = [ "deps/uv", "$node_simdutf_path", -@@ -298,26 +310,75 @@ template("node_gn_build") { +@@ -298,26 +313,75 @@ template("node_gn_build") { "src/embedded_data.cc", "src/embedded_data.h", ] @@ -410,7 +413,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50 outputs = [ "$target_gen_dir/node_javascript.cc" ] # Get the path to node_js2c executable of the host toolchain. -@@ -331,11 +392,11 @@ template("node_gn_build") { +@@ -331,11 +395,11 @@ template("node_gn_build") { get_label_info(":node_js2c($host_toolchain)", "name") + host_executable_suffix diff --git a/patches/node/build_allow_unbundling_of_node_js_dependencies.patch b/patches/node/build_allow_unbundling_of_node_js_dependencies.patch index a38d9cc5f007..c36f65af02e6 100644 --- a/patches/node/build_allow_unbundling_of_node_js_dependencies.patch +++ b/patches/node/build_allow_unbundling_of_node_js_dependencies.patch @@ -14,7 +14,7 @@ We don't need to do this for zlib, as the existing gn workflow uses the same Upstreamed at https://github.com/nodejs/node/pull/55903 diff --git a/unofficial.gni b/unofficial.gni -index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f756b2e34a 100644 +index e17e4f043af6e4047ab82723ffd83187f3c04c5c..d591dfc99fdea4f830008502786ee44d863a31fc 100644 --- a/unofficial.gni +++ b/unofficial.gni @@ -155,7 +155,6 @@ template("node_gn_build") { @@ -25,7 +25,7 @@ index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f7 "deps/nbytes", "deps/nghttp2", "deps/postject", -@@ -191,7 +190,17 @@ template("node_gn_build") { +@@ -194,7 +193,17 @@ template("node_gn_build") { configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] configs += [ "//build/config/gcc:symbol_visibility_default" ] } @@ -44,7 +44,7 @@ index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f7 if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] } -@@ -219,6 +228,19 @@ template("node_gn_build") { +@@ -222,6 +231,19 @@ template("node_gn_build") { sources += node_inspector.node_inspector_sources + node_inspector.node_inspector_generated_sources } diff --git a/patches/node/build_compile_with_c_20_support.patch b/patches/node/build_compile_with_c_20_support.patch index a21de5e73697..10aec30f9fc6 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 53016fc79c3d914982abeb61bf0a76181024e2bf..99b147482b636706b1372b89298f35b60ca2bb31 100644 +index f3476a91e4c3cda7cecf49e07bb594a167ac46ef..de73f6c18131f43e6fe3107c866599aa3398cf10 100644 --- a/common.gypi +++ b/common.gypi @@ -530,7 +530,7 @@ diff --git a/patches/node/build_enable_perfetto.patch b/patches/node/build_enable_perfetto.patch index 6aab4ea140fe..f0b97e2c4aca 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 ec1f90b73f7d119b2c0e0207a5e36f3cec7295e9..66244b6638e34536aed397f56c6a4570a73e9b90 100644 +index ad010a8d99cf08013b7202eddce66e5b3885652d..d735b887d05ddfadec8e56dd8eae09646890aa84 100644 --- a/node.gyp +++ b/node.gyp -@@ -175,7 +175,6 @@ +@@ -176,7 +176,6 @@ 'src/timers.cc', 'src/timer_wrap.cc', 'src/tracing/agent.cc', @@ -75,7 +75,7 @@ index ec1f90b73f7d119b2c0e0207a5e36f3cec7295e9..66244b6638e34536aed397f56c6a4570 'src/tracing/node_trace_writer.cc', 'src/tracing/trace_event.cc', 'src/tracing/traced_value.cc', -@@ -303,7 +302,6 @@ +@@ -305,7 +304,6 @@ 'src/tcp_wrap.h', 'src/timers.h', 'src/tracing/agent.h', 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 8b09ad639398..0527e9476f67 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 f2a45f0f0bbfce93e61d3696a18425af4d022a00..53016fc79c3d914982abeb61bf0a76181024e2bf 100644 +index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a167ac46ef 100644 --- a/common.gypi +++ b/common.gypi @@ -88,6 +88,8 @@ @@ -40,7 +40,7 @@ index f2a45f0f0bbfce93e61d3696a18425af4d022a00..53016fc79c3d914982abeb61bf0a7618 # list in v8/BUILD.gn. ['v8_enable_v8_checks == 1', { diff --git a/configure.py b/configure.py -index 95faeeef3867cbf3ca4b1857d893aa127d550a2f..b36f63a5482074f79a20709b8c4774cb6dadec52 100755 +index 932484674e5b15b765b8bfe307bdf99b49b5039f..befaa85527b9ebebad226e603586e23d04ec1e51 100755 --- a/configure.py +++ b/configure.py @@ -1698,6 +1698,7 @@ def configure_library(lib, output, pkgname=None): @@ -52,7 +52,7 @@ index 95faeeef3867cbf3ca4b1857d893aa127d550a2f..b36f63a5482074f79a20709b8c4774cb 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 8b77f7cb4d53105f42ba76d99a76a98b7a73789f..bdc77f8eb7abffa9e6c98cd254daedad3e44b981 100644 +index 835c78145956de3d8c52b6cc0581bcfef600f90b..174fd4d1af4c8cd75aec09f4548a674fd5539fb2 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 b20f8418dab3..c4c54c21fdfe 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,10 +34,10 @@ index 411eab8136d5957ae8a491bc38ffbdc88e59f5da..63c93b5be09692d0d4b6bfbb214b173b let kResistStopPropagation; diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 04eab49c368c8f86837ed2c1384bf3c63e4bde24..c3d2b3c90c206dd81a3d8aa6c14fdf4678a1cddd 100644 +index d637faac88875bfa110e2b8d1f53962061d98279..e0b58c4d0ac5640a677c22d710f88f1b318378d7 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -34,6 +34,7 @@ using v8::Value; +@@ -35,6 +35,7 @@ using v8::Value; BuiltinLoader::BuiltinLoader() : config_(GetConfig()), code_cache_(std::make_shared()) { LoadJavaScriptSource(); @@ -46,7 +46,7 @@ index 04eab49c368c8f86837ed2c1384bf3c63e4bde24..c3d2b3c90c206dd81a3d8aa6c14fdf46 AddExternalizedBuiltin( "internal/deps/cjs-module-lexer/lexer", diff --git a/src/node_builtins.h b/src/node_builtins.h -index 7ac5291be093773ee7efd39e77e01bf5d5ce5247..c3c987d535285be84026ad0c633650bd2067d22d 100644 +index 302030f610965f07dd6998d282275c1bdf738009..35cb7766eeccc62dd2f0ce9484a2f1ec7beccc05 100644 --- a/src/node_builtins.h +++ b/src/node_builtins.h @@ -138,6 +138,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader { diff --git a/patches/node/build_option_to_use_custom_inspector_protocol_path.patch b/patches/node/build_option_to_use_custom_inspector_protocol_path.patch index f64c2a1336ac..65855c6004de 100644 --- a/patches/node/build_option_to_use_custom_inspector_protocol_path.patch +++ b/patches/node/build_option_to_use_custom_inspector_protocol_path.patch @@ -65,10 +65,10 @@ index 3d7aa148678b2646b88fa7c32abec91791b02b82..4810d93eb971b253f7dadff7011a632f gypi_values = exec_script( "../../tools/gypi_to_gn.py", diff --git a/unofficial.gni b/unofficial.gni -index a8ce18acfe333350f91b3e5f235db5f756b2e34a..6bcc40b282543fc40f80c5c6659de658209844b8 100644 +index d591dfc99fdea4f830008502786ee44d863a31fc..9e26399482d6a1cdb843efb72c152d5cdd5e08ea 100644 --- a/unofficial.gni +++ b/unofficial.gni -@@ -211,13 +211,14 @@ template("node_gn_build") { +@@ -214,13 +214,14 @@ template("node_gn_build") { } if (node_enable_inspector) { deps += [ 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 7c7f11672aeb..73e7e840edf7 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 99b147482b636706b1372b89298f35b60ca2bb31..5024e5fb0aee210f4986572638a523db6d26b4cc 100644 +index de73f6c18131f43e6fe3107c866599aa3398cf10..e2171e14b9e29dfc3c629f8164545d56d5e9057e 100644 --- a/common.gypi +++ b/common.gypi @@ -127,6 +127,7 @@ diff --git a/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch b/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch index d8640574d1ce..ae864ce06db1 100644 --- a/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch +++ b/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch @@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form of this. diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index d1c05d1717cdc825c4e48885c963c9ed65bcf51c..278665921c5160ff10b3178db27d4df319fab6b3 100644 +index 4e7be0594ca1e1ceaf1963debbce46783893ed77..a6df0672bf6ae6e9a74ebbb0e4debff63599cc99 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -243,12 +243,14 @@ function patchProcessObject(expandArgv1) { +@@ -245,12 +245,14 @@ function patchProcessObject(expandArgv1) { // the entry point. if (expandArgv1 && process.argv[1] && process.argv[1][0] !== '-') { // Expand process.argv[1] into a full path. diff --git a/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch b/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch index ef4d76a3e804..4890f2089671 100644 --- a/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch +++ b/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch @@ -8,15 +8,18 @@ which causes the `ELECTRON_RUN_AS_NODE` variable to be lost. This patch re-injects it. diff --git a/test/fixtures/test-runner/output/arbitrary-output-colored.js b/test/fixtures/test-runner/output/arbitrary-output-colored.js -index af23e674cb361ed81dafa22670d5633559cd1144..1dd59990cb7cdba8aecf4f499ee6b92e7cd41b30 100644 +index 444531da1df2f9bbbc19bb8a43fb6eb2d1802d1a..81b3b3e37e5664dc53bec987a2ce3a83a8da105f 100644 --- a/test/fixtures/test-runner/output/arbitrary-output-colored.js +++ b/test/fixtures/test-runner/output/arbitrary-output-colored.js -@@ -7,6 +7,6 @@ const fixtures = require('../../../common/fixtures'); +@@ -7,9 +7,9 @@ const fixtures = require('../../../common/fixtures'); (async function run() { const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js'); const reset = fixtures.path('test-runner/output/reset-color-depth.js'); - await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit' }), 'exit'); -- await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit' }), 'exit'); + await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 }}), 'exit'); -+ await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 } }), 'exit'); + await once( +- spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit' }), ++ spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 }}), + 'exit', + ); })().then(common.mustCall()); diff --git a/patches/node/cli_remove_deprecated_v8_flag.patch b/patches/node/cli_remove_deprecated_v8_flag.patch index caff01e09ec1..70a46ac99e19 100644 --- a/patches/node/cli_remove_deprecated_v8_flag.patch +++ b/patches/node/cli_remove_deprecated_v8_flag.patch @@ -18,10 +18,10 @@ Reviewed-By: Michaƫl Zasso Reviewed-By: Yagiz Nizipli diff --git a/doc/api/cli.md b/doc/api/cli.md -index 1b42c5a7f4715e56fa5bc39cd6f78a76473406f2..114b7bbf6b1e105fc1696ed8a064065db73ff519 100644 +index 6f984926a62973ba36bd3c27cc39b01f2bcac819..121d8f2bbd2b1d93067a06a902b1e7b986bcdb49 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md -@@ -3350,7 +3350,6 @@ V8 options that are allowed are: +@@ -3404,7 +3404,6 @@ V8 options that are allowed are: * `--disallow-code-generation-from-strings` * `--enable-etw-stack-walking` * `--expose-gc` @@ -30,10 +30,10 @@ index 1b42c5a7f4715e56fa5bc39cd6f78a76473406f2..114b7bbf6b1e105fc1696ed8a064065d * `--jitless` * `--max-old-space-size` diff --git a/src/node_options.cc b/src/node_options.cc -index b22fbb0a285f6f323779d6ebb2b027a3990b031e..54b253aa54f5cdebdb04315f9c6c2506977555c0 100644 +index bb1e80ece4158dfed1b8bab7dc6d00dd56505aac..a9500716f2a955fc591628a969c5fba40783a2e7 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -984,11 +984,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( +@@ -992,11 +992,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( "disallow eval and friends", V8Option{}, kAllowedInEnvvar); 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 45edf948a98d..f21f31edd676 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 372409f4b09cc3b3be9809f697816498e5c021fe..f2a45f0f0bbfce93e61d3696a18425af4d022a00 100644 +index 393fe32765794fbc5e92690e968e3c18f0d749fa..d9c0b721fe0a629a30efb3c4e04905176ca0a7f5 100644 --- a/common.gypi +++ b/common.gypi @@ -90,6 +90,23 @@ diff --git a/patches/node/fix_add_source_location_for_v8_task_runner.patch b/patches/node/fix_add_source_location_for_v8_task_runner.patch index 35a8dba0ed36..43896b7b67e6 100644 --- a/patches/node/fix_add_source_location_for_v8_task_runner.patch +++ b/patches/node/fix_add_source_location_for_v8_task_runner.patch @@ -15,10 +15,10 @@ corresponding change. CL: https://chromium-review.googlesource.com/c/v8/v8/+/5300826 diff --git a/src/node_platform.cc b/src/node_platform.cc -index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb41d12b97 100644 +index 9c4c1e1db5fa7c0ca791e01d9be331e0957e9699..b438b3774d0aa7680fdbc6c6bf39a87893d221b2 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc -@@ -245,11 +245,13 @@ void PerIsolatePlatformData::FlushTasks(uv_async_t* handle) { +@@ -307,11 +307,13 @@ void PerIsolatePlatformData::FlushTasks(uv_async_t* handle) { platform_data->FlushForegroundTasksInternal(); } @@ -31,10 +31,10 @@ index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb -void PerIsolatePlatformData::PostTask(std::unique_ptr task) { +void PerIsolatePlatformData::PostTaskImpl(std::unique_ptr task, + const v8::SourceLocation& location) { - if (flush_tasks_ == nullptr) { - // V8 may post tasks during Isolate disposal. In that case, the only - // sensible path forward is to discard the task. -@@ -259,8 +261,10 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr task) { + // The task can be posted from any V8 background worker thread, even when + // the foreground task runner is being cleaned up by Shutdown(). In that + // case, make sure we wait until the shutdown is completed (which leads +@@ -330,8 +332,10 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr task) { uv_async_send(flush_tasks_); } @@ -44,10 +44,10 @@ index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb + std::unique_ptr task, + double delay_in_seconds, + const v8::SourceLocation& location) { - if (flush_tasks_ == nullptr) { - // V8 may post tasks during Isolate disposal. In that case, the only - // sensible path forward is to discard the task. -@@ -274,13 +278,15 @@ void PerIsolatePlatformData::PostDelayedTask( + if (debug_log_level_ != PlatformDebugLogLevel::kNone) { + fprintf(stderr, + "\nPerIsolatePlatformData::PostDelayedTaskImpl %p %f", +@@ -353,13 +357,15 @@ void PerIsolatePlatformData::PostDelayedTask( uv_async_send(flush_tasks_); } @@ -67,10 +67,10 @@ index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb } diff --git a/src/node_platform.h b/src/node_platform.h -index 77cb5e6e4f891c510cdaf7fd6175a1f00d9bc420..dde2d1b5687a5b52a4f09183bb4ff88d7d3e4d01 100644 +index af30ebeb0c8629ab86d1a55fd63610165abfbabf..a0222b4a1b074c6708e390d58d04221717069ac1 100644 --- a/src/node_platform.h +++ b/src/node_platform.h -@@ -59,18 +59,21 @@ class PerIsolatePlatformData : +@@ -80,18 +80,21 @@ class PerIsolatePlatformData : ~PerIsolatePlatformData() override; std::shared_ptr GetForegroundTaskRunner() override; diff --git a/patches/node/fix_assert_module_in_the_renderer_process.patch b/patches/node/fix_assert_module_in_the_renderer_process.patch index e6ab076547af..63191d23c70b 100644 --- a/patches/node/fix_assert_module_in_the_renderer_process.patch +++ b/patches/node/fix_assert_module_in_the_renderer_process.patch @@ -44,10 +44,10 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480 let filename = call.getFileName(); const line = call.getLineNumber() - 1; diff --git a/src/node_options.cc b/src/node_options.cc -index 23cb558a22b4462f5ce4f74833d25c7f712f8139..b22fbb0a285f6f323779d6ebb2b027a3990b031e 100644 +index 8be78889e8234eb3100f309829bf7470db544dcd..bb1e80ece4158dfed1b8bab7dc6d00dd56505aac 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -1535,14 +1535,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { +@@ -1557,14 +1557,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { } Isolate* isolate = args.GetIsolate(); diff --git a/patches/node/fix_do_not_resolve_electron_entrypoints.patch b/patches/node/fix_do_not_resolve_electron_entrypoints.patch index 5a7bbe40231e..a489cf55632f 100644 --- a/patches/node/fix_do_not_resolve_electron_entrypoints.patch +++ b/patches/node/fix_do_not_resolve_electron_entrypoints.patch @@ -20,7 +20,7 @@ index 49aacb6262502ced54e817f99dd596db85b9659c..f9f065bb743275e9b2ce71375e6a9f06 if (!loaded) { module = new CJSModule(filename); diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js -index ab4783a7982b9feb8fa85b62e3e3b181f93309bd..34f91026451d7347ae278712d083e4fe281e50f3 100644 +index 02ba43adc2c8e92a78942bbb04023a16f5870ee9..bbf1ab69b884a9325bebdd07b2c4fd354eee946b 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -2,6 +2,7 @@ diff --git a/patches/node/fix_ensure_traverseparent_bails_on_resource_path_exit.patch b/patches/node/fix_ensure_traverseparent_bails_on_resource_path_exit.patch index 37e8ed1ecbc4..2a3a90362897 100644 --- a/patches/node/fix_ensure_traverseparent_bails_on_resource_path_exit.patch +++ b/patches/node/fix_ensure_traverseparent_bails_on_resource_path_exit.patch @@ -8,10 +8,10 @@ resource path. This commit ensures that the TraverseParent function bails out if the parent path is outside of the resource path. diff --git a/src/node_modules.cc b/src/node_modules.cc -index 210a01d24e11764dc9fc37a77b354f11383693f8..4e9f70a1c41b44d2a1863b778d4f1e37279178d9 100644 +index 55d628f0c5e7f330e548878807de26d51ef025b5..c06779dea471b6f6a8dd29d4657162ef0faec043 100644 --- a/src/node_modules.cc +++ b/src/node_modules.cc -@@ -290,8 +290,41 @@ const BindingData::PackageConfig* BindingData::TraverseParent( +@@ -291,8 +291,41 @@ const BindingData::PackageConfig* BindingData::TraverseParent( Realm* realm, const std::filesystem::path& check_path) { std::filesystem::path current_path = check_path; auto env = realm->env(); @@ -53,7 +53,7 @@ index 210a01d24e11764dc9fc37a77b354f11383693f8..4e9f70a1c41b44d2a1863b778d4f1e37 do { current_path = current_path.parent_path(); -@@ -310,6 +343,12 @@ const BindingData::PackageConfig* BindingData::TraverseParent( +@@ -311,6 +344,12 @@ const BindingData::PackageConfig* BindingData::TraverseParent( return nullptr; } diff --git a/patches/node/fix_expose_readfilesync_override_for_modules.patch b/patches/node/fix_expose_readfilesync_override_for_modules.patch index c54548cd8b87..c2b377ee140a 100644 --- a/patches/node/fix_expose_readfilesync_override_for_modules.patch +++ b/patches/node/fix_expose_readfilesync_override_for_modules.patch @@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules` binding. diff --git a/src/env_properties.h b/src/env_properties.h -index ba8c80ff2842c63f16cae51cfa8084617bb35bf5..820aebd18d22bcef4992b09ffc8924e9b758fd3e 100644 +index cbb7eab2df0416087cd3e6fb80eef2079143d9c8..7e9f5e977506149d69c6015e85d031770325e1da 100644 --- a/src/env_properties.h +++ b/src/env_properties.h -@@ -485,6 +485,7 @@ +@@ -501,6 +501,7 @@ V(maybe_cache_generated_source_map, v8::Function) \ V(messaging_deserialize_create_object, v8::Function) \ V(message_port, v8::Object) \ @@ -20,7 +20,7 @@ index ba8c80ff2842c63f16cae51cfa8084617bb35bf5..820aebd18d22bcef4992b09ffc8924e9 V(performance_entry_callback, v8::Function) \ V(prepare_stack_trace_callback, v8::Function) \ diff --git a/src/node_modules.cc b/src/node_modules.cc -index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4088e05ac 100644 +index c06779dea471b6f6a8dd29d4657162ef0faec043..6204986dc97686a248d6ae483f3a413ee5c51e47 100644 --- a/src/node_modules.cc +++ b/src/node_modules.cc @@ -21,6 +21,7 @@ namespace modules { @@ -31,7 +31,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4 using v8::FunctionCallbackInfo; using v8::HandleScope; using v8::Isolate; -@@ -88,6 +89,7 @@ Local BindingData::PackageConfig::Serialize(Realm* realm) const { +@@ -89,6 +90,7 @@ Local BindingData::PackageConfig::Serialize(Realm* realm) const { const BindingData::PackageConfig* BindingData::GetPackageJSON( Realm* realm, std::string_view path, ErrorContext* error_context) { @@ -39,7 +39,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4 auto binding_data = realm->GetBindingData(); auto cache_entry = binding_data->package_configs_.find(path.data()); -@@ -97,8 +99,36 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( +@@ -98,8 +100,36 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( PackageConfig package_config{}; package_config.file_path = path; @@ -77,7 +77,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4 return nullptr; } // In some systems, std::string is annotated to generate an -@@ -248,6 +278,12 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( +@@ -249,6 +279,12 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( return &cached.first->second; } @@ -90,7 +90,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4 void BindingData::ReadPackageJSON(const FunctionCallbackInfo& args) { CHECK_GE(args.Length(), 1); // path, [is_esm, base, specifier] CHECK(args[0]->IsString()); // path -@@ -556,6 +592,8 @@ void GetCompileCacheDir(const FunctionCallbackInfo& args) { +@@ -643,6 +679,8 @@ void InitImportMetaPathHelpers(const FunctionCallbackInfo& args) { void BindingData::CreatePerIsolateProperties(IsolateData* isolate_data, Local target) { Isolate* isolate = isolate_data->isolate(); @@ -99,7 +99,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4 SetMethod(isolate, target, "readPackageJSON", ReadPackageJSON); SetMethod(isolate, target, -@@ -595,6 +633,8 @@ void BindingData::CreatePerContextProperties(Local target, +@@ -685,6 +723,8 @@ void BindingData::CreatePerContextProperties(Local target, void BindingData::RegisterExternalReferences( ExternalReferenceRegistry* registry) { @@ -109,7 +109,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4 registry->Register(GetNearestParentPackageJSONType); registry->Register(GetNearestParentPackageJSON); diff --git a/src/node_modules.h b/src/node_modules.h -index 17909b2270454b3275c7bf2e50d4b9b35673ecc8..3d5b0e3ac65524adfe221bfd6f85360dee1f0bee 100644 +index eb2900d8f8385238f89a6dcc972a28e5fcb1d288..e28f38d98f4f8749048af135f0dcbe55aa69c4fe 100644 --- a/src/node_modules.h +++ b/src/node_modules.h @@ -54,6 +54,8 @@ class BindingData : public SnapshotableObject { diff --git a/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch b/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch index 3fbb7b9faf5c..dec3592cbdc6 100644 --- a/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch +++ b/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch @@ -64,7 +64,7 @@ index 5ba13096b98047ff33e4d44167c2a069ccc5e69d..09a332c0999086b30fd952d9456f7889 } } diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js -index ae03073aff8140b11c63b6c05d831ba573568dba..b70c7cfe40e2eaaeea7b5ad6fcf0aaee87276aa1 100644 +index aff686577df3c366f06f90666e23a03fc376cf53..e8857a151428acd6f8ece74d92774a18accc1e13 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -492,7 +492,7 @@ class ModuleLoader { diff --git a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch index 8548df12be7e..709e710e07aa 100644 --- a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch +++ b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch @@ -17,20 +17,10 @@ Upstreams: - https://github.com/nodejs/node/pull/39136 diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc -index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac4e767d90 100644 +index 6f9406eecacb7411a2e84a7b51e60b726d1961f3..bffdb0259eeed7389adb54a8ff13a1ac4e767d90 100644 --- a/deps/ncrypto/ncrypto.cc +++ b/deps/ncrypto/ncrypto.cc -@@ -11,9 +11,6 @@ - #if OPENSSL_VERSION_MAJOR >= 3 - #include - #endif --#ifdef OPENSSL_IS_BORINGSSL --#include "dh-primes.h" --#endif // OPENSSL_IS_BORINGSSL - - namespace ncrypto { - namespace { -@@ -789,7 +786,7 @@ bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) { +@@ -786,7 +786,7 @@ bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) { bool ok = true; @@ -39,7 +29,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac GENERAL_NAME* gen = sk_GENERAL_NAME_value(names, i); if (i != 0) BIO_write(out.get(), ", ", 2); -@@ -813,7 +810,7 @@ bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) { +@@ -810,7 +810,7 @@ bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) { bool ok = true; @@ -48,7 +38,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac ACCESS_DESCRIPTION* desc = sk_ACCESS_DESCRIPTION_value(descs, i); if (i != 0) BIO_write(out.get(), "\n", 1); -@@ -955,13 +952,17 @@ BIOPointer X509View::getValidTo() const { +@@ -952,13 +952,17 @@ BIOPointer X509View::getValidTo() const { int64_t X509View::getValidToTime() const { struct tm tp; @@ -67,7 +57,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac return PortableTimeGM(&tp); } -@@ -1236,7 +1237,11 @@ BIOPointer BIOPointer::NewMem() { +@@ -1233,7 +1237,11 @@ BIOPointer BIOPointer::NewMem() { } BIOPointer BIOPointer::NewSecMem() { @@ -80,7 +70,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac } BIOPointer BIOPointer::New(const BIO_METHOD* method) { -@@ -1306,8 +1311,10 @@ BignumPointer DHPointer::FindGroup(const std::string_view name, +@@ -1303,8 +1311,10 @@ BignumPointer DHPointer::FindGroup(const std::string_view name, #define V(n, p) \ if (EqualNoCase(name, n)) return BignumPointer(p(nullptr)); if (option != FindGroupOption::NO_SMALL_PRIMES) { @@ -91,7 +81,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac V("modp5", BN_get_rfc3526_prime_1536); } V("modp14", BN_get_rfc3526_prime_2048); -@@ -1383,11 +1390,13 @@ DHPointer::CheckPublicKeyResult DHPointer::checkPublicKey( +@@ -1380,11 +1390,13 @@ DHPointer::CheckPublicKeyResult DHPointer::checkPublicKey( int codes = 0; if (DH_check_pub_key(dh_.get(), pub_key.get(), &codes) != 1) return DHPointer::CheckPublicKeyResult::CHECK_FAILED; @@ -106,7 +96,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac return DHPointer::CheckPublicKeyResult::INVALID; } return CheckPublicKeyResult::NONE; -@@ -2330,7 +2339,7 @@ const std::string_view SSLPointer::getClientHelloAlpn() const { +@@ -2327,7 +2339,7 @@ const std::string_view SSLPointer::getClientHelloAlpn() const { const unsigned char* buf; size_t len; size_t rem; @@ -115,7 +105,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac if (!SSL_client_hello_get0_ext( get(), TLSEXT_TYPE_application_layer_protocol_negotiation, -@@ -2343,6 +2352,8 @@ const std::string_view SSLPointer::getClientHelloAlpn() const { +@@ -2340,6 +2352,8 @@ const std::string_view SSLPointer::getClientHelloAlpn() const { len = (buf[0] << 8) | buf[1]; if (len + 2 != rem) return {}; return reinterpret_cast(buf + 3); @@ -124,7 +114,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac } const std::string_view SSLPointer::getClientHelloServerName() const { -@@ -2350,7 +2361,7 @@ const std::string_view SSLPointer::getClientHelloServerName() const { +@@ -2347,7 +2361,7 @@ const std::string_view SSLPointer::getClientHelloServerName() const { const unsigned char* buf; size_t len; size_t rem; @@ -133,7 +123,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac if (!SSL_client_hello_get0_ext(get(), TLSEXT_TYPE_server_name, &buf, &rem) || rem <= 2) { return {}; -@@ -2366,6 +2377,8 @@ const std::string_view SSLPointer::getClientHelloServerName() const { +@@ -2363,6 +2377,8 @@ const std::string_view SSLPointer::getClientHelloServerName() const { len = (*(buf + 3) << 8) | *(buf + 4); if (len + 2 > rem) return {}; return reinterpret_cast(buf + 5); @@ -142,7 +132,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac } std::optional SSLPointer::GetServerName( -@@ -2399,8 +2412,11 @@ bool SSLPointer::isServer() const { +@@ -2396,8 +2412,11 @@ bool SSLPointer::isServer() const { EVPKeyPointer SSLPointer::getPeerTempKey() const { if (!ssl_) return {}; EVP_PKEY* raw_key = nullptr; @@ -195,10 +185,10 @@ index 245a43920c7baf000ba63192a84a4c3fd219be7d..56a554175b805c1703f13d62041f8c80 # The location of simdutf - use the one from node's deps by default. node_simdutf_path = "$node_path/deps/simdutf" diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc -index 1754d1f71b8adbcb584bfe4606e2a341836fb671..ac0f529e75c30add0708dc20470846f2f56e4b86 100644 +index 2176fb6982484e2c42538478eeb4dd81c9d50ee1..c00d3616e08b00b1e0a3a29b2dbb5278e1e14fcc 100644 --- a/src/crypto/crypto_cipher.cc +++ b/src/crypto/crypto_cipher.cc -@@ -1033,7 +1033,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { +@@ -1027,7 +1027,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { if (EVP_PKEY_decrypt_init(ctx.get()) <= 0) { return ThrowCryptoError(env, ERR_get_error()); } @@ -207,7 +197,7 @@ index 1754d1f71b8adbcb584bfe4606e2a341836fb671..ac0f529e75c30add0708dc20470846f2 int rsa_pkcs1_implicit_rejection = EVP_PKEY_CTX_ctrl_str(ctx.get(), "rsa_pkcs1_implicit_rejection", "1"); // From the doc -2 means that the option is not supported. -@@ -1048,6 +1048,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { +@@ -1042,6 +1042,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { env, "RSA_PKCS1_PADDING is no longer supported for private decryption"); } @@ -565,10 +555,10 @@ index 6f8cb433ff8059c63d5cf16c8783139ae92fbf61..603ac3dde7d1a1109afbc451b69c8d09 #if NODE_OPENSSL_HAS_QUIC #include diff --git a/src/node_options.cc b/src/node_options.cc -index 1444acd59d42f64831cead5f153419f7c12a88bf..23cb558a22b4462f5ce4f74833d25c7f712f8139 100644 +index 3fc8194475ec0e8a9047c1f3da5d120f25d66190..8be78889e8234eb3100f309829bf7470db544dcd 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -6,7 +6,7 @@ +@@ -7,7 +7,7 @@ #include "node_external_reference.h" #include "node_internals.h" #include "node_sea.h" @@ -578,7 +568,7 @@ index 1444acd59d42f64831cead5f153419f7c12a88bf..23cb558a22b4462f5ce4f74833d25c7f #endif diff --git a/src/node_options.h b/src/node_options.h -index e68a41b60832c4b000e17dd15ce16c1bdaf4b54b..065457acfde6ba4d04ed570cc72005cfd2798fd5 100644 +index 7d14f06370d936a3866f0d988123de9fe614ce09..60068b008b2e2a034c3f0c58b947a8d04d55e3b2 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -11,7 +11,7 @@ diff --git a/patches/node/fix_remove_fastapitypedarray_usage.patch b/patches/node/fix_remove_fastapitypedarray_usage.patch index 7ce2dea2c4fe..1d5b56cbe1fe 100644 --- a/patches/node/fix_remove_fastapitypedarray_usage.patch +++ b/patches/node/fix_remove_fastapitypedarray_usage.patch @@ -48,7 +48,7 @@ index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18 static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual)); diff --git a/src/node_buffer.cc b/src/node_buffer.cc -index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee4d8ef8f0 100644 +index 5bdffc0a4d7f8f643343593a543f2064b670c1b9..6931404b75dbe17bf3c7b561430b8d7c0921d085 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -44,6 +44,14 @@ @@ -74,7 +74,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee using v8::FunctionCallbackInfo; using v8::Global; using v8::HandleScope; -@@ -586,19 +593,24 @@ void SlowCopy(const FunctionCallbackInfo& args) { +@@ -584,19 +591,24 @@ void SlowCopy(const FunctionCallbackInfo& args) { // Assume caller has properly validated args. uint32_t FastCopy(Local receiver, @@ -107,7 +107,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee return to_copy; } -@@ -867,19 +879,17 @@ void Compare(const FunctionCallbackInfo &args) { +@@ -865,19 +877,17 @@ void Compare(const FunctionCallbackInfo &args) { } int32_t FastCompare(v8::Local, @@ -135,7 +135,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee } static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare)); -@@ -1150,14 +1160,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo& args) { +@@ -1148,14 +1158,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo& args) { } int32_t FastIndexOfNumber(v8::Local, @@ -153,7 +153,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee } static v8::CFunction fast_index_of_number( -@@ -1511,21 +1520,31 @@ void SlowWriteString(const FunctionCallbackInfo& args) { +@@ -1495,21 +1504,31 @@ void SlowWriteString(const FunctionCallbackInfo& args) { template uint32_t FastWriteString(Local receiver, @@ -192,7 +192,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee + std::min(dst_size - offset, max_length)); } - static v8::CFunction fast_write_string_ascii( + static const v8::CFunction fast_write_string_ascii( diff --git a/src/node_external_reference.h b/src/node_external_reference.h index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d46afdce75 100644 --- a/src/node_external_reference.h @@ -246,10 +246,10 @@ index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d4 // This class manages the external references from the V8 heap // to the C++ addresses in Node.js. diff --git a/src/util.h b/src/util.h -index 48d3c7b8a304049cdb4d4ab2c027b300dc533dc0..f9d5a5b36701b3c65fda65ed8920521ff68e32cd 100644 +index a77332f583402af956cc886fd5b9771390cc4827..f0d7571caa458a3f9a9c252a95f72eb5fbddd06d 100644 --- a/src/util.h +++ b/src/util.h -@@ -59,6 +59,7 @@ +@@ -60,6 +60,7 @@ namespace node { constexpr char kPathSeparator = std::filesystem::path::preferred_separator; @@ -257,7 +257,7 @@ index 48d3c7b8a304049cdb4d4ab2c027b300dc533dc0..f9d5a5b36701b3c65fda65ed8920521f #ifdef _WIN32 /* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */ -@@ -584,6 +585,16 @@ class BufferValue : public MaybeStackBuffer { +@@ -585,6 +586,16 @@ class BufferValue : public MaybeStackBuffer { static_cast(name->Buffer()->Data()) + name##_offset; \ if (name##_length > 0) CHECK_NE(name##_data, nullptr); diff --git a/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch b/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch index adb0fcc8506a..81346e984b9a 100644 --- a/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch +++ b/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch @@ -11,10 +11,10 @@ This patch can be removed when we upgrade to a V8 version that contains the above CL. diff --git a/src/node.cc b/src/node.cc -index a0f1deadfc58f18f23467889680219360386f9dd..8da5f5344051663f92d72848fbac9d041ac4fac3 100644 +index 0fbcd55d674b1d0cae88f04fe337cfcca702255f..092b1c525c7d4d50a09f99dc088d0698afcaf8a6 100644 --- a/src/node.cc +++ b/src/node.cc -@@ -808,7 +808,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector* args, +@@ -814,7 +814,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector* args, } // TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default // anymore. diff --git a/patches/node/pass_all_globals_through_require.patch b/patches/node/pass_all_globals_through_require.patch index 024cfdbfdddd..918c6d2aac4f 100644 --- a/patches/node/pass_all_globals_through_require.patch +++ b/patches/node/pass_all_globals_through_require.patch @@ -6,7 +6,7 @@ Subject: Pass all globals through "require" (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 33385fa792b71ea3802904dd3c59ce845342c595..92b368394e17a9257578cd5b7422391689732d6d 100644 +index ccd2b4ced3134d81ddd37b8b5b90218457633421..a19fc5e52109bf2ad63fbe554c02a458c3096081 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -200,6 +200,13 @@ const { diff --git a/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch b/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch index eb31ed5e0e4a..3936c9bc7017 100644 --- a/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch +++ b/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch @@ -161,10 +161,10 @@ index cfe917c797a6e4bb0f0284ec56be82637f840129..9f1c7ef45b6df10f811936a78ea6d9fc inline MultiIsolatePlatform* platform() const; inline const SnapshotData* snapshot_data() const; diff --git a/src/node.h b/src/node.h -index bdc77f8eb7abffa9e6c98cd254daedad3e44b981..98ad0ea649eaef43d1f5231f7bc4044e100e08d7 100644 +index 174fd4d1af4c8cd75aec09f4548a674fd5539fb2..42d55d24bd0770795ae0c0e19241d25a6350ae08 100644 --- a/src/node.h +++ b/src/node.h -@@ -1553,24 +1553,14 @@ void RegisterSignalHandler(int signal, +@@ -1560,24 +1560,14 @@ void RegisterSignalHandler(int signal, bool reset_handler = false); #endif // _WIN32 diff --git a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch index 250c9daa8f16..4a6e3d514777 100644 --- a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch +++ b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch @@ -26,7 +26,7 @@ index 3d8ccc77b5952a999c5fe48792259d32b402c460..867a1c4aca54b9d41490d23a5eb55088 } diff --git a/src/histogram.cc b/src/histogram.cc -index 0f0cde7be431dcb80c5314b1a9da49886c436d1c..f6d2bd439cad8b9f91c9d9a6cdb302e64130a5e2 100644 +index 5641990e0bac455c33ddf7b9a865deba871516e7..bd757f42e02391abbeec007d9c4cea60bcdfa6a4 100644 --- a/src/histogram.cc +++ b/src/histogram.cc @@ -195,7 +195,8 @@ void HistogramBase::FastRecord(Local unused, diff --git a/patches/node/support_v8_sandboxed_pointers.patch b/patches/node/support_v8_sandboxed_pointers.patch index 6a3edccfab57..2aedd3ceeae9 100644 --- a/patches/node/support_v8_sandboxed_pointers.patch +++ b/patches/node/support_v8_sandboxed_pointers.patch @@ -7,10 +7,10 @@ This refactors several allocators to allocate within the V8 memory cage, allowing them to be compatible with the V8_SANDBOXED_POINTERS feature. diff --git a/src/api/environment.cc b/src/api/environment.cc -index 88c2c932a6b045317c83c911b1cd8267b60d9334..7f4f233b26425493a58ce71dfc0c3a92b7c0bef8 100644 +index df5fb942aa893c22d14d7eb21a5211a46a472a5f..5b7f6e0609c8414c686d2d5ca603ea5c8bc484d0 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -102,6 +102,14 @@ MaybeLocal PrepareStackTraceCallback(Local context, +@@ -103,6 +103,14 @@ MaybeLocal PrepareStackTraceCallback(Local context, return result; } @@ -156,7 +156,7 @@ index 1592134716da2de40de4ba028ee937b765423e37..8f3ba65f1fef2c066d6df6087a08ba71 v8::Local ToArrayBuffer(Environment* env); diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc -index 3465454e4de4a78912b81e7eca0de395fbe89911..c8ae863460107c69dd77d67c76c11843114e99c4 100644 +index f616223cfb0f6e10f7cf57ada9704316bde2797e..eb6dad44a49d997097c8fb5009eeb60a7305da27 100644 --- a/src/crypto/crypto_x509.cc +++ b/src/crypto/crypto_x509.cc @@ -167,6 +167,19 @@ MaybeLocal ToV8Value(Local context, const BIOPointer& bio) { @@ -229,10 +229,10 @@ index ea7810e41e2667713a896250dc1b904b0a7cf198..865b3128c1edfe7074769f25a0b87878 constexpr const char* EncodingName(const enum encoding encoding) { diff --git a/src/node_internals.h b/src/node_internals.h -index 382df89a2312f76b5293412a8d51969ae5d9fa9c..1c90da9bbcb9547ab36de4d01088c03f3350b787 100644 +index 275534285ec28f02b46639142ab4195b24267476..5f9d123f9d4b9feb7bc0b627b1e6309fdbd6e30d 100644 --- a/src/node_internals.h +++ b/src/node_internals.h -@@ -117,7 +117,9 @@ v8::Maybe InitializePrimordials(v8::Local context); +@@ -120,7 +120,9 @@ v8::MaybeLocal InitializePrivateSymbols( class NodeArrayBufferAllocator : public ArrayBufferAllocator { public: @@ -243,7 +243,7 @@ index 382df89a2312f76b5293412a8d51969ae5d9fa9c..1c90da9bbcb9547ab36de4d01088c03f void* Allocate(size_t size) override; // Defined in src/node.cc void* AllocateUninitialized(size_t size) override; -@@ -135,7 +137,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator { +@@ -138,7 +140,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator { } private: diff --git a/patches/node/zlib_fix_pointer_alignment.patch b/patches/node/zlib_fix_pointer_alignment.patch deleted file mode 100644 index 418e74d53ccd..000000000000 --- a/patches/node/zlib_fix_pointer_alignment.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jeroen Hofstee -Date: Tue, 1 Apr 2025 20:09:31 +0000 -Subject: zlib: fix pointer alignment - -The function AllocForBrotli prefixes the allocated memory with its -size, and returns a pointer to the region after it. This pointer can -however no longer be suitably aligned. Correct this by allocating -the maximum of the the size of the size_t and the max alignment. - -On Arm 32bits the size_t is 4 bytes long, but the alignment is 8 for -some NEON instructions. When Brotli is compiled with optimizations -enabled newer GCC versions will use the NEON instructions and trigger -a bus error killing node. - -see https://github.com/google/brotli/issues/1159 - -diff --git a/src/node_zlib.cc b/src/node_zlib.cc -index 0b7c47b326c7c5480086228b3d40d54c260ef16a..7e6b38ecd1aa360012c0d73e94412530a48cb8c3 100644 ---- a/src/node_zlib.cc -+++ b/src/node_zlib.cc -@@ -608,7 +608,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { - } - - static void* AllocForBrotli(void* data, size_t size) { -- size += sizeof(size_t); -+ constexpr size_t offset = std::max(sizeof(size_t), alignof(max_align_t)); -+ size += offset; - CompressionStream* ctx = static_cast(data); - char* memory = UncheckedMalloc(size); - if (memory == nullptr) [[unlikely]] { -@@ -617,7 +618,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { - *reinterpret_cast(memory) = size; - ctx->unreported_allocations_.fetch_add(size, - std::memory_order_relaxed); -- return memory + sizeof(size_t); -+ return memory + offset; - } - - static void FreeForZlib(void* data, void* pointer) { -@@ -625,7 +626,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { - return; - } - CompressionStream* ctx = static_cast(data); -- char* real_pointer = static_cast(pointer) - sizeof(size_t); -+ constexpr size_t offset = std::max(sizeof(size_t), alignof(max_align_t)); -+ char* real_pointer = static_cast(pointer) - offset; - size_t real_size = *reinterpret_cast(real_pointer); - ctx->unreported_allocations_.fetch_sub(real_size, - std::memory_order_relaxed); diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 28cb81b46db8..883a6f7f017d 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -2,12 +2,14 @@ "abort/test-abort-backtrace", "es-module/test-vm-compile-function-lineoffset", "es-module/test-cjs-legacyMainResolve-permission.js", + "parallel/test-assert-typedarray-deepequal", "parallel/test-async-context-frame", "parallel/test-bootstrap-modules", "parallel/test-child-process-fork-exec-path", "parallel/test-code-cache", "parallel/test-cluster-primary-error", "parallel/test-cluster-primary-kill", + "parallel/test-config-file", "parallel/test-crypto-aes-wrap", "parallel/test-crypto-authenticated", "parallel/test-crypto-authenticated-stream", @@ -75,6 +77,7 @@ "parallel/test-snapshot-weak-reference", "parallel/test-snapshot-worker", "parallel/test-strace-openat-openssl", + "parallel/test-sqlite-backup", "parallel/test-tls-alpn-server-client", "parallel/test-tls-cli-min-version-1.0", "parallel/test-tls-cli-max-version-1.2", diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 9ad2274e6a2c..11b34075e753 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -993,11 +993,10 @@ void OnNodePreload(node::Environment* env, } // Execute lib/node/init.ts. - std::vector> bundle_params = { - node::FIXED_ONE_BYTE_STRING(env->isolate(), "process"), - node::FIXED_ONE_BYTE_STRING(env->isolate(), "require"), - }; - std::vector> bundle_args = {process, require}; + v8::LocalVector bundle_params( + env->isolate(), {node::FIXED_ONE_BYTE_STRING(env->isolate(), "process"), + node::FIXED_ONE_BYTE_STRING(env->isolate(), "require")}); + v8::LocalVector bundle_args(env->isolate(), {process, require}); electron::util::CompileAndCall(env->context(), "electron/js2c/node_init", &bundle_params, &bundle_args); } diff --git a/shell/common/node_util.cc b/shell/common/node_util.cc index 6d18f077b61d..62630e7af7a3 100644 --- a/shell/common/node_util.cc +++ b/shell/common/node_util.cc @@ -22,8 +22,8 @@ namespace electron::util { v8::MaybeLocal CompileAndCall( v8::Local context, const char* id, - std::vector>* parameters, - std::vector>* arguments) { + v8::LocalVector* parameters, + v8::LocalVector* arguments) { v8::Isolate* isolate = context->GetIsolate(); v8::TryCatch try_catch(isolate); diff --git a/shell/common/node_util.h b/shell/common/node_util.h index c379d70e8ab9..a00ca4ae60cf 100644 --- a/shell/common/node_util.h +++ b/shell/common/node_util.h @@ -41,8 +41,8 @@ void EmitWarning(std::string_view warning_msg, std::string_view warning_type); v8::MaybeLocal CompileAndCall( v8::Local context, const char* id, - std::vector>* parameters, - std::vector>* arguments); + v8::LocalVector* parameters, + v8::LocalVector* arguments); // Wrapper for node::CreateEnvironment that logs failure node::Environment* CreateEnvironment(v8::Isolate* isolate, diff --git a/shell/renderer/electron_sandboxed_renderer_client.cc b/shell/renderer/electron_sandboxed_renderer_client.cc index 2c985c9a59c0..4fb71d38da85 100644 --- a/shell/renderer/electron_sandboxed_renderer_client.cc +++ b/shell/renderer/electron_sandboxed_renderer_client.cc @@ -125,10 +125,10 @@ void ElectronSandboxedRendererClient::DidCreateScriptContext( auto binding = v8::Object::New(isolate); InitializeBindings(binding, context, render_frame); - std::vector> sandbox_preload_bundle_params = { - node::FIXED_ONE_BYTE_STRING(isolate, "binding")}; + v8::LocalVector sandbox_preload_bundle_params( + isolate, {node::FIXED_ONE_BYTE_STRING(isolate, "binding")}); - std::vector> sandbox_preload_bundle_args = {binding}; + v8::LocalVector sandbox_preload_bundle_args(isolate, {binding}); util::CompileAndCall( isolate->GetCurrentContext(), "electron/js2c/sandbox_bundle", diff --git a/shell/renderer/preload_realm_context.cc b/shell/renderer/preload_realm_context.cc index 5f104fe26bcf..a8e47b2d0ab6 100644 --- a/shell/renderer/preload_realm_context.cc +++ b/shell/renderer/preload_realm_context.cc @@ -176,10 +176,10 @@ class PreloadRealmLifetimeController process.SetReadOnly("type", "service-worker"); process.SetReadOnly("contextIsolated", true); - std::vector> preload_realm_bundle_params = { - node::FIXED_ONE_BYTE_STRING(isolate, "binding")}; + v8::LocalVector preload_realm_bundle_params( + isolate, {node::FIXED_ONE_BYTE_STRING(isolate, "binding")}); - std::vector> preload_realm_bundle_args = {binding}; + v8::LocalVector preload_realm_bundle_args(isolate, {binding}); util::CompileAndCall(context, "electron/js2c/preload_realm_bundle", &preload_realm_bundle_params, diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index e1aeaae304a5..5eb0fe04fc6e 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -597,11 +597,11 @@ void RendererClientBase::SetupMainWorldOverrides( } } - std::vector> isolated_bundle_params = { - node::FIXED_ONE_BYTE_STRING(isolate, "isolatedApi")}; + v8::LocalVector isolated_bundle_params( + isolate, {node::FIXED_ONE_BYTE_STRING(isolate, "isolatedApi")}); - std::vector> isolated_bundle_args = { - isolated_api.GetHandle()}; + v8::LocalVector isolated_bundle_args(isolate, + {isolated_api.GetHandle()}); util::CompileAndCall(context, "electron/js2c/isolated_bundle", &isolated_bundle_params, &isolated_bundle_args);