From b665eb6d43d5238ffcd1bb7239e75797cf1bd5d5 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 17 Jun 2020 15:57:12 -0700 Subject: [PATCH] chore: bump node to v12.18.0 (master) (#23789) Co-authored-by: Shelley Vohr --- DEPS | 2 +- patches/common/zlib/.patches | 1 + .../common/zlib/fix_export_zlib_symbols.patch | 22 ++++ patches/node/.patches | 3 +- .../avoid_calling_deprecated_method.patch | 2 +- patches/node/build_add_gn_build_files.patch | 114 ++++-------------- ...ng_back_node_with_ltcg_configuration.patch | 2 +- ...f_original-fs_and_custom_embedder_js.patch | 4 +- ...xt-aware_native_modules_being_loaded.patch | 18 +-- ...ngroupcallback_has_been_removed_from.patch | 26 ++-- ...is_on_64bit_arch_and_ptr_compression.patch | 4 +- .../expose_get_builtin_module_function.patch | 4 +- ...s_for_low-level_hooks_and_exceptions.patch | 26 ++-- .../feat_add_uv_loop_watcher_queue_code.patch | 12 +- .../node/feat_initialize_asar_support.patch | 6 +- ...r_enable_lto_and_build_v8_with_gn_in.patch | 2 +- ...ment_out_incompatible_crypto_modules.patch | 80 ++++++++++++ ...console_window_when_creating_process.patch | 4 +- .../fix_expose_internalcallbackscope.patch | 6 +- ...se_tracing_tracingcontroller_instead.patch | 4 +- ..._apis_are_not_available_in_boringssl.patch | 18 +-- .../fix_remove_bad_semicolon_outside_fn.patch | 19 +++ .../fix_use_crypto_impls_for_compat.patch | 4 +- .../fixme_comment_trace_event_macro.patch | 4 +- ...ixme_remove_async_id_assertion_check.patch | 2 +- ...efined_version_of_internalmodulestat.patch | 4 +- .../make_module_globalpaths_a_reference.patch | 4 +- .../override_existing_v8_reallocate.patch | 18 +-- .../pass_all_globals_through_require.patch | 6 +- ...dder_overriding_of_internal_fs_calls.patch | 6 +- ...is_deprecated_use_compiledwasmmodule.patch | 2 +- ...sk_api_override_removed_in_latest_v8.patch | 4 +- .../revert_crypto_add_oaeplabel_option.patch | 4 +- ...genrandom_from_advapi32_dll_directly.patch | 110 ----------------- script/node-disabled-tests.json | 9 ++ shell/app/node_main.cc | 5 +- shell/browser/microtasks_runner.cc | 5 +- shell/common/api/electron_bindings.cc | 7 +- vsts-arm-test-steps.yml | 3 + vsts-arm32v7.yml | 2 +- vsts-arm64v8.yml | 2 +- 41 files changed, 266 insertions(+), 314 deletions(-) create mode 100644 patches/common/zlib/.patches create mode 100644 patches/common/zlib/fix_export_zlib_symbols.patch create mode 100644 patches/node/fix_comment_out_incompatible_crypto_modules.patch create mode 100644 patches/node/fix_remove_bad_semicolon_outside_fn.patch delete mode 100644 patches/node/win_use_rtlgenrandom_from_advapi32_dll_directly.patch diff --git a/DEPS b/DEPS index a06c035096f6..08f3086379d9 100644 --- a/DEPS +++ b/DEPS @@ -15,7 +15,7 @@ vars = { 'chromium_version': 'ff6c4f4b826d66c2e32380bf5d1eb5e1fe37faef', 'node_version': - 'v12.16.3', + 'v12.18.0', 'nan_version': '2c4ee8a32a299eada3cd6e468bbd0a473bfea96d', diff --git a/patches/common/zlib/.patches b/patches/common/zlib/.patches new file mode 100644 index 000000000000..65fe1a41ab55 --- /dev/null +++ b/patches/common/zlib/.patches @@ -0,0 +1 @@ +fix_export_zlib_symbols.patch diff --git a/patches/common/zlib/fix_export_zlib_symbols.patch b/patches/common/zlib/fix_export_zlib_symbols.patch new file mode 100644 index 000000000000..31f3c34a582a --- /dev/null +++ b/patches/common/zlib/fix_export_zlib_symbols.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Mon, 1 Jun 2020 15:30:47 -0800 +Subject: fix: export zlib symbols + +This patch sets ZLIB_DLL so that we properly export zlib symbols. + +diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn +index aeff252d66abe1797154b975d3b98d02cab6f4f6..5c34134486b30ae650aab93abb8da38b7aa4fe13 100644 +--- a/third_party/zlib/BUILD.gn ++++ b/third_party/zlib/BUILD.gn +@@ -272,6 +272,10 @@ component("zlib") { + defines = [] + deps = [] + ++ if (is_win) { ++ defines += [ "ZLIB_DLL" ] ++ } ++ + if (!use_x86_x64_optimizations && !use_arm_neon_optimizations) { + # Apparently android_cronet bot builds with NEON disabled and + # we also should disable optimizations for iOS@x86 (a.k.a. simulator). diff --git a/patches/node/.patches b/patches/node/.patches index 58f3386b14e4..3c3d08678d8e 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -35,4 +35,5 @@ weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch weakrefs_split_out_finalizationregistry_cleanupsome.patch fix_window_c-ares_incompatibilities.patch chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch -win_use_rtlgenrandom_from_advapi32_dll_directly.patch +fix_remove_bad_semicolon_outside_fn.patch +fix_comment_out_incompatible_crypto_modules.patch diff --git a/patches/node/avoid_calling_deprecated_method.patch b/patches/node/avoid_calling_deprecated_method.patch index 680bac6f2db7..33108c082ff6 100644 --- a/patches/node/avoid_calling_deprecated_method.patch +++ b/patches/node/avoid_calling_deprecated_method.patch @@ -9,7 +9,7 @@ V8 v8.1. This is already present in Node.js v14 and can be removed when we upgrade. diff --git a/src/node_serdes.cc b/src/node_serdes.cc -index a2d185c4167a75e227cd4b2abbf5c5abc7e16acb..e918ed9d12e9fb1d13b2fc05a98cab099fb71a68 100644 +index bcdcd19b261e8815e3c0c0f150f2eda72ef47cf5..86fb822dd5bfa9da7767418e6c6f206f8e96ca73 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -286,7 +286,6 @@ DeserializerContext::DeserializerContext(Environment* env, diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 65319d3cfc68..2b35026342d1 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP. diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 -index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e30c77dd71 +index 0000000000000000000000000000000000000000..b5ea846fd9fd46f34dd4260b67282186fddbc0be --- /dev/null +++ b/BUILD.gn -@@ -0,0 +1,376 @@ +@@ -0,0 +1,360 @@ +import("//electron/build/asar.gni") +import("//v8/gni/v8.gni") + @@ -18,9 +18,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3 + # Enable the V8 inspector protocol for use with node. + node_enable_inspector = true + -+ # Enable diagnostic reporting withing Node.js -+ node_report = true -+ + # Build node with SSL support. + # The variable is called "openssl" for parity with node's GYP build. + node_use_openssl = true @@ -126,11 +123,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3 + } else { + defines += [ "NODE_USE_V8_PLATFORM=0" ] + } -+ if (node_report) { -+ defines += [ "NODE_REPORT=1" ] -+ } else { -+ defines += [ "NODE_REPORT=0" ] -+ } +} + +config("node_lib_config") { @@ -217,7 +209,7 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3 + "deps/llhttp", + "deps/nghttp2", + "deps/uvwasi", -+ "deps/zlib", ++ "//third_party/zlib", + "//third_party/brotli:dec", + "//third_party/brotli:enc", + "//v8:v8_libplatform", @@ -262,14 +254,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3 + libs += [ "CoreFoundation.framework" ] + } + -+ if (node_report) { -+ sources += [ -+ "src/node_report.cc", -+ "src/node_report_module.cc", -+ "src/node_report_utils.cc", -+ ] -+ } -+ + if (node_enable_inspector) { + sources += [ + "src/inspector_agent.cc", @@ -291,7 +275,7 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3 + sources += [ + "src/node_crypto.cc", + "src/node_crypto.h", -+ "src/node_crypto_common.cc", ++ "src/node_crypto_common.cc", + "src/node_crypto_common.h", + "src/node_crypto_bio.cc", + "src/node_crypto_bio.h", @@ -837,10 +821,10 @@ index 0000000000000000000000000000000000000000..67116f2070bb9200aace81afdf0b1e7a +} diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn new file mode 100644 -index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c7128ab5eec +index 0000000000000000000000000000000000000000..b1c2cb80193bd0a0c56867428f2da8b46f11b16b --- /dev/null +++ b/deps/uvwasi/BUILD.gn -@@ -0,0 +1,35 @@ +@@ -0,0 +1,36 @@ +config("uvwasi_config") { + include_dirs = [ "include" ] +} @@ -862,7 +846,7 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71 + deps = [ "../../deps/uv" ] + + public_configs = [ ":uvwasi_config" ] -+ ++ + cflags_c = [] + if (!is_win) { + cflags_c += [ "-fvisibility=hidden" ] @@ -871,81 +855,18 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71 + sources = [ + "src/clocks.c", + "src/fd_table.c", ++ "src/path_resolver.c", + "src/uv_mapping.c", + "src/uvwasi.c", + "src/wasi_rights.c", + ] +} -diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn -new file mode 100644 -index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2eaaea76280 ---- /dev/null -+++ b/deps/zlib/BUILD.gn -@@ -0,0 +1,58 @@ -+config("includes") { -+ include_dirs = [ "." ] -+} -+ -+config("ignored_warnings") { -+ if (is_win) { -+ cflags = [ -+ "/wd4131", # old-style declarator -+ "/wd4127", # conditional expression is constant -+ "/wd4244", # possible loss of data on type conversion -+ "/wd4996", # deprecated 'open' -+ ] -+ } else { -+ cflags = [ -+ "-Wno-implicit-function-declaration", -+ "-Wno-shift-negative-value", -+ ] -+ } -+} -+ -+source_set("zlib") { -+ sources = [ -+ "adler32.c", -+ "compress.c", -+ "crc32.c", -+ "crc32.h", -+ "deflate.c", -+ "deflate.h", -+ "gzclose.c", -+ "gzguts.h", -+ "gzlib.c", -+ "gzread.c", -+ "gzwrite.c", -+ "infback.c", -+ "inffast.c", -+ "inffast.h", -+ "inffixed.h", -+ "inflate.c", -+ "inflate.h", -+ "inftrees.c", -+ "inftrees.h", -+ "trees.c", -+ "trees.h", -+ "uncompr.c", -+ "zconf.h", -+ "zlib.h", -+ "zutil.c", -+ "zutil.h", -+ ] -+ -+ if (is_win) { -+ defines = [ "ZLIB_DLL" ] -+ } -+ -+ configs += [ ":ignored_warnings" ] -+ -+ public_configs = [ ":includes" ] -+} diff --git a/filenames.json b/filenames.json new file mode 100644 -index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf1520b376e7e +index 0000000000000000000000000000000000000000..ca5ae6d2e24d53db37257192f3c34068ba0f8e69 --- /dev/null +++ b/filenames.json -@@ -0,0 +1,500 @@ +@@ -0,0 +1,513 @@ +// This file is automatically generated by generate_gn_filenames_json.py +// DO NOT EDIT +{ @@ -1161,6 +1082,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152 + "lib/internal/fs/utils.js", + "lib/internal/fs/watchers.js", + "lib/internal/http.js", ++ "lib/internal/heap_utils.js", + "lib/internal/histogram.js", + "lib/internal/idna.js", + "lib/internal/inspector_async_hook.js", @@ -1235,6 +1157,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152 + "lib/internal/vm/module.js", + "lib/internal/worker.js", + "lib/internal/worker/io.js", ++ "lib/internal/watchdog.js", + "lib/internal/streams/lazy_transform.js", + "lib/internal/streams/async_iterator.js", + "lib/internal/streams/buffer_list.js", @@ -1291,6 +1214,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152 + "src/js_native_api_v8.h", + "src/js_native_api_v8_internals.h", + "src/js_stream.cc", ++ "src/json_utils.cc", + "src/module_wrap.cc", + "src/node.cc", + "src/node_api.cc", @@ -1322,7 +1246,11 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152 + "src/node_process_events.cc", + "src/node_process_methods.cc", + "src/node_process_object.cc", ++ "src/node_report.cc", ++ "src/node_report_module.cc", ++ "src/node_report_utils.cc", + "src/node_serdes.cc", ++ "src/node_sockaddr.cc", + "src/node_stat_watcher.cc", + "src/node_symbols.cc", + "src/node_task_queue.cc", @@ -1373,6 +1301,9 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152 + "src/histogram-inl.h", + "src/http_parser_adaptor.h", + "src/js_stream.h", ++ "src/json_utils.h", ++ "src/large_pages/node_large_page.cc", ++ "src/large_pages/node_large_page.h", + "src/memory_tracker.h", + "src/memory_tracker-inl.h", + "src/module_wrap.h", @@ -1408,8 +1339,11 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152 + "src/node_perf_common.h", + "src/node_platform.h", + "src/node_process.h", ++ "src/node_report.h", + "src/node_revert.h", + "src/node_root_certs.h", ++ "src/node_sockaddr.h", ++ "src/node_sockaddr-inl.h", + "src/node_stat_watcher.h", + "src/node_union_bytes.h", + "src/node_url.h", @@ -1652,7 +1586,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c + args = rebase_path(inputs + outputs, root_build_dir) +} diff --git a/src/node_version.h b/src/node_version.h -index 958519fbe4a83293f5c7bfabb310d3f15d319922..935ead39a1148c22f8c778df750e0c24ceafe909 100644 +index 49d0f6f8a69b48b79556e36c54daae080a00386b..aa1563e93ee66f1c1a2c6840b3d020dc8f9cef68 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -89,7 +89,10 @@ diff --git a/patches/node/build_bring_back_node_with_ltcg_configuration.patch b/patches/node/build_bring_back_node_with_ltcg_configuration.patch index 1b6f1b903519..90a91f0ad872 100644 --- a/patches/node/build_bring_back_node_with_ltcg_configuration.patch +++ b/patches/node/build_bring_back_node_with_ltcg_configuration.patch @@ -10,7 +10,7 @@ THe fix for this should land in node-gyp as discussed in above issue, landing this as temporary patch. diff --git a/common.gypi b/common.gypi -index 1c753edfefa96d69c5de7d54078fa3136b244b52..71b20b28d923c39f047bf57e05558879c9d002ec 100644 +index 1e8cac3c5123698d9551835639e87a0afa7a2246..325382613e59ef8796c1e878afed0cf66bc1e0ca 100644 --- a/common.gypi +++ b/common.gypi @@ -19,7 +19,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 cdf1266f9784..d2974573e38d 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 @@ -14,7 +14,7 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded through LoadEmbedderJavaScriptSource() diff --git a/src/node_native_module.cc b/src/node_native_module.cc -index 43c13ea30a0dc56151cba3d4597ae81b27c41300..e9a43592d558409d5fd43e2f51b22efb4e41551d 100644 +index 1b916d645d863929710ce5e4e930ec72fb426844..6d39a8858e093199fb935b68ff84388d48d6c35e 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -23,6 +23,7 @@ NativeModuleLoader NativeModuleLoader::instance_; @@ -26,7 +26,7 @@ index 43c13ea30a0dc56151cba3d4597ae81b27c41300..e9a43592d558409d5fd43e2f51b22efb NativeModuleLoader* NativeModuleLoader::GetInstance() { diff --git a/src/node_native_module.h b/src/node_native_module.h -index fabaea75686161f488a03349e07049a513b98fad..5a6b01dc12fb77d5f8c26a1153ead2a1b2a8d061 100644 +index c0bce3bce42c848d63a10147ef483c9d4465f5ce..7f296e459d46b4cda51baf9887df060f0372227d 100644 --- a/src/node_native_module.h +++ b/src/node_native_module.h @@ -44,6 +44,7 @@ class NativeModuleLoader { diff --git a/patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch b/patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch index 0400189f9bbf..74e30af78268 100644 --- a/patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch +++ b/patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch @@ -8,10 +8,10 @@ once we stop warning and begin to unilaterally prevent non-context aware modules from being loaded. diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js -index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af2ccee362 100644 +index 0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc..b4a0f71af5853f427a10449b52509052fbe3facd 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js -@@ -86,8 +86,10 @@ function patchProcessObject(expandArgv1) { +@@ -89,8 +89,10 @@ function patchProcessObject(expandArgv1) { if (expandArgv1 && process.argv[1] && !process.argv[1].startsWith('-')) { // Expand process.argv[1] into a full path. @@ -23,10 +23,10 @@ index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af // TODO(joyeecheung): most of these should be deprecated and removed, diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 992482525f8bdea399528f1e5673f4efa21b7246..800c22dea9c07a4039e6e7eabeae73a9b8013e09 100644 +index e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19e11526c3 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1104,6 +1104,13 @@ Module.prototype._compile = function(content, filename) { +@@ -1109,6 +1109,13 @@ Module.prototype._compile = function(content, filename) { if (getOptionValue('--inspect-brk') && process._eval == null) { if (!resolvedArgv) { // We enter the repl if we're not given a filename argument. @@ -41,10 +41,10 @@ index 992482525f8bdea399528f1e5673f4efa21b7246..800c22dea9c07a4039e6e7eabeae73a9 try { resolvedArgv = Module._resolveFilename(process.argv[1], null, false); diff --git a/src/env.h b/src/env.h -index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5 100644 +index deeeb2a385ab75fbfd86af619e1aad118f1a0794..5c0392a59b3938b0b6e433024f9dd92e222a1b47 100644 --- a/src/env.h +++ b/src/env.h -@@ -880,6 +880,15 @@ class Environment : public MemoryRetainer { +@@ -887,6 +887,15 @@ class Environment : public MemoryRetainer { uint64_t thread_id = kNoThreadId); ~Environment() override; @@ -60,7 +60,7 @@ index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f void InitializeLibuv(bool start_profiler_idle_notifier); inline const std::vector& exec_argv(); inline const std::vector& argv(); -@@ -1266,6 +1275,9 @@ class Environment : public MemoryRetainer { +@@ -1270,6 +1279,9 @@ class Environment : public MemoryRetainer { inline void ThrowError(v8::Local (*fun)(v8::Local), const char* errmsg); @@ -71,7 +71,7 @@ index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f v8::Isolate* const isolate_; IsolateData* const isolate_data_; diff --git a/src/node_binding.cc b/src/node_binding.cc -index db60617cebee83ac09371aa1e2200280e29bd772..714f973a7e984fef2e705882a3f30d8a95c33653 100644 +index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca2179b4a0 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -3,6 +3,7 @@ @@ -82,7 +82,7 @@ index db60617cebee83ac09371aa1e2200280e29bd772..714f973a7e984fef2e705882a3f30d8a #include "util.h" #if HAVE_OPENSSL -@@ -467,10 +468,22 @@ void DLOpen(const FunctionCallbackInfo& args) { +@@ -462,10 +463,22 @@ void DLOpen(const FunctionCallbackInfo& args) { if (mp != nullptr) { if (mp->nm_context_register_func == nullptr) { diff --git a/patches/node/chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch b/patches/node/chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch index 358199edc4dc..3ce2f6a885f5 100644 --- a/patches/node/chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch +++ b/patches/node/chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch @@ -5,7 +5,7 @@ Subject: chore: SetHostCleanupFinalizationGroupCallback has been removed from V8 diff --git a/src/api/environment.cc b/src/api/environment.cc -index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc83726c376 100644 +index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea463070456c77 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -12,7 +12,6 @@ using errors::TryCatchScope; @@ -14,9 +14,9 @@ index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc8 using v8::EscapableHandleScope; -using v8::FinalizationGroup; using v8::Function; + using v8::FunctionCallbackInfo; using v8::HandleScope; - using v8::Isolate; -@@ -77,15 +76,6 @@ static MaybeLocal PrepareStackTraceCallback(Local context, +@@ -78,15 +77,6 @@ static MaybeLocal PrepareStackTraceCallback(Local context, return result; } @@ -30,9 +30,9 @@ index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc8 -} - void* NodeArrayBufferAllocator::Allocate(size_t size) { + void* ret; if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers) - return UncheckedCalloc(size); -@@ -228,11 +218,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) { +@@ -255,11 +245,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) { s.promise_reject_callback : task_queue::PromiseRejectCallback; isolate->SetPromiseRejectCallback(promise_reject_cb); @@ -45,10 +45,10 @@ index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc8 v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); } diff --git a/src/env-inl.h b/src/env-inl.h -index 5248e7062354c1deb90b58a784237e6f01335c22..e2a104c9c4562abeb579fe62c9c46ca34bf03581 100644 +index fcb58dc6709d1333fb992e4a0fbf498fbb496994..71d86c4976806508c5b2db1563bfa4f460ff618f 100644 --- a/src/env-inl.h +++ b/src/env-inl.h -@@ -1182,12 +1182,6 @@ void Environment::RemoveCleanupHook(void (*fn)(void*), void* arg) { +@@ -1191,12 +1191,6 @@ void Environment::RemoveCleanupHook(void (*fn)(void*), void* arg) { cleanup_hooks_.erase(search); } @@ -62,7 +62,7 @@ index 5248e7062354c1deb90b58a784237e6f01335c22..e2a104c9c4562abeb579fe62c9c46ca3 const CleanupHookCallback& cb) const { return std::hash()(cb.arg_); diff --git a/src/env.cc b/src/env.cc -index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea503fffc21b 100644 +index 3974e6c7ebe74004a7a9e4dc2966fd8651c1522f..da779854f928abda5ee9d08c39ba1b5e5eb798a4 100644 --- a/src/env.cc +++ b/src/env.cc @@ -30,7 +30,6 @@ using v8::ArrayBuffer; @@ -73,7 +73,7 @@ index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea50 using v8::Function; using v8::FunctionTemplate; using v8::HandleScope; -@@ -473,7 +472,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) { +@@ -500,7 +499,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) { [](uv_async_t* async) { Environment* env = ContainerOf( &Environment::task_queues_async_, async); @@ -81,7 +81,7 @@ index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea50 env->RunAndClearNativeImmediates(); }); uv_unref(reinterpret_cast(&idle_prepare_handle_)); -@@ -1112,25 +1110,6 @@ void Environment::RunWeakRefCleanup() { +@@ -1138,25 +1136,6 @@ void Environment::RunWeakRefCleanup() { isolate()->ClearKeptObjects(); } @@ -108,10 +108,10 @@ index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea50 void BaseObject::DeleteMe(void* data) { BaseObject* self = static_cast(data); diff --git a/src/env.h b/src/env.h -index b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5..e269c47ae3814b42fdd2792360c1acb1995e98d2 100644 +index 5c0392a59b3938b0b6e433024f9dd92e222a1b47..7ba18f8ec0e2675cb634e26250266ad809708f82 100644 --- a/src/env.h +++ b/src/env.h -@@ -1125,9 +1125,7 @@ class Environment : public MemoryRetainer { +@@ -1129,9 +1129,7 @@ class Environment : public MemoryRetainer { void AtExit(void (*cb)(void* arg), void* arg); void RunAtExitCallbacks(); @@ -121,7 +121,7 @@ index b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5..e269c47ae3814b42fdd2792360c1acb1 // Strings and private symbols are shared across shared contexts // The getters simply proxy to the per-isolate primitive. -@@ -1350,8 +1348,6 @@ class Environment : public MemoryRetainer { +@@ -1354,8 +1352,6 @@ class Environment : public MemoryRetainer { uint64_t thread_id_; std::unordered_set sub_worker_contexts_; diff --git a/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch b/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch index 48bf2690246f..3a260814bcd5 100644 --- a/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch +++ b/patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch @@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid out in memory on 64-bit machines, and will summarily fail to work. diff --git a/common.gypi b/common.gypi -index 71b20b28d923c39f047bf57e05558879c9d002ec..0a10a734d48e0b45b0ed4502927616e46633dafb 100644 +index 325382613e59ef8796c1e878afed0cf66bc1e0ca..4f629462828dfe23f3c9e28f70376f892dead76c 100644 --- a/common.gypi +++ b/common.gypi @@ -71,6 +71,9 @@ @@ -31,7 +31,7 @@ index 71b20b28d923c39f047bf57e05558879c9d002ec..0a10a734d48e0b45b0ed4502927616e4 ['target_arch in "ppc64 s390x"', { 'v8_enable_backtrace': 1, }], -@@ -374,6 +380,12 @@ +@@ -378,6 +384,12 @@ }], ], }], diff --git a/patches/node/expose_get_builtin_module_function.patch b/patches/node/expose_get_builtin_module_function.patch index c25872eeb47e..1333635b3605 100644 --- a/patches/node/expose_get_builtin_module_function.patch +++ b/patches/node/expose_get_builtin_module_function.patch @@ -9,10 +9,10 @@ modules to sandboxed renderers. TODO(codebytere): remove and replace with a public facing API. diff --git a/src/node_binding.cc b/src/node_binding.cc -index 0facfc36cbcb784cd0a1802a7748dff3366710fd..db60617cebee83ac09371aa1e2200280e29bd772 100644 +index 91ae3530d09b162c910eef4199d89c33c9feb379..565a3fff85a25ef25ccf5c74d2ade7f5a6994b05 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc -@@ -611,6 +611,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { +@@ -606,6 +606,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(exports); } diff --git a/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch b/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch index 42265750b6c7..f2c889549050 100644 --- a/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch +++ b/patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch @@ -24,10 +24,10 @@ Environment on the V8 context of blink, so no new V8 context is created. As a result, a renderer process may have multiple Node Environments in it. diff --git a/src/env.cc b/src/env.cc -index ec50d8841ac1e360411a87b3bfc1454969696582..65e4bda890461f691036005252db7e61865d2493 100644 +index 5b8a63a0017c4f9eed50afacb8de0b7f659f81b6..3974e6c7ebe74004a7a9e4dc2966fd8651c1522f 100644 --- a/src/env.cc +++ b/src/env.cc -@@ -383,6 +383,12 @@ Environment::Environment(IsolateData* isolate_data, +@@ -410,6 +410,12 @@ Environment::Environment(IsolateData* isolate_data, // TODO(joyeecheung): deserialize when the snapshot covers the environment // properties. CreateProperties(); @@ -41,18 +41,10 @@ index ec50d8841ac1e360411a87b3bfc1454969696582..65e4bda890461f691036005252db7e61 Environment::~Environment() { diff --git a/src/node.cc b/src/node.cc -index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2c7fde060 100644 +index da6aebf7178cf6d61ac46088bd50270b335e0b9e..f46db766de54f59d5baae28b16cd04ce9f20042c 100644 --- a/src/node.cc +++ b/src/node.cc -@@ -27,6 +27,7 @@ - #include "env-inl.h" - #include "memory_tracker-inl.h" - #include "node_binding.h" -+#include "node_errors.h" - #include "node_internals.h" - #include "node_main_instance.h" - #include "node_metadata.h" -@@ -128,6 +129,9 @@ using v8::Undefined; +@@ -124,6 +124,9 @@ using v8::Undefined; using v8::V8; using v8::Value; @@ -62,7 +54,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2 namespace per_process { // node_revert.h -@@ -343,6 +347,13 @@ MaybeLocal Environment::RunBootstrapping() { +@@ -339,6 +342,13 @@ MaybeLocal Environment::RunBootstrapping() { CHECK(!has_run_bootstrapping_code()); @@ -76,7 +68,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2 if (BootstrapInternalLoaders().IsEmpty()) { return MaybeLocal(); } -@@ -726,7 +737,9 @@ int InitializeNodeWithArgs(std::vector* argv, +@@ -735,7 +745,9 @@ int InitializeNodeWithArgs(std::vector* argv, binding::RegisterBuiltinModules(); // Make inherited handles noninheritable. @@ -85,9 +77,9 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2 + uv_disable_stdio_inheritance(); + } - #ifdef NODE_REPORT // Cache the original command line to be -@@ -762,6 +775,8 @@ int InitializeNodeWithArgs(std::vector* argv, + // used in diagnostic reports. +@@ -769,6 +781,8 @@ int InitializeNodeWithArgs(std::vector* argv, if (exit_code != 0) return exit_code; } #endif @@ -96,7 +88,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2 const int exit_code = ProcessGlobalArgs(argv, exec_argv, -@@ -806,6 +821,7 @@ int InitializeNodeWithArgs(std::vector* argv, +@@ -813,6 +827,7 @@ int InitializeNodeWithArgs(std::vector* argv, } per_process::metadata.versions.InitializeIntlVersions(); #endif diff --git a/patches/node/feat_add_uv_loop_watcher_queue_code.patch b/patches/node/feat_add_uv_loop_watcher_queue_code.patch index 06c4b3d67fde..3b2acdcd3b1d 100644 --- a/patches/node/feat_add_uv_loop_watcher_queue_code.patch +++ b/patches/node/feat_add_uv_loop_watcher_queue_code.patch @@ -6,10 +6,10 @@ Subject: feat: add uv_loop watcher_queue code Electron's Node Integration works by listening to Node's backend file descriptor in a separate thread; when an event is ready the backend file descriptor will trigger a new event for it, and the main thread will then iterate the libuv loop. For certain operations (ex. adding a timeout task) the backend file descriptor isn't informed, & as a result the main thread doesn't know it needs to iterate the libuv loop so the timeout task will never execute until something else trigger a new event. This commit should be removed when https://github.com/libuv/libuv/pull/1921 is merged diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h -index 626cebabd8c9ea13410a61286e902e0b0986257b..7f1ea84a768baa0d22351456600fef20c7f3f310 100644 +index a3a770db88b90e3afc8f344c585c8c598ba2c088..b91e31237c5b3e2fb8c0bee8516155d23624a337 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h -@@ -1740,6 +1740,8 @@ union uv_any_req { +@@ -1767,6 +1767,8 @@ union uv_any_req { struct uv_loop_s { /* User data - use this for whatever. */ void* data; @@ -19,10 +19,10 @@ index 626cebabd8c9ea13410a61286e902e0b0986257b..7f1ea84a768baa0d22351456600fef20 unsigned int active_handles; void* handle_queue[2]; diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c -index 04999dce36d19383fc574a6c061b7b4d0c46f6dc..f8c523cde05fcf440423e1865920b75ad9e633a2 100644 +index 949eefae339919c36775d6c1bbca5f6f9b3b6201..454bd1bd3c2c7be34b764be39962b35e4e3066f6 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c -@@ -899,8 +899,11 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { +@@ -885,8 +885,11 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { return; #endif @@ -35,7 +35,7 @@ index 04999dce36d19383fc574a6c061b7b4d0c46f6dc..f8c523cde05fcf440423e1865920b75a if (loop->watchers[w->fd] == NULL) { loop->watchers[w->fd] = w; -@@ -936,8 +939,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { +@@ -922,8 +925,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { w->events = 0; } } @@ -48,7 +48,7 @@ index 04999dce36d19383fc574a6c061b7b4d0c46f6dc..f8c523cde05fcf440423e1865920b75a } -@@ -954,6 +960,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { +@@ -940,6 +946,8 @@ 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); diff --git a/patches/node/feat_initialize_asar_support.patch b/patches/node/feat_initialize_asar_support.patch index 62b343f012d4..3f47c105a052 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/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js -index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..cef4e5086ca8160a7d715915f735963e369068b1 100644 +index 3d5e0061daa8d11a1c8c535eb0ae7179864a2d02..0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js -@@ -67,6 +67,7 @@ function prepareMainThreadExecution(expandArgv1 = false) { +@@ -70,6 +70,7 @@ function prepareMainThreadExecution(expandArgv1 = false) { assert(!CJSLoader.hasLoadedAnyUserCJSModule); loadPreloadModules(); initializeFrozenIntrinsics(); @@ -17,7 +17,7 @@ index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..cef4e5086ca8160a7d715915f735963e } function patchProcessObject(expandArgv1) { -@@ -445,6 +446,10 @@ function loadPreloadModules() { +@@ -440,6 +441,10 @@ function loadPreloadModules() { } } diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch index cdfc8e5d3d4c..3fb8f3d8b3a1 100644 --- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch +++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch @@ -8,7 +8,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 fd3c4738baea1c39f0deb265c684dd8bc384395e..1c753edfefa96d69c5de7d54078fa3136b244b52 100644 +index 7b97fbebe2deac534b3a24c807074c02b4336cf4..1e8cac3c5123698d9551835639e87a0afa7a2246 100644 --- a/common.gypi +++ b/common.gypi @@ -73,6 +73,22 @@ diff --git a/patches/node/fix_comment_out_incompatible_crypto_modules.patch b/patches/node/fix_comment_out_incompatible_crypto_modules.patch new file mode 100644 index 000000000000..feed278a1f6a --- /dev/null +++ b/patches/node/fix_comment_out_incompatible_crypto_modules.patch @@ -0,0 +1,80 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Wed, 27 May 2020 13:02:13 -0700 +Subject: fix: comment out incompatible crypto modules + +Node.js introduced some functionality in https://github.com/nodejs/node/pull/32739 +and https://github.com/nodejs/node/pull/31178 that is not currently compatible +with what's exposed through BoringSSL. I plan to upstream parts of this or +otherwise introduce shims to reduce friction. + +diff --git a/src/node_crypto.cc b/src/node_crypto.cc +index ce48e608c07ca3d9dd717f92566c71c2a77cbcbc..a144d570d21cadccbb02349dc2f4ef44f6e7d79a 100644 +--- a/src/node_crypto.cc ++++ b/src/node_crypto.cc +@@ -5142,6 +5142,7 @@ bool DiffieHellman::Init(int primeLength, int g) { + + bool DiffieHellman::Init(const char* p, int p_len, int g) { + dh_.reset(DH_new()); ++#if 0 + if (p_len <= 0) { + BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL); + return false; +@@ -5150,6 +5151,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) { + DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR); + return false; + } ++#endif + BIGNUM* bn_p = + BN_bin2bn(reinterpret_cast(p), p_len, nullptr); + BIGNUM* bn_g = BN_new(); +@@ -5165,6 +5167,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) { + + bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) { + dh_.reset(DH_new()); ++#if 0 + if (p_len <= 0) { + BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL); + return false; +@@ -5187,6 +5190,7 @@ bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) { + BN_free(bn_g); + return false; + } ++#endif + return VerifyContext(); + } + +@@ -6154,6 +6158,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig { + EVPKeyCtxPointer Setup() override { + EVPKeyPointer params; + if (prime_info_.fixed_value_) { ++#if 0 + DHPointer dh(DH_new()); + if (!dh) + return nullptr; +@@ -6170,6 +6175,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig { + params = EVPKeyPointer(EVP_PKEY_new()); + CHECK(params); + EVP_PKEY_assign_DH(params.get(), dh.release()); ++#endif + } else { + EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DH, nullptr)); + if (!param_ctx) +@@ -6177,7 +6183,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig { + + if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0) + return nullptr; +- ++#if 0 + if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(param_ctx.get(), + prime_info_.prime_size_) <= 0) + return nullptr; +@@ -6185,7 +6191,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig { + if (EVP_PKEY_CTX_set_dh_paramgen_generator(param_ctx.get(), + generator_) <= 0) + return nullptr; +- ++#endif + EVP_PKEY* raw_params = nullptr; + if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0) + return nullptr; diff --git a/patches/node/fix_don_t_create_console_window_when_creating_process.patch b/patches/node/fix_don_t_create_console_window_when_creating_process.patch index 3f8dba9c3540..d8f144b18bb8 100644 --- a/patches/node/fix_don_t_create_console_window_when_creating_process.patch +++ b/patches/node/fix_don_t_create_console_window_when_creating_process.patch @@ -6,10 +6,10 @@ Subject: fix: don't create console window when creating process This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes https://github.com/nodejs/node/pull/21316 diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c -index 9b7fdc1dc1b4e2b9e16e053d1aca36ef5221c460..e1010d1248a95a3927d6ed1a1affbb545c1d7201 100644 +index 73543c6ed987ceed517e8d1ce8135c1ad233795d..249336d0a23cf32e25c93d917ffb1626119c624f 100644 --- a/deps/uv/src/win/process.c +++ b/deps/uv/src/win/process.c -@@ -1099,6 +1099,9 @@ int uv_spawn(uv_loop_t* loop, +@@ -1098,6 +1098,9 @@ int uv_spawn(uv_loop_t* loop, process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP; } diff --git a/patches/node/fix_expose_internalcallbackscope.patch b/patches/node/fix_expose_internalcallbackscope.patch index 0d7642d3e0c1..8d3092394aab 100644 --- a/patches/node/fix_expose_internalcallbackscope.patch +++ b/patches/node/fix_expose_internalcallbackscope.patch @@ -3,13 +3,13 @@ From: deepak1556 Date: Sat, 6 Jan 2018 18:28:10 +0530 Subject: fix: expose InternalCallbackScope -This commit exposes InternalCallbackScope in order to allow us access to kAllowEmptyResource for usage https://github.com/electron/electron/blob/master/atom/common/api/atom_bindings.cc\#L108. We should look to accomplish this another way so we no longer need to do this, as in verbose mode the regular CallBack Scope doesn't swallow errors and so we can otherwise use it. +This commit exposes InternalCallbackScope in order to allow us access to its internal flags. diff --git a/src/node_internals.h b/src/node_internals.h -index 0ba13ceaea2ea2d37dcf202afa354a845f381463..97d78b4bacdbc64e03ed8eedae0995459e3cbc16 100644 +index 7ec3eac697e4b7d6160da59df709f416814e1f73..c362485dca561ed4a5210d7ac9f0e3b2a36a8d0c 100644 --- a/src/node_internals.h +++ b/src/node_internals.h -@@ -203,7 +203,7 @@ v8::MaybeLocal InternalMakeCallback( +@@ -209,7 +209,7 @@ v8::MaybeLocal InternalMakeCallback( v8::Local argv[], async_context asyncContext); diff --git a/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch b/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch index e2a44958bdc8..62ccd90aaff5 100644 --- a/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch +++ b/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch @@ -5,10 +5,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead of v8::TracingController diff --git a/src/api/environment.cc b/src/api/environment.cc -index 1df70cf6a6d44dfe61bbf346494c3d361e9aa448..68ccef87356755a8a99283d55bf5492831a46ce0 100644 +index 09d71b34581268bfe17c3182029cb3949d857d48..60d30b7eff7329c4235024c31525107216d70d7a 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -331,6 +331,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() { +@@ -358,6 +358,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() { return per_process::v8_platform.Platform(); } diff --git a/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch b/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch index 1ed5fdcc60a9..2a3fded580aa 100644 --- a/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch +++ b/patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch @@ -6,7 +6,7 @@ Subject: fix: key gen APIs are not available in BoringSSL This will make Node's key pair generation APIs fail. diff --git a/src/node_crypto.cc b/src/node_crypto.cc -index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d5d7c53ed 100644 +index 9e3c63b5ec92459a98c0f64f57b79d8732a9a25d..39f2c58657fb7315b9abb1817ccafb9cb3f64948 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -267,24 +267,14 @@ Maybe Decorate(Environment* env, Local obj, @@ -34,7 +34,7 @@ index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d V(USER) \ #define V(name) case ERR_LIB_##name: lib = #name "_"; break; -@@ -6013,6 +6003,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig { +@@ -6082,6 +6072,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig { if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0) return nullptr; @@ -42,7 +42,7 @@ index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0) return nullptr; -@@ -6023,6 +6014,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig { +@@ -6092,6 +6083,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig { return nullptr; } } @@ -51,10 +51,10 @@ index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d EVP_PKEY* raw_params = nullptr; if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0) diff --git a/src/node_crypto_common.cc b/src/node_crypto_common.cc -index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e81053fbeb21 100644 +index 3b35ee1ff7ba8a6aac6419ba6ca13ea33e7bcf42..83f4c1127081542aad2d12b9dc45f99cbd7a106d 100644 --- a/src/node_crypto_common.cc +++ b/src/node_crypto_common.cc -@@ -237,10 +237,10 @@ int UseSNIContext(const SSLPointer& ssl, SecureContext* context) { +@@ -239,10 +239,10 @@ int UseSNIContext(const SSLPointer& ssl, BaseObjectPtr context) { } const char* GetClientHelloALPN(const SSLPointer& ssl) { @@ -66,7 +66,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810 if (!SSL_client_hello_get0_ext( ssl.get(), TLSEXT_TYPE_application_layer_protocol_negotiation, -@@ -249,17 +249,18 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { +@@ -251,17 +251,18 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { rem < 2) { return nullptr; } @@ -87,7 +87,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810 if (!SSL_client_hello_get0_ext( ssl.get(), TLSEXT_TYPE_server_name, -@@ -281,6 +282,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) { +@@ -283,6 +284,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) { if (len + 2 > rem) return nullptr; return reinterpret_cast(buf + 5); @@ -96,7 +96,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810 } const char* GetServerName(SSL* ssl) { -@@ -288,7 +291,10 @@ const char* GetServerName(SSL* ssl) { +@@ -290,7 +293,10 @@ const char* GetServerName(SSL* ssl) { } bool SetGroups(SecureContext* sc, const char* groups) { @@ -107,7 +107,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810 } const char* X509ErrorCode(long err) { // NOLINT(runtime/int) -@@ -766,13 +772,13 @@ MaybeLocal GetClientHelloCiphers( +@@ -772,13 +778,13 @@ MaybeLocal GetClientHelloCiphers( Environment* env, const SSLPointer& ssl) { EscapableHandleScope scope(env->isolate()); diff --git a/patches/node/fix_remove_bad_semicolon_outside_fn.patch b/patches/node/fix_remove_bad_semicolon_outside_fn.patch new file mode 100644 index 000000000000..175e4ae04157 --- /dev/null +++ b/patches/node/fix_remove_bad_semicolon_outside_fn.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Wed, 27 May 2020 12:57:43 -0700 +Subject: fix: remove bad semicolon outside fn + +Node.js introduced a bad semicolon style in +https://github.com/nodejs/node/pull/29207. Upstreamed in +https://github.com/nodejs/node/pull/33592. + +diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc +index 107a25bc977bd38e97a2310b272e495d09847ecb..3ed390678962890d90d385cf2bca9deaca023c89 100644 +--- a/src/node_watchdog.cc ++++ b/src/node_watchdog.cc +@@ -432,4 +432,4 @@ static void Initialize(Local target, + + } // namespace node + +-NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize); ++NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize) diff --git a/patches/node/fix_use_crypto_impls_for_compat.patch b/patches/node/fix_use_crypto_impls_for_compat.patch index ba2f8e31a7c0..ed894e429b26 100644 --- a/patches/node/fix_use_crypto_impls_for_compat.patch +++ b/patches/node/fix_use_crypto_impls_for_compat.patch @@ -8,10 +8,10 @@ by using the implementations of those functions as found in the OpenSSL repo. I plan to try and upstream a version of this. diff --git a/src/node_crypto.cc b/src/node_crypto.cc -index a2f7190810552261dc66fae18acade3576ff4fe8..29f4d934623889010bf00bbde59d7710916307e4 100644 +index f81e2f789c4b3b5655073cf44700a16e5b2ec45c..ce48e608c07ca3d9dd717f92566c71c2a77cbcbc 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc -@@ -4478,7 +4478,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) { +@@ -4522,7 +4522,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) { if (base_id == EVP_PKEY_DSA) { DSA* dsa_key = EVP_PKEY_get0_DSA(pkey.get()); // Both r and s are computed mod q, so their width is limited by that of q. diff --git a/patches/node/fixme_comment_trace_event_macro.patch b/patches/node/fixme_comment_trace_event_macro.patch index 2440ef4cf534..575b4d85d1c6 100644 --- a/patches/node/fixme_comment_trace_event_macro.patch +++ b/patches/node/fixme_comment_trace_event_macro.patch @@ -7,10 +7,10 @@ This broke the build at some point. Does it still? We should probably remove this patch and find out! diff --git a/src/node_internals.h b/src/node_internals.h -index 97d78b4bacdbc64e03ed8eedae0995459e3cbc16..0279a4a8274f408049aae5464a7f4559ebe48110 100644 +index c362485dca561ed4a5210d7ac9f0e3b2a36a8d0c..b627ad3ef42835407a83b721a2f78d4128e48327 100644 --- a/src/node_internals.h +++ b/src/node_internals.h -@@ -371,10 +371,11 @@ class TraceEventScope { +@@ -375,10 +375,11 @@ class TraceEventScope { TraceEventScope(const char* category, const char* name, void* id) : category_(category), name_(name), id_(id) { diff --git a/patches/node/fixme_remove_async_id_assertion_check.patch b/patches/node/fixme_remove_async_id_assertion_check.patch index 24a02d95132b..65fcd8798443 100644 --- a/patches/node/fixme_remove_async_id_assertion_check.patch +++ b/patches/node/fixme_remove_async_id_assertion_check.patch @@ -7,7 +7,7 @@ async hooks are hella broken in Electron. This was checking that they weren't, but they are, so we just disabled the check. YOLO. diff --git a/src/api/callback.cc b/src/api/callback.cc -index 5e3fd6590332eceafad3ecf51f5f1fa84e2e50a2..a5acf1a199146e359790acd474a93d340b7738ce 100644 +index f7e7ddedfae377daa1441b0845c6828aedfc2a44..dc62f8cc1b80a1b7558ec1000ac856e9929c68a5 100644 --- a/src/api/callback.cc +++ b/src/api/callback.cc @@ -111,12 +111,14 @@ void InternalCallbackScope::Close() { diff --git a/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch b/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch index 33a2a0cacafe..625465bdca0b 100644 --- a/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch +++ b/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch @@ -9,10 +9,10 @@ this has to be done after the upgrade to the Node.js v8.7.0. in the very beginn to a native Node.js implementation of the function. diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 2a92651dd6c5a98990b0f9e996b97c3e73095d50..33f52a3c168840ea88da0e032069136e8a690830 100644 +index b1f453442bc2a35fabaa6f259091660aedad9a07..92554a374d189b3b284546b0e122940e9a175de8 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -145,6 +145,8 @@ function enrichCJSError(err) { +@@ -144,6 +144,8 @@ function enrichCJSError(err) { } function stat(filename) { diff --git a/patches/node/make_module_globalpaths_a_reference.patch b/patches/node/make_module_globalpaths_a_reference.patch index c1576c1a3f39..609fa1007274 100644 --- a/patches/node/make_module_globalpaths_a_reference.patch +++ b/patches/node/make_module_globalpaths_a_reference.patch @@ -10,10 +10,10 @@ node's module code. (cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 0a359a3d8973bc2d7cf7563972b15459a6a1d0e8..2010aae2b734bbcf9793336678a39f945e36c5be 100644 +index fc42eb033c923fcdb7eb79e6676a191be6eb1d91..a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1250,8 +1250,8 @@ Module._initPaths = function() { +@@ -1255,8 +1255,8 @@ Module._initPaths = function() { modulePaths = paths; diff --git a/patches/node/override_existing_v8_reallocate.patch b/patches/node/override_existing_v8_reallocate.patch index e007e308755f..5d757b623316 100644 --- a/patches/node/override_existing_v8_reallocate.patch +++ b/patches/node/override_existing_v8_reallocate.patch @@ -6,18 +6,18 @@ Subject: Override existing V8 Reallocate Refs https://chromium-review.googlesource.com/c/v8/v8/+/2007274. Reallocate has been implemented by V8 itself, so this function must now be overridden. This patch can be removed once the relevant version of V8 -makes its way into Node.js +makes its way into Node.js. diff --git a/src/node_internals.h b/src/node_internals.h -index 0279a4a8274f408049aae5464a7f4559ebe48110..e5d5a6497de3386c7aa70efc1f202f79d9f7567f 100644 +index b627ad3ef42835407a83b721a2f78d4128e48327..efea9db2da008be6a1a470cece9d7a04a628c1a8 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -115,7 +115,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator { - void* AllocateUninitialized(size_t size) override - { return node::UncheckedMalloc(size); } - void Free(void* data, size_t) override { free(data); } -- virtual void* Reallocate(void* data, size_t old_size, size_t size) { -+ virtual void* Reallocate(void* data, size_t old_size, size_t size) override { - return static_cast( - UncheckedRealloc(static_cast(data), size)); + void* Allocate(size_t size) override; // Defined in src/node.cc + void* AllocateUninitialized(size_t size) override; + void Free(void* data, size_t size) override; +- virtual void* Reallocate(void* data, size_t old_size, size_t size); ++ virtual void* Reallocate(void* data, size_t old_size, size_t size) override; + virtual void RegisterPointer(void* data, size_t size) { + total_mem_usage_.fetch_add(size, std::memory_order_relaxed); } diff --git a/patches/node/pass_all_globals_through_require.patch b/patches/node/pass_all_globals_through_require.patch index a9b9c64d8328..942b612eddef 100644 --- a/patches/node/pass_all_globals_through_require.patch +++ b/patches/node/pass_all_globals_through_require.patch @@ -6,10 +6,10 @@ 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 2010aae2b734bbcf9793336678a39f945e36c5be..2a92651dd6c5a98990b0f9e996b97c3e73095d50 100644 +index a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d..b1f453442bc2a35fabaa6f259091660aedad9a07 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -105,6 +105,13 @@ const { +@@ -104,6 +104,13 @@ const { CHAR_COLON } = require('internal/constants'); @@ -23,7 +23,7 @@ index 2010aae2b734bbcf9793336678a39f945e36c5be..2a92651dd6c5a98990b0f9e996b97c3e const isWindows = process.platform === 'win32'; const relativeResolveCache = ObjectCreate(null); -@@ -1128,10 +1135,12 @@ Module.prototype._compile = function(content, filename) { +@@ -1133,10 +1140,12 @@ Module.prototype._compile = function(content, filename) { if (requireDepth === 0) statCache = new Map(); if (inspectorWrapper) { result = inspectorWrapper(compiledWrapper, thisValue, exports, diff --git a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch index 49f37e911ce9..7aff139de153 100644 --- a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch +++ b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch @@ -22,7 +22,7 @@ index bb9a2b177c4304496dab1f1beaedc1ae9d9f55d9..36d06759aac57b1aa813b52c94e2168b process.config = JSONParse(internalBinding('native_module').config); diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 33f52a3c168840ea88da0e032069136e8a690830..992482525f8bdea399528f1e5673f4efa21b7246 100644 +index 92554a374d189b3b284546b0e122940e9a175de8..e478c57af873da717c00db73d6719f806280efe1 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -55,10 +55,7 @@ const assert = require('internal/assert'); @@ -37,7 +37,7 @@ index 33f52a3c168840ea88da0e032069136e8a690830..992482525f8bdea399528f1e5673f4ef const { safeGetenv } = internalBinding('credentials'); const { makeRequireFunction, -@@ -145,14 +142,12 @@ function enrichCJSError(err) { +@@ -144,14 +141,12 @@ function enrichCJSError(err) { } function stat(filename) { @@ -53,7 +53,7 @@ index 33f52a3c168840ea88da0e032069136e8a690830..992482525f8bdea399528f1e5673f4ef if (statCache !== null) statCache.set(filename, result); return result; } -@@ -258,7 +253,7 @@ function readPackage(requestPath) { +@@ -257,7 +252,7 @@ function readPackage(requestPath) { const existing = packageJsonCache.get(jsonPath); if (existing !== undefined) return existing; diff --git a/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch b/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch index 4bf8fd7483d0..0aad9532955d 100644 --- a/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch +++ b/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch @@ -7,7 +7,7 @@ Subject: refactor: TransferrableModule is deprecated, use CompiledWasmModule This is already present in Node.js v14 and can be removed when we upgrade. diff --git a/src/node_messaging.cc b/src/node_messaging.cc -index c7c46063731a5b49366d8e8702b625162b361471..a8cfbec2f5bf2387312237114ab5eb058561b898 100644 +index fa7132d7b43a3d9b04d4e830357e661a860916b3..8e8f458ef9f557f84b2a92ea20d8c9470b4a9cba 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -57,7 +57,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { diff --git a/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch b/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch index ba852b9da83c..b80cffb63aa4 100644 --- a/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch +++ b/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch @@ -8,10 +8,10 @@ This is already present in Node.js v14 and can be removed when we upgrade. CL: https://chromium-review.googlesource.com/c/v8/v8/+/1868620 diff --git a/src/node_platform.h b/src/node_platform.h -index bebd61b0c22644881455105eeb795e4fdbcd5ae9..df7b764237ccad425d8833c9ca746170e2c838a9 100644 +index 533ae1bcca824837aca327d4ff8f122da12d94f0..3c855afeb4019adfb5389721357abe3cd620a01c 100644 --- a/src/node_platform.h +++ b/src/node_platform.h -@@ -147,14 +147,6 @@ class NodePlatform : public MultiIsolatePlatform { +@@ -148,14 +148,6 @@ class NodePlatform : public MultiIsolatePlatform { void CallOnWorkerThread(std::unique_ptr task) override; void CallDelayedOnWorkerThread(std::unique_ptr task, double delay_in_seconds) override; diff --git a/patches/node/revert_crypto_add_oaeplabel_option.patch b/patches/node/revert_crypto_add_oaeplabel_option.patch index 65178ed9fbf6..c65374ec2741 100644 --- a/patches/node/revert_crypto_add_oaeplabel_option.patch +++ b/patches/node/revert_crypto_add_oaeplabel_option.patch @@ -8,10 +8,10 @@ The BoringSSL incompatibilities (OPENSSL_memdup) will be shimmed in and this sho be removed when the associated update is rolled into Chromium. diff --git a/src/node_crypto.cc b/src/node_crypto.cc -index 73c18d1b911bb7cf731e31e74957319d5d7c53ed..a2f7190810552261dc66fae18acade3576ff4fe8 100644 +index 39f2c58657fb7315b9abb1817ccafb9cb3f64948..f81e2f789c4b3b5655073cf44700a16e5b2ec45c 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc -@@ -4966,18 +4966,6 @@ bool PublicKeyCipher::Cipher(Environment* env, +@@ -5011,18 +5011,6 @@ bool PublicKeyCipher::Cipher(Environment* env, return false; } diff --git a/patches/node/win_use_rtlgenrandom_from_advapi32_dll_directly.patch b/patches/node/win_use_rtlgenrandom_from_advapi32_dll_directly.patch deleted file mode 100644 index 3dacac108deb..000000000000 --- a/patches/node/win_use_rtlgenrandom_from_advapi32_dll_directly.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Samuel Attard -Date: Tue, 9 Jun 2020 11:23:55 -0700 -Subject: win: use RtlGenRandom from advapi32.dll directly - -At least two people have reported that `LoadLibrary("advapi32.dll")` -fails in some configurations. - -Libuv already links against advapi32.dll so let's sidestep the issue -by linking to `RtlGenRandom()` directly instead of looking it up at -runtime. - -Fixes: #2759 -PR-URL: #2762 -Reviewed-By: Bartosz Sosnowski -Reviewed-By: Colin Ihrig -Reviewed-By: Jameson Nash - -Cherry-Pick: https://github.com/libuv/libuv/commit/335e8a6d128646e5a19d39dfc677f5a5a555f7cc - -diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c -index 4de638f5971c35aaeb9fe5e2ff67a806bbc54baf..34a898bfa425b6ba716a681541b602f3a191b258 100644 ---- a/deps/uv/src/win/util.c -+++ b/deps/uv/src/win/util.c -@@ -63,6 +63,9 @@ - /* Maximum environment variable size, including the terminating null */ - #define MAX_ENV_VAR_LENGTH 32767 - -+/* A RtlGenRandom() by any other name... */ -+extern BOOLEAN NTAPI SystemFunction036(PVOID Buffer, ULONG BufferLength); -+ - /* Cached copy of the process title, plus a mutex guarding it. */ - static char *process_title; - static CRITICAL_SECTION process_title_lock; -@@ -1862,13 +1865,10 @@ int uv_gettimeofday(uv_timeval64_t* tv) { - } - - int uv__random_rtlgenrandom(void* buf, size_t buflen) { -- if (pRtlGenRandom == NULL) -- return UV_ENOSYS; -- - if (buflen == 0) - return 0; - -- if (pRtlGenRandom(buf, buflen) == FALSE) -+ if (SystemFunction036(buf, buflen) == FALSE) - return UV_EIO; - - return 0; -diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c -index 85a9de8a2295ec3250f9ae41f5ef6dbe72dc2a8a..bb86ec8ceac8ba3fccd02b292aca7ddfab38e187 100644 ---- a/deps/uv/src/win/winapi.c -+++ b/deps/uv/src/win/winapi.c -@@ -36,9 +36,6 @@ sNtQueryDirectoryFile pNtQueryDirectoryFile; - sNtQuerySystemInformation pNtQuerySystemInformation; - sNtQueryInformationProcess pNtQueryInformationProcess; - --/* Advapi32 function pointers */ --sRtlGenRandom pRtlGenRandom; -- - /* Kernel32 function pointers */ - sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; - -@@ -54,7 +51,6 @@ void uv_winapi_init(void) { - HMODULE powrprof_module; - HMODULE user32_module; - HMODULE kernel32_module; -- HMODULE advapi32_module; - - ntdll_module = GetModuleHandleA("ntdll.dll"); - if (ntdll_module == NULL) { -@@ -138,12 +134,4 @@ void uv_winapi_init(void) { - pSetWinEventHook = (sSetWinEventHook) - GetProcAddress(user32_module, "SetWinEventHook"); - } -- -- advapi32_module = GetModuleHandleA("advapi32.dll"); -- if (advapi32_module == NULL) { -- uv_fatal_error(GetLastError(), "GetModuleHandleA"); -- } -- -- pRtlGenRandom = -- (sRtlGenRandom) GetProcAddress(advapi32_module, "SystemFunction036"); - } -diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h -index fcc70652a9aedb72f92ce78b8ee21cea8933b905..322a212dd73c19378b7abda01c5b60a93cb8e1d5 100644 ---- a/deps/uv/src/win/winapi.h -+++ b/deps/uv/src/win/winapi.h -@@ -4589,11 +4589,6 @@ typedef NTSTATUS (NTAPI *sNtQueryInformationProcess) - ULONG Length, - PULONG ReturnLength); - --/* -- * Advapi32 headers -- */ --typedef BOOLEAN (WINAPI *sRtlGenRandom)(PVOID Buffer, ULONG BufferLength); -- - /* - * Kernel32 headers - */ -@@ -4736,9 +4731,6 @@ extern sNtQueryDirectoryFile pNtQueryDirectoryFile; - extern sNtQuerySystemInformation pNtQuerySystemInformation; - extern sNtQueryInformationProcess pNtQueryInformationProcess; - --/* Advapi32 function pointers */ --extern sRtlGenRandom pRtlGenRandom; -- - /* Kernel32 function pointers */ - extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; - diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 0e234b52f1e9..42f74c25c8d9 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -160,11 +160,20 @@ "parallel/test-worker-message-port", "parallel/test-worker-message-port-transfer-duplicate", "parallel/test-worker-message-port-transfer-target", + "parallel/test-worker-workerdata-messageport", "parallel/test-worker-sharedarraybuffer-from-worker-thread", "parallel/test-worker-stdio", "parallel/test-zlib-unused-weak", "pseudo-tty/test-set-raw-mode-reset-process-exit", "pseudo-tty/test-set-raw-mode-reset-signal", + "report/test-report-getreport", + "report/test-report-signal", + "report/test-report-uncaught-exception", + "report/test-report-uncaught-exception-compat", + "report/test-report-writereport", + "report/test-report-worker", + "report/test-report-uv-handles", + "report/test-report-fatal-error", "sequential/test-cpu-prof-default", "sequential/test-cpu-prof-dir-absolute", "sequential/test-cpu-prof-dir-and-name", diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index 2e42ee18e99c..dfeabf2430dc 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -251,9 +251,8 @@ int NodeMain(int argc, char* argv[]) { { v8::HandleScope scope(isolate); node::InternalCallbackScope callback_scope( - env, v8::Local(), {1, 0}, - node::InternalCallbackScope::kAllowEmptyResource | - node::InternalCallbackScope::kSkipAsyncHooks); + env, v8::Object::New(isolate), {1, 0}, + node::InternalCallbackScope::kSkipAsyncHooks); node::LoadEnvironment(env); } diff --git a/shell/browser/microtasks_runner.cc b/shell/browser/microtasks_runner.cc index 94af2a9f66bc..f1a0d115b382 100644 --- a/shell/browser/microtasks_runner.cc +++ b/shell/browser/microtasks_runner.cc @@ -30,9 +30,10 @@ void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) { // handle the checkpoint in the browser process. { auto* node_env = electron::ElectronBrowserMainParts::Get()->node_env(); + v8::HandleScope scope(isolate_); node::InternalCallbackScope microtasks_scope( - node_env->env(), v8::Local(), {0, 0}, - node::InternalCallbackScope::kAllowEmptyResource); + node_env->env(), v8::Object::New(isolate_), {0, 0}, + node::InternalCallbackScope::kNoFlags); } } diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index 9f43a874a352..02cab4ddc51e 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -132,9 +132,10 @@ void ElectronBindings::OnCallNextTick(uv_async_t* handle) { node::Environment* env = *it; gin_helper::Locker locker(env->isolate()); v8::Context::Scope context_scope(env->context()); - node::InternalCallbackScope scope( - env, v8::Local(), {0, 0}, - node::InternalCallbackScope::kAllowEmptyResource); + v8::HandleScope handle_scope(env->isolate()); + node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()), + {0, 0}, + node::InternalCallbackScope::kNoFlags); } self->pending_next_ticks_.clear(); diff --git a/vsts-arm-test-steps.yml b/vsts-arm-test-steps.yml index e5a4087af144..1f93abf20ea4 100644 --- a/vsts-arm-test-steps.yml +++ b/vsts-arm-test-steps.yml @@ -73,6 +73,9 @@ steps: sudo gdk-pixbuf-query-loaders --update-cache cd src export ELECTRON_OUT_DIR=Default + unset ELECTRON_DISABLE_SANDBOX + sudo chown root out/Default/chrome-sandbox + sudo chmod 4755 out/Default/chrome-sandbox (cd electron && node script/yarn test -- --enable-logging) displayName: 'Run Electron tests' timeoutInMinutes: 20 diff --git a/vsts-arm32v7.yml b/vsts-arm32v7.yml index 376a07eac487..e9371511e250 100644 --- a/vsts-arm32v7.yml +++ b/vsts-arm32v7.yml @@ -2,7 +2,7 @@ resources: containers: - container: arm32v7-test-container image: electronjs/build:arm32v7-697b894f36d127155e020f4e8ad4b2e5f6a09613 - options: --shm-size 128m + options: --shm-size 128m --cap-add SYS_ADMIN jobs: - job: Test_Arm32v7 diff --git a/vsts-arm64v8.yml b/vsts-arm64v8.yml index 767391fbb609..a134eb93386d 100644 --- a/vsts-arm64v8.yml +++ b/vsts-arm64v8.yml @@ -2,7 +2,7 @@ resources: containers: - container: arm64v8-test-container image: electronjs/build:arm64v8-697b894f36d127155e020f4e8ad4b2e5f6a09613 - options: --shm-size 128m + options: --shm-size 128m --cap-add SYS_ADMIN jobs: - job: Test_Arm64