From 1766511e3462274efb93858ab4c083a3d212482e Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 16:13:43 -0400 Subject: [PATCH] chore: bump node to v18.18.0 (main) (#39915) * chore: bump node in DEPS to v18.18.0 * child_process: harden against prototype pollution https://github.com/nodejs/node/pull/48726 * deps: upgrade to libuv 1.46.0 https://github.com/nodejs/node/pull/49591 * module: reduce url invocations in esm/load.js https://github.com/nodejs/node/pull/48337 * Revert "test: remove test-crypto-keygen flaky designation" https://github.com/nodejs/node/pull/48652 * fix: FTBTFS in ada dep https://github.com/ada-url/ada/pull/464 https://github.com/ada-url/idna/pull/31 * fix: force_colors snapshot line number * chore: fixup patch indices * chore: update filenames.json --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- DEPS | 2 +- patches/node/.patches | 1 - patches/node/build_add_gn_build_files.patch | 21 +++---- ...compilation_fails_if_not_using_a_new.patch | 2 +- ...pression_sandbox_is_enabled_on_64bit.patch | 2 +- ...f_original-fs_and_custom_embedder_js.patch | 2 +- ...de_entrypoint_to_be_a_builtin_module.patch | 4 +- ...e_expose_importmoduledynamically_and.patch | 6 +- ...ixtures_errors_force_colors_snapshot.patch | 12 ++-- ...enable_crashpad_linux_node_processes.patch | 6 +- ...nalhandler_to_environment_to_prevent.patch | 2 +- ...o_change_option_to_uv_loop_configure.patch | 58 +++++++++---------- .../node/feat_initialize_asar_support.patch | 6 +- patches/node/fix_-wshadow_warning.patch | 2 +- ..._values_for_variables_in_common_gypi.patch | 2 +- ...ssert_module_in_the_renderer_process.patch | 4 +- ..._do_not_resolve_electron_entrypoints.patch | 2 +- ...ose_lookupandcompile_with_parameters.patch | 2 +- ...n_electron_module_via_the_esm_loader.patch | 16 ++--- ...ftbfs_werror_wunreachable-code-break.patch | 30 ---------- ...ingssl_and_openssl_incompatibilities.patch | 10 ++-- patches/node/fix_isurl_implementation.patch | 6 +- ...in_esm_loaders_to_apply_asar_patches.patch | 22 +++---- ...g_-wdeprecated-declarations_in_libuv.patch | 4 +- ...cess_fork_to_use_execute_script_with.patch | 12 ++-- .../node/support_v8_sandboxed_pointers.patch | 2 +- ...st_formally_mark_some_tests_as_flaky.patch | 6 +- 27 files changed, 102 insertions(+), 142 deletions(-) delete mode 100644 patches/node/fix_ftbfs_werror_wunreachable-code-break.patch diff --git a/DEPS b/DEPS index d7ad4b901dc8..ad6b746ce85f 100644 --- a/DEPS +++ b/DEPS @@ -4,7 +4,7 @@ vars = { 'chromium_version': '119.0.6019.2', 'node_version': - 'v18.17.1', + 'v18.18.0', 'nan_version': 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': diff --git a/patches/node/.patches b/patches/node/.patches index 64e34653c5c5..774b79f5303f 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -37,7 +37,6 @@ fix_account_for_createexternalizablestring_v8_global.patch fix_wunreachable-code_warning_in_ares_init_rand_engine.patch fix_-wshadow_warning.patch fix_do_not_resolve_electron_entrypoints.patch -fix_ftbfs_werror_wunreachable-code-break.patch fix_ftbfs_werror_wextra-semi.patch fix_isurl_implementation.patch ci_ensure_node_tests_set_electron_run_as_node.patch diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 90d428a52602..f6e80f00a116 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -929,10 +929,10 @@ index 0000000000000000000000000000000000000000..bfbd4e656db1a6c73048443f96f1d576 +} diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn new file mode 100644 -index 0000000000000000000000000000000000000000..e90becfab51beb090394db9d3c94d73e546b39ef +index 0000000000000000000000000000000000000000..ae4d3bf68882f1aa6d7440448050fbdd9a17dca7 --- /dev/null +++ b/deps/uv/BUILD.gn -@@ -0,0 +1,198 @@ +@@ -0,0 +1,194 @@ +config("libuv_config") { + include_dirs = [ "include" ] + @@ -978,6 +978,7 @@ index 0000000000000000000000000000000000000000..e90becfab51beb090394db9d3c94d73e + "-Wno-string-conversion", + "-Wno-switch", + "-Wno-unused-function", ++ "-Wno-unused-result", + "-Wno-unused-variable", + "-Wno-unreachable-code", + "-Wno-unreachable-code-return", @@ -1004,6 +1005,7 @@ index 0000000000000000000000000000000000000000..e90becfab51beb090394db9d3c94d73e + "src/strscpy.h", + "src/strtok.c", + "src/strtok.h", ++ "src/thread-common.c", + "src/threadpool.c", + "src/timer.c", + "src/uv-common.c", @@ -1067,7 +1069,6 @@ index 0000000000000000000000000000000000000000..e90becfab51beb090394db9d3c94d73e + "include/uv/sunos.h", + "include/uv/unix.h", + "src/unix/async.c", -+ "src/unix/atomic-ops.h", + "src/unix/core.c", + "src/unix/dl.c", + "src/unix/fs.c", @@ -1079,7 +1080,6 @@ index 0000000000000000000000000000000000000000..e90becfab51beb090394db9d3c94d73e + "src/unix/pipe.c", + "src/unix/poll.c", + "src/unix/process.c", -+ "src/unix/pthread-fixes.c", + "src/unix/random-devurandom.c", + "src/unix/signal.c", + "src/unix/spinlock.h", @@ -1110,11 +1110,7 @@ index 0000000000000000000000000000000000000000..e90becfab51beb090394db9d3c94d73e + if (is_linux) { + defines += [ "_GNU_SOURCE" ] + sources += [ -+ "src/unix/epoll.c", -+ "src/unix/linux-core.c", -+ "src/unix/linux-inotify.c", -+ "src/unix/linux-syscalls.c", -+ "src/unix/linux-syscalls.h", ++ "src/unix/linux.c", + "src/unix/procfs-exepath.c", + "src/unix/random-getrandom.c", + "src/unix/random-sysctl-linux.c", @@ -1177,10 +1173,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636 +} diff --git a/filenames.json b/filenames.json new file mode 100644 -index 0000000000000000000000000000000000000000..7d86765bf229275ba55d37a452ef24832a7afadb +index 0000000000000000000000000000000000000000..12d4706fae0d8253db8de1fc2c4e31a6380cc122 --- /dev/null +++ b/filenames.json -@@ -0,0 +1,664 @@ +@@ -0,0 +1,663 @@ +// This file is automatically generated by generate_gn_filenames_json.py +// DO NOT EDIT +{ @@ -1294,7 +1290,6 @@ index 0000000000000000000000000000000000000000..7d86765bf229275ba55d37a452ef2483 + "deps/uv/include/uv/linux.h", + "deps/uv/include/uv/os390.h", + "deps/uv/include/uv/posix.h", -+ "deps/uv/include/uv/stdint-msvc2008.h", + "deps/uv/include/uv/sunos.h", + "deps/uv/include/uv/threadpool.h", + "deps/uv/include/uv/tree.h", @@ -2105,7 +2100,7 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b + args = rebase_path(inputs + outputs, root_build_dir) +} diff --git a/src/node_version.h b/src/node_version.h -index 1e898ffcc9104bc50079a9850dc89767199c646e..0f5c5f1cc0845b5d005697d8ab1ab6167c541ced 100644 +index 7e90c796f3bd076048a2114a1ba31db7ee876440..60a17104e0b1b19038efc1a1468ee92642d3ffd6 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -89,7 +89,10 @@ 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 10d601584777..53045a76204a 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 f3e0047fea1319034bf8b05b8d54d8a4ef181b4b..be0289ea7df50d7c2cb002c6343b75014729c923 100644 +index 62cb46b328871d929f16ced2a4741bc6e6b004db..53ab7c255317d2280e2579435bc7097705f19c6e 100644 --- a/common.gypi +++ b/common.gypi @@ -79,6 +79,8 @@ diff --git a/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch b/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch index 45c61827c4ff..41b4f2491849 100644 --- a/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch +++ b/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch @@ -8,7 +8,7 @@ Aligns common.gypi with the current build flag state of //v8. Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`. diff --git a/common.gypi b/common.gypi -index 543ede0020fd79251bdd9eac897d9a0e330ef239..f3e0047fea1319034bf8b05b8d54d8a4ef181b4b 100644 +index 10d11f1e9aacfbe4bb53e1220afab1e68db98313..62cb46b328871d929f16ced2a4741bc6e6b004db 100644 --- a/common.gypi +++ b/common.gypi @@ -65,6 +65,7 @@ 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 86000f4dbc2e..6ee489c55ff8 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 @@ -37,7 +37,7 @@ index ce885c154c81c5703365fa34957697698da9aff6..229b0d522aeee3632145c86715bea139 async function* watch(filename, options = kEmptyObject) { const path = toNamespacedPath(getValidatedPath(filename)); diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 2220869fa76f35fdfba72eba993b20748b07c546..522670ed5c9951c506dcdf2745585552ad2a081f 100644 +index 356ec3acd0bf3ac1e7518b32a5a58b042a03f598..4d4b59916bfdb203702c4e878ff2659b79de8c52 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_; 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 55d58d9b82ae..bae1478ffc42 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 @@ -26,10 +26,10 @@ index 001343b74ce236f89dca030c0fc9dd0299df0b39..6f277daf4ce846f093f634c473daec07 try { resolvedArgv = Module._resolveFilename(process.argv[1], null, false); diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index 4e7a9e7a7585fea2013ff70161672568477172b1..f96d19969aa59a9964d947a9fd6295cf25ad3b03 100644 +index fcbd9ee1af002bc176937e6bb5af55791b2f64b2..cbfb6e3620a7e77658c86a4730c50661b8a937f7 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -151,11 +151,13 @@ function patchProcessObject(expandArgv1) { +@@ -164,11 +164,13 @@ function patchProcessObject(expandArgv1) { if (expandArgv1 && process.argv[1] && !StringPrototypeStartsWith(process.argv[1], '-')) { // Expand process.argv[1] into a full path. diff --git a/patches/node/chore_expose_importmoduledynamically_and.patch b/patches/node/chore_expose_importmoduledynamically_and.patch index 94007caafda5..5897e0df08a1 100644 --- a/patches/node/chore_expose_importmoduledynamically_and.patch +++ b/patches/node/chore_expose_importmoduledynamically_and.patch @@ -11,10 +11,10 @@ its own blended handler between Node and Blink. Not upstreamable. diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index f96d19969aa59a9964d947a9fd6295cf25ad3b03..15116b78f82c977bba67ce98ce57232500dfaef8 100644 +index cbfb6e3620a7e77658c86a4730c50661b8a937f7..ccd48027e3dfebd563fcbe83239174c79c693dd7 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -554,7 +554,7 @@ function initializeESMLoader() { +@@ -567,7 +567,7 @@ function initializeESMLoader() { // Create this WeakMap in js-land because V8 has no C++ API for WeakMap. internalBinding('module_wrap').callbackMap = new SafeWeakMap(); @@ -23,7 +23,7 @@ index f96d19969aa59a9964d947a9fd6295cf25ad3b03..15116b78f82c977bba67ce98ce572325 const { setImportModuleDynamicallyCallback, -@@ -563,8 +563,8 @@ function initializeESMLoader() { +@@ -576,8 +576,8 @@ function initializeESMLoader() { const esm = require('internal/process/esm_loader'); // Setup per-isolate callbacks that locate data or callbacks that we keep // track of for different ESM modules. diff --git a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch index 50787e3cebfa..08f301ecbd92 100644 --- a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch +++ b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch @@ -11,7 +11,7 @@ trying to see whether or not the lines are greyed out. One possibility would be to upstream a changed test that doesn't hardcode line numbers. diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot -index 0334a0b4faa3633aa8617b9538873e7f3540513b..8c047001ede7b66cab5146444fe2b48190b64359 100644 +index 4c33acbc2d5c12ac8750b72e0796284176af3da2..5ba11dadad6d905a1eb67ed1c89c59f3c3f686ec 100644 --- a/test/fixtures/errors/force_colors.snapshot +++ b/test/fixtures/errors/force_colors.snapshot @@ -4,11 +4,12 @@ throw new Error('Should include grayed stack trace') @@ -22,13 +22,13 @@ index 0334a0b4faa3633aa8617b9538873e7f3540513b..8c047001ede7b66cab5146444fe2b481 - at Module._extensions..js (node:internal*modules*cjs*loader:1310:10) - at Module.load (node:internal*modules*cjs*loader:1119:32) - at Module._load (node:internal*modules*cjs*loader:960:12) -- at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:81:12) +- at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:86:12) + at Module._compile (node:internal*modules*cjs*loader:1271:14) -+ at Object..js (node:internal*modules*cjs*loader:1326:10) ++ at Module._extensions..js (node:internal*modules*cjs*loader:1326:10) + at Module.load (node:internal*modules*cjs*loader:1126:32) -+ at node:internal*modules*cjs*loader:967:12 -+ at Function._load (node:electron*js2c*asar_bundle:777:32) -+ at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:96:12) ++ at Module._load (node:internal*modules*cjs*loader:967:12) ++ at Module._load (node:electron*js2c*asar_bundle:777:32) ++ at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:101:12)  at node:internal*main*run_main_module:23:47 Node.js * diff --git a/patches/node/enable_crashpad_linux_node_processes.patch b/patches/node/enable_crashpad_linux_node_processes.patch index cd16b942d540..9508ec2670f4 100644 --- a/patches/node/enable_crashpad_linux_node_processes.patch +++ b/patches/node/enable_crashpad_linux_node_processes.patch @@ -8,10 +8,10 @@ to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used by the crashpad client to connect with the handler process. diff --git a/lib/child_process.js b/lib/child_process.js -index da553f6556a06d57d7490d74a3b4dd8f0132600c..168a6c72520d6540f0dbf84a62bc5e2b2f3ae022 100644 +index ec39a00ddb791e6e1ebe31aa45d290e7dcc4ebfc..1cd5d8969471b276211c45a9d8d76e9b10b1bb66 100644 --- a/lib/child_process.js +++ b/lib/child_process.js -@@ -60,6 +60,7 @@ let debug = require('internal/util/debuglog').debuglog( +@@ -61,6 +61,7 @@ let debug = require('internal/util/debuglog').debuglog( ); const { Buffer } = require('buffer'); const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); @@ -19,7 +19,7 @@ index da553f6556a06d57d7490d74a3b4dd8f0132600c..168a6c72520d6540f0dbf84a62bc5e2b const { AbortError, -@@ -163,7 +164,6 @@ function fork(modulePath, args = [], options) { +@@ -162,7 +163,6 @@ function fork(modulePath, args = [], options) { ArrayPrototypeSplice(execArgv, index - 1, 2); } } diff --git a/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch b/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch index b9d61dee9075..c31372a803b5 100644 --- a/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch +++ b/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch @@ -22,7 +22,7 @@ index 7ceab0da0c632f857f6e2d0fbf479bbc4f55df07..debd982c75805c51ea7d01229b9d6355 // configure --no-browser-globals #ifdef NODE_NO_BROWSER_GLOBALS diff --git a/src/env.h b/src/env.h -index b0f10cfca00f380728903d5e0ea24cf3156ead0f..c914b621f50bcd6bce2617fef9e48737235aa516 100644 +index b67a476701f9bd8abdfc0ef9cfe800e84fb8f8c2..45a9a7811b4abe1effb6acf2c89a772a7c2256c9 100644 --- a/src/env.h +++ b/src/env.h @@ -748,6 +748,7 @@ class Environment : public MemoryRetainer { diff --git a/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch b/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch index 4e4138a150fa..e69a544c8850 100644 --- a/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch +++ b/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch @@ -26,10 +26,10 @@ index 0f5ddfb3ca21b7e5b38d0a4ce4b9e77387597199..ba815202fb157aa82859ec0518523cf6 .. c:function:: int uv_loop_close(uv_loop_t* loop) diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h -index ee1c94ccd389915ea7572cce044256a7788025ad..d31abf714d5d1433ec8473ccb1aae3b6615c477a 100644 +index 02397dd0fdd43d51f86c0dde9a62046702f12bdb..3375600023e39ddacf62cc17deb4f206db942084 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h -@@ -252,7 +252,8 @@ typedef struct uv_statfs_s uv_statfs_t; +@@ -260,7 +260,8 @@ typedef struct uv_metrics_s uv_metrics_t; typedef enum { UV_LOOP_BLOCK_SIGNAL = 0, @@ -40,7 +40,7 @@ index ee1c94ccd389915ea7572cce044256a7788025ad..d31abf714d5d1433ec8473ccb1aae3b6 typedef enum { diff --git a/deps/uv/src/unix/async.c b/deps/uv/src/unix/async.c -index e1805c323795e5b0c465d80100eebeb7bf838caa..dd4358c0cdaa97ba8fadf4d9755993803beddd18 100644 +index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..679b17bda476d2a9c072ce8261234f837b56422f 100644 --- a/deps/uv/src/unix/async.c +++ b/deps/uv/src/unix/async.c @@ -38,7 +38,6 @@ @@ -49,18 +49,18 @@ index e1805c323795e5b0c465d80100eebeb7bf838caa..dd4358c0cdaa97ba8fadf4d975599380 -static void uv__async_send(uv_loop_t* loop); static int uv__async_start(uv_loop_t* loop); + static void uv__cpu_relax(void); - -@@ -70,7 +69,7 @@ int uv_async_send(uv_async_t* handle) { - return 0; +@@ -78,7 +77,7 @@ int uv_async_send(uv_async_t* handle) { /* Wake up the other thread's event loop. */ -- uv__async_send(handle->loop); -+ uv__loop_interrupt(handle->loop); + if (atomic_exchange(pending, 1) == 0) +- uv__async_send(handle->loop); ++ uv__loop_interrupt(handle->loop); - /* Tell the other thread we're done. */ - if (cmpxchgi(&handle->pending, 1, 2) != 1) -@@ -165,40 +164,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) { + /* Set the loop to not-busy. */ + atomic_fetch_add(busy, -1); +@@ -178,40 +177,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) { } @@ -102,10 +102,10 @@ index e1805c323795e5b0c465d80100eebeb7bf838caa..dd4358c0cdaa97ba8fadf4d975599380 int pipefd[2]; int err; diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c -index 54c769f37f2331136c87a37c13fb4e3f9a8f22f9..ac52ab79a5fc3050effd2b1f2f605cee9b1ab336 100644 +index 25c5181f370e94983e8a5f797f02f7a8dc207e00..f4d9059796d2c65339a5d48ecb273b09d9364d21 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c -@@ -900,6 +900,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { +@@ -926,6 +926,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { loop->watchers[w->fd] = w; loop->nfds++; } @@ -115,20 +115,20 @@ index 54c769f37f2331136c87a37c13fb4e3f9a8f22f9..ac52ab79a5fc3050effd2b1f2f605cee } -@@ -931,6 +934,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { +@@ -957,6 +960,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { } - else if (QUEUE_EMPTY(&w->watcher_queue)) - QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue); + else if (uv__queue_empty(&w->watcher_queue)) + uv__queue_insert_tail(&loop->watcher_queue, &w->watcher_queue); + + if (uv__get_internal_fields(loop)->flags & UV_LOOP_INTERRUPT_ON_IO_CHANGE) + uv__loop_interrupt(loop); } -@@ -947,6 +953,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { +@@ -973,6 +979,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { void uv__io_feed(uv_loop_t* loop, uv__io_t* w) { - if (QUEUE_EMPTY(&w->pending_queue)) - QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue); + if (uv__queue_empty(&w->pending_queue)) + uv__queue_insert_tail(&loop->pending_queue, &w->pending_queue); + + if (uv__get_internal_fields(loop)->flags & UV_LOOP_INTERRUPT_ON_IO_CHANGE) + uv__loop_interrupt(loop); @@ -136,7 +136,7 @@ index 54c769f37f2331136c87a37c13fb4e3f9a8f22f9..ac52ab79a5fc3050effd2b1f2f605cee diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c -index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..46fc03264b6cc1a3a4d8faf5ec5a754fc07c9b6d 100644 +index a9468e8e19cbede795032980c47eb83aee1e0c68..2d28cf48efc3718de19b901b7e08b8a857d20740 100644 --- a/deps/uv/src/unix/loop.c +++ b/deps/uv/src/unix/loop.c @@ -217,6 +217,11 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { @@ -193,10 +193,10 @@ index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..46fc03264b6cc1a3a4d8faf5ec5a754f + abort(); +} diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h -index 6001b0cf68d0b0268b578218b664a737f43c9521..5d2212571f4bcb648ab332f0c5650d0fdb37c03a 100644 +index cd57e5a35153d0557351b60cce0c5be7a4468b60..660caef30b1637b8009de5e55ee34f48d17e4dd0 100644 --- a/deps/uv/src/uv-common.h +++ b/deps/uv/src/uv-common.h -@@ -140,6 +140,8 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap); +@@ -144,6 +144,8 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap); void uv__loop_close(uv_loop_t* loop); @@ -205,7 +205,7 @@ index 6001b0cf68d0b0268b578218b664a737f43c9521..5d2212571f4bcb648ab332f0c5650d0f int uv__read_start(uv_stream_t* stream, uv_alloc_cb alloc_cb, uv_read_cb read_cb); -@@ -268,6 +270,10 @@ void uv__threadpool_cleanup(void); +@@ -280,6 +282,10 @@ void uv__threadpool_cleanup(void); if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \ (h)->flags |= UV_HANDLE_ACTIVE; \ if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \ @@ -217,7 +217,7 @@ index 6001b0cf68d0b0268b578218b664a737f43c9521..5d2212571f4bcb648ab332f0c5650d0f while (0) diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c -index 67af93e6571ed4324d80b6dfb2ff93db7b9cd9b1..e88008b6a288d1508c5c117d814000d63cab81c3 100644 +index e9885a0f1ff3890a8d957c8793e22b01cedc0e97..ae3d09878253fe7169ad7b74b3faea0223f89de5 100644 --- a/deps/uv/src/win/core.c +++ b/deps/uv/src/win/core.c @@ -384,10 +384,20 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { @@ -242,7 +242,7 @@ index 67af93e6571ed4324d80b6dfb2ff93db7b9cd9b1..e88008b6a288d1508c5c117d814000d6 return -1; } diff --git a/deps/uv/test/test-embed.c b/deps/uv/test/test-embed.c -index 1d3355fdc67310feb63738c9e30724f0e77f7895..77a63dbb4d188b2ad571c814dbc6cbc6fe5fa205 100644 +index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf893ab93d2 100644 --- a/deps/uv/test/test-embed.c +++ b/deps/uv/test/test-embed.c @@ -25,54 +25,184 @@ @@ -463,13 +463,13 @@ index 1d3355fdc67310feb63738c9e30724f0e77f7895..77a63dbb4d188b2ad571c814dbc6cbc6 + run_loop(); + ASSERT_EQ(main_timer_called, 1); - MAKE_VALGRIND_HAPPY(); + MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h -index b19c10c7e40c77061337416fd623c53d0863d276..1f54ac21c36902bccb35c64cefa8bb14dd675bb0 100644 +index 78ff9c2d1621676feab5d357609970cdf1ba5864..204160f324ad1a80c9b042e62c4bedcb745666ba 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h -@@ -265,6 +265,7 @@ TEST_DECLARE (process_priority) +@@ -273,6 +273,7 @@ TEST_DECLARE (process_priority) TEST_DECLARE (has_ref) TEST_DECLARE (active) TEST_DECLARE (embed) @@ -477,7 +477,7 @@ index b19c10c7e40c77061337416fd623c53d0863d276..1f54ac21c36902bccb35c64cefa8bb14 TEST_DECLARE (async) TEST_DECLARE (async_null_cb) TEST_DECLARE (eintr_handling) -@@ -867,6 +868,7 @@ TASK_LIST_START +@@ -894,6 +895,7 @@ TASK_LIST_START TEST_ENTRY (active) TEST_ENTRY (embed) diff --git a/patches/node/feat_initialize_asar_support.patch b/patches/node/feat_initialize_asar_support.patch index 6303ab63a4e0..f56213c5a501 100644 --- a/patches/node/feat_initialize_asar_support.patch +++ b/patches/node/feat_initialize_asar_support.patch @@ -6,10 +6,10 @@ Subject: feat: initialize asar support This patch initializes asar support in Node.js. diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..4e7a9e7a7585fea2013ff70161672568477172b1 100644 +index b4a24bbffb6c43638d13063e85b6cfba5c0cc9c7..fcbd9ee1af002bc176937e6bb5af55791b2f64b2 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -49,6 +49,8 @@ function prepareWorkerThreadExecution() { +@@ -52,6 +52,8 @@ function prepareWorkerThreadExecution() { }); } @@ -18,7 +18,7 @@ index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..4e7a9e7a7585fea2013ff70161672568 function prepareExecution(options) { const { expandArgv1, initializeModules, isMainThread } = options; -@@ -117,12 +119,17 @@ function setupUserModules() { +@@ -130,12 +132,17 @@ function setupUserModules() { loadPreloadModules(); // Need to be done after --require setup. initializeFrozenIntrinsics(); diff --git a/patches/node/fix_-wshadow_warning.patch b/patches/node/fix_-wshadow_warning.patch index 88ff6d4a9a71..01677fb3c773 100644 --- a/patches/node/fix_-wshadow_warning.patch +++ b/patches/node/fix_-wshadow_warning.patch @@ -28,7 +28,7 @@ In file included from ../../third_party/electron_node/src/env-inl.h:32: 1 error generated. diff --git a/src/util.h b/src/util.h -index a50d92601bf0ac278fa4137e056d5172a7589358..d18c263ae73d6181f07097bfcb1e4ef6f2e27e5e 100644 +index e218d9b62a1eb52404e3a57b999784e8e2f5ad58..22f2272c1bd4363be10a552748f63cbffba5c66d 100644 --- a/src/util.h +++ b/src/util.h @@ -129,10 +129,10 @@ void DumpBacktrace(FILE* fp); 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 bac54933dbff..e2ad21390a8b 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 42879b1e6bafb3d4bc8f298113d09c37930756ea..543ede0020fd79251bdd9eac897d9a0e330ef239 100644 +index 94fae0651890435348dacff2fe1838ea4db92037..10d11f1e9aacfbe4bb53e1220afab1e68db98313 100644 --- a/common.gypi +++ b/common.gypi @@ -80,6 +80,23 @@ 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 f858b2caa07b..611d3d541eb8 100644 --- a/patches/node/fix_assert_module_in_the_renderer_process.patch +++ b/patches/node/fix_assert_module_in_the_renderer_process.patch @@ -58,10 +58,10 @@ index d5a03d5e10faaa204b3f9f290fed79be824c78b1..c4caef25af670658965fc740ce03c2d2 } diff --git a/src/node_options.cc b/src/node_options.cc -index 499d048fcb82e50a302d74e2c7f87f3696103a40..7ad8d80faee840e4dd224d946871b2ff08b0c23c 100644 +index 397f9d4a7a8e9a850ae2e13b84d7f893076f724d..365748f046f9d0f232d4f0ebc7b0c7f56bbd74e2 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -1205,6 +1205,11 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { +@@ -1215,6 +1215,11 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { Local context = env->context(); Local ret = Object::New(isolate); diff --git a/patches/node/fix_do_not_resolve_electron_entrypoints.patch b/patches/node/fix_do_not_resolve_electron_entrypoints.patch index b87b4d4a1b26..5087ff96e6e5 100644 --- a/patches/node/fix_do_not_resolve_electron_entrypoints.patch +++ b/patches/node/fix_do_not_resolve_electron_entrypoints.patch @@ -6,7 +6,7 @@ Subject: fix: do not resolve electron entrypoints This wastes fs cycles and can result in strange behavior if this path actually exists on disk diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js -index 5a50d5d6afab6e6648f72a1c0efa1df4cd80bcd9..ebc9999358ccf16689dc02322eb1aeb86355f39b 100644 +index daaa153516c424334c18b5dfa35e0e55e1fbcce4..6181cc21bf303c41ed9c65681a34f6393223fb67 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -3,6 +3,7 @@ diff --git a/patches/node/fix_expose_lookupandcompile_with_parameters.patch b/patches/node/fix_expose_lookupandcompile_with_parameters.patch index 7eab7217eaba..fc1ba9f58a2f 100644 --- a/patches/node/fix_expose_lookupandcompile_with_parameters.patch +++ b/patches/node/fix_expose_lookupandcompile_with_parameters.patch @@ -10,7 +10,7 @@ parameters. This should be upstreamed. diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 522670ed5c9951c506dcdf2745585552ad2a081f..12ea7cdabb16a7f4ea350bdf1cd5d073e035fda1 100644 +index 4d4b59916bfdb203702c4e878ff2659b79de8c52..6451464c9fb411a1988bada86eabb4071ee07eb0 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -435,6 +435,22 @@ MaybeLocal BuiltinLoader::LookupAndCompile( 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 336a4208f228..33274492642c 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 @@ -18,10 +18,10 @@ index 219ef03a21214deb8961044cfc18ef9c1e711b60..7749b37001f869fe565d8c450ff7ca2b /** diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js -index 1178f06074ec8ec02a2e7b5cf8cbe7e68b72f809..d64d4452a50bc4469b2d2fcc3251b3df31cda6ec 100644 +index 71a9f8da0b49f3dca786eab07d44201a1bc76240..d8a072cf6af3b0d3a47ee69be04b26875683d261 100644 --- a/lib/internal/modules/esm/load.js +++ b/lib/internal/modules/esm/load.js -@@ -116,6 +116,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { +@@ -121,6 +121,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { protocol !== 'file:' && protocol !== 'data:' && protocol !== 'node:' && @@ -29,7 +29,7 @@ index 1178f06074ec8ec02a2e7b5cf8cbe7e68b72f809..d64d4452a50bc4469b2d2fcc3251b3df ( !experimentalNetworkImports || ( -@@ -124,7 +125,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { +@@ -129,7 +130,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { ) ) ) { @@ -39,10 +39,10 @@ index 1178f06074ec8ec02a2e7b5cf8cbe7e68b72f809..d64d4452a50bc4469b2d2fcc3251b3df ArrayPrototypePush(schemes, 'https', 'http'); } diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js -index 2cac6f2d450fab014544d15439e51575f86ccb38..ce2d851da2577e6e99980eb75337f629b38fddbf 100644 +index 7006887a6fe2bab525e52c6b0c76b5d089699a14..a93d93b3c2aae3ef790ffa4f417d50b884451549 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js -@@ -822,6 +822,8 @@ function parsePackageName(specifier, base) { +@@ -825,6 +825,8 @@ function parsePackageName(specifier, base) { return { packageName, packageSubpath, isScoped }; } @@ -51,7 +51,7 @@ index 2cac6f2d450fab014544d15439e51575f86ccb38..ce2d851da2577e6e99980eb75337f629 /** * @param {string} specifier * @param {string | URL | undefined} base -@@ -834,6 +836,10 @@ function packageResolve(specifier, base, conditions) { +@@ -837,6 +839,10 @@ function packageResolve(specifier, base, conditions) { return new URL('node:' + specifier); } @@ -89,10 +89,10 @@ index a425749e82acd7593c9fb1ceffedc119a4e416f2..1ceb89da21610c703f4a18be5888373c // We might trigger a getter -> dont fail. let value; diff --git a/lib/internal/url.js b/lib/internal/url.js -index 51688b8403076a328c2c62b6434fc310ee4f1ea7..36604c9de2179b5f6941dd9a7af66cdb03facd7f 100644 +index 9c11377aef1f24c6ce5cfdf02b800440afc4686a..b66a5bbde3e8c419d5385339805cbd94f630986d 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js -@@ -1399,6 +1399,8 @@ function fileURLToPath(path) { +@@ -1432,6 +1432,8 @@ function fileURLToPath(path) { path = new URL(path); else if (!isURL(path)) throw new ERR_INVALID_ARG_TYPE('path', ['string', 'URL'], path); diff --git a/patches/node/fix_ftbfs_werror_wunreachable-code-break.patch b/patches/node/fix_ftbfs_werror_wunreachable-code-break.patch deleted file mode 100644 index 5aee0a822fdd..000000000000 --- a/patches/node/fix_ftbfs_werror_wunreachable-code-break.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Charles Kerr -Date: Wed, 19 Jul 2023 15:57:19 -0500 -Subject: fix ftbfs Werror Wunreachable-code-break - -Fix a deps warning that causes FTBFS when building with -Werror. - -This patch can be removed if fixed upstream. -Upstream PR 1: https://github.com/ada-url/ada/pull/464 -Upstream PR 2: https://github.com/ada-url/idna/pull/31 - -diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp -index 570a659d118de5404003d0cd3731523d863de16b..43147d495f78eea916f895258f9c1846bd55f40a 100644 ---- a/deps/ada/ada.cpp -+++ b/deps/ada/ada.cpp -@@ -2829,7 +2829,6 @@ std::u32string map(std::u32string_view input) { - break; - case 2: - return error; // disallowed -- break; - - // case 3 : - default: -@@ -15175,4 +15174,4 @@ const ada_url_components* ada_get_components(ada_url result) noexcept { - } - } // extern "C" - /* end file src/ada_c.cpp */ --/* end file src/ada.cpp */ -+/* end file src/ada.cpp */ -\ No newline at end of file diff --git a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch index 9930fdbc5b40..0d1d0a2d5833 100644 --- a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch +++ b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch @@ -31,7 +31,7 @@ index 2685f5ea0bea998094453a5a29d23b1aaae55667..0ad4ba47b50a87bcf9e31a73c20a3a51 case EVP_CIPH_GCM_MODE: #ifndef OPENSSL_NO_OCB diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc -index 41e607e9298314bd7dd9e61643650f3ec75caea8..bd3228a67e1bda671488b347bd53ca805f09be87 100644 +index c6120a655ec853aef11c66ed37d7ca0ffb957dd3..a52ca15cb0ab592d4196d4bd0f1133240967d70c 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -158,7 +158,7 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { @@ -84,7 +84,7 @@ index 41e607e9298314bd7dd9e61643650f3ec75caea8..bd3228a67e1bda671488b347bd53ca80 const char* X509ErrorCode(long err) { // NOLINT(runtime/int) const char* code = "UNSPECIFIED"; -@@ -1048,14 +1055,14 @@ MaybeLocal GetClientHelloCiphers( +@@ -1044,14 +1051,14 @@ MaybeLocal GetClientHelloCiphers( Environment* env, const SSLPointer& ssl) { EscapableHandleScope scope(env->isolate()); @@ -274,7 +274,7 @@ index 47a42246eddfc795b735f5efd08edf2832bbf6c1..7e6afaa1d3a4612fd567924b40438a31 if (target diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 87d6ab3b9970e48db53cf7061d7208679c8b1dfc..4d79fbb4a30a7e57a7456413685706d9af36b1b3 100644 +index 1cfebb5e41d35d1845ba8e40657d6e8798988223..2302e3bad99625eb5dd5587218d0a1985837fb8e 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc @@ -518,24 +518,15 @@ Maybe Decorate(Environment* env, Local obj, @@ -361,7 +361,7 @@ index 1831bfd0baaac70277fc274a72235bf6a04697cb..1c0a3fcdeb44dc947bb8c38459533779 #if NODE_OPENSSL_HAS_QUIC #include diff --git a/src/node_options.cc b/src/node_options.cc -index 47a24ef5e59f049848637afbbfae6c9cfb9b8902..499d048fcb82e50a302d74e2c7f87f3696103a40 100644 +index 26f205bc3b425c5a6546a0ab27397754d6fe213d..397f9d4a7a8e9a850ae2e13b84d7f893076f724d 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -6,7 +6,7 @@ @@ -374,7 +374,7 @@ index 47a24ef5e59f049848637afbbfae6c9cfb9b8902..499d048fcb82e50a302d74e2c7f87f36 #endif diff --git a/src/node_options.h b/src/node_options.h -index c57e7a93b13a856e834b77707feaf691241ebc41..f8bdd016e13a8775520bfee7eb61d1c8d667bb58 100644 +index 7d210049aff445bd9b721dbded1ea299c514f415..864ed5673aa0aa30557e4c320c1eeb2b45e7defa 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -11,7 +11,7 @@ diff --git a/patches/node/fix_isurl_implementation.patch b/patches/node/fix_isurl_implementation.patch index 63fa1d8a5ae1..a2eee3d6da27 100644 --- a/patches/node/fix_isurl_implementation.patch +++ b/patches/node/fix_isurl_implementation.patch @@ -17,10 +17,10 @@ https://github.com/electron/electron/pull/39154#issuecomment-1644433388 This patch can be removed when we update to Node 20. diff --git a/lib/internal/url.js b/lib/internal/url.js -index 36604c9de2179b5f6941dd9a7af66cdb03facd7f..525b18e58a3e2f8e5ddfb138b1c54fd9b23a20cf 100644 +index b66a5bbde3e8c419d5385339805cbd94f630986d..228122a38776fe5436f2601efa16b7aa2b440468 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js -@@ -592,7 +592,12 @@ ObjectDefineProperties(URLSearchParams.prototype, { +@@ -618,7 +618,12 @@ ObjectDefineProperties(URLSearchParams.prototype, { * @returns {self is URL} */ function isURL(self) { @@ -34,7 +34,7 @@ index 36604c9de2179b5f6941dd9a7af66cdb03facd7f..525b18e58a3e2f8e5ddfb138b1c54fd9 } class URL { -@@ -688,14 +693,10 @@ class URL { +@@ -715,14 +720,10 @@ class URL { } get href() { diff --git a/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch b/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch index eb10cacd14ee..dfd66ee66fa1 100644 --- a/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch +++ b/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch @@ -6,7 +6,7 @@ Subject: fix: lazyload fs in esm loaders to apply asar patches Changes { foo } from fs to just "fs.foo" so that our patching of fs is applied to esm loaders diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js -index d64d4452a50bc4469b2d2fcc3251b3df31cda6ec..8d8f1b24fb68cce2b37e43f92aac200b4ee73cea 100644 +index d8a072cf6af3b0d3a47ee69be04b26875683d261..7991703df940634c62d798210b5e7b94412f9bde 100644 --- a/lib/internal/modules/esm/load.js +++ b/lib/internal/modules/esm/load.js @@ -20,7 +20,7 @@ const experimentalNetworkImports = @@ -18,17 +18,17 @@ index d64d4452a50bc4469b2d2fcc3251b3df31cda6ec..8d8f1b24fb68cce2b37e43f92aac200b const { URL } = require('internal/url'); const { ERR_INVALID_URL, -@@ -34,7 +34,7 @@ async function getSource(url, context) { - let responseURL = url; +@@ -39,7 +39,7 @@ async function getSource(url, context) { + let responseURL = href; let source; - if (parsed.protocol === 'file:') { -- source = await readFileAsync(parsed); -+ source = await fs.promises.readFile(parsed); - } else if (parsed.protocol === 'data:') { - const match = RegExpPrototypeExec(DATA_URL_PATTERN, parsed.pathname); + if (protocol === 'file:') { +- source = await readFileAsync(url); ++ source = await fs.promises.readFile(url); + } else if (protocol === 'data:') { + const match = RegExpPrototypeExec(DATA_URL_PATTERN, url.pathname); if (!match) { diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js -index ce2d851da2577e6e99980eb75337f629b38fddbf..fed26d25b59d66ab6e5160e2e13c8eea0cb44f8d 100644 +index a93d93b3c2aae3ef790ffa4f417d50b884451549..4072321e6bc3c9f0c8428d8159670950886c3404 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -26,11 +26,7 @@ const { @@ -44,7 +44,7 @@ index ce2d851da2577e6e99980eb75337f629b38fddbf..fed26d25b59d66ab6e5160e2e13c8eea const { getOptionValue } = require('internal/options'); const pendingDeprecation = getOptionValue('--pending-deprecation'); // Do not eagerly grab .manifest, it may be in TDZ -@@ -171,14 +167,14 @@ const realpathCache = new SafeMap(); +@@ -172,14 +168,14 @@ const realpathCache = new SafeMap(); * @returns {import('fs').Stats} */ const tryStatSync = @@ -61,7 +61,7 @@ index ce2d851da2577e6e99980eb75337f629b38fddbf..fed26d25b59d66ab6e5160e2e13c8eea } /** -@@ -326,7 +322,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) { +@@ -329,7 +325,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) { } if (!preserveSymlinks) { diff --git a/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch b/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch index 0c287b3ad3d5..391271a50ffa 100644 --- a/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch +++ b/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch @@ -6,10 +6,10 @@ Subject: fix: suppress clang -Wdeprecated-declarations in libuv Should be upstreamed. diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c -index 99432053cc3b242e514268b7aba2e2d83a9e64f2..750a5424953aad104ba1e865fefd55d316485917 100644 +index f6ec79cd57b5010ed5fd6829d952bcdacc8b7671..5cda078a55f7825d135a107fa98e1aa3527dd147 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c -@@ -1743,10 +1743,17 @@ int uv_os_uname(uv_utsname_t* buffer) { +@@ -1685,10 +1685,17 @@ int uv_os_uname(uv_utsname_t* buffer) { #ifdef _MSC_VER #pragma warning(suppress : 4996) #endif diff --git a/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch b/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch index e9e3a4ff2796..c297ff6f6838 100644 --- a/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch +++ b/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch @@ -7,25 +7,21 @@ Subject: refactor: alter child_process.fork to use execute script with When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary. diff --git a/lib/child_process.js b/lib/child_process.js -index 59c37b97672d39a9da89ca2b78aa28a77ca78699..da553f6556a06d57d7490d74a3b4dd8f0132600c 100644 +index 5bdc474c80169cb0ceeb082e6afcf9e8fa322ab3..ec39a00ddb791e6e1ebe31aa45d290e7dcc4ebfc 100644 --- a/lib/child_process.js +++ b/lib/child_process.js -@@ -137,7 +137,18 @@ function fork(modulePath, args = [], options) { +@@ -139,6 +139,14 @@ function fork(modulePath, args = [], options) { validateObject(options, 'options'); } - options = { ...options, shell: false }; -+ + options = { __proto__: null, ...options, shell: false }; + // When forking a child script, we setup a special environment to make + // the electron binary run like upstream Node.js + options.env = Object.create(options.env || process.env) + options.env.ELECTRON_RUN_AS_NODE = 1; + + if (!options.execPath && process.type && process.platform == 'darwin') { -+ options.execPath = process.helperExecPath; ++ options.execPath = process.helperExecPath; + } -+ options.execPath = options.execPath || process.execPath; -+ validateArgumentNullCheck(options.execPath, 'options.execPath'); - // Prepare arguments for fork: diff --git a/patches/node/support_v8_sandboxed_pointers.patch b/patches/node/support_v8_sandboxed_pointers.patch index 40da8c5a7f68..a6aeabeba752 100644 --- a/patches/node/support_v8_sandboxed_pointers.patch +++ b/patches/node/support_v8_sandboxed_pointers.patch @@ -26,7 +26,7 @@ index 7ef6d04794c31064c70dbbb0bfc1dd7bf4d1b8fc..d5a03d5e10faaa204b3f9f290fed79be void* ret; if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers) diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 4d79fbb4a30a7e57a7456413685706d9af36b1b3..13e4d8b532cdb4c39fab30a8f4118ff8d2bca33c 100644 +index 2302e3bad99625eb5dd5587218d0a1985837fb8e..1aa2aafafdae1d2a1b2c851db59e3d736fb8bd3e 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc @@ -349,10 +349,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { diff --git a/patches/node/test_formally_mark_some_tests_as_flaky.patch b/patches/node/test_formally_mark_some_tests_as_flaky.patch index a8a9bdb88245..dd4c35a69e4d 100644 --- a/patches/node/test_formally_mark_some_tests_as_flaky.patch +++ b/patches/node/test_formally_mark_some_tests_as_flaky.patch @@ -7,7 +7,7 @@ Instead of disabling the tests, flag them as flaky so they still run but don't cause CI failures on flakes. diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status -index 913ae4b0b10a7d508d864539cf075fa9c2f9362c..0539a599e57d40c5da650dcf5ffe9a67763506e1 100644 +index 8de4ad29cb14149ed0c15eb201b3d17be506bac9..182aab4bc781da4c1968a84f87c1e7f2f0b986f1 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -5,6 +5,13 @@ prefix parallel @@ -23,9 +23,9 @@ index 913ae4b0b10a7d508d864539cf075fa9c2f9362c..0539a599e57d40c5da650dcf5ffe9a67 +test-debugger-random-port-with-inspect-port: PASS, FLAKY [$system==win32] - # https://github.com/nodejs/node/issues/24497 + # https://github.com/nodejs/node/issues/41206 diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status -index 5cefcb95773bedc80bc462e058a11045be176741..33f50be5898754af696468499bcfa8e3c721434d 100644 +index 0688f5b05e789c15f2c9fc4c9e1a20cd5d1ba8be..64dc814fd24f3e6d90f246a4e66531696eab03cd 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -7,6 +7,18 @@ prefix sequential