chore: bump node to v12.18.0 (master) (#23789)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Electron Bot 2020-06-17 15:57:12 -07:00 коммит произвёл GitHub
Родитель 4e66f1b2c6
Коммит b665eb6d43
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
41 изменённых файлов: 266 добавлений и 314 удалений

2
DEPS
Просмотреть файл

@ -15,7 +15,7 @@ vars = {
'chromium_version':
'ff6c4f4b826d66c2e32380bf5d1eb5e1fe37faef',
'node_version':
'v12.16.3',
'v12.18.0',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',

Просмотреть файл

@ -0,0 +1 @@
fix_export_zlib_symbols.patch

Просмотреть файл

@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
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).

Просмотреть файл

@ -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

Просмотреть файл

@ -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,

Просмотреть файл

@ -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 @@

Просмотреть файл

@ -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 @@

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<std::string>& exec_argv();
inline const std::vector<std::string>& argv();
@@ -1266,6 +1275,9 @@ class Environment : public MemoryRetainer {
@@ -1270,6 +1279,9 @@ class Environment : public MemoryRetainer {
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
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<Value>& args) {
@@ -462,10 +463,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
if (mp != nullptr) {
if (mp->nm_context_register_func == nullptr) {

Просмотреть файл

@ -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<Value> PrepareStackTraceCallback(Local<Context> context,
@@ -78,15 +77,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> 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<void*>()(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<uv_handle_t*>(&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<BaseObject*>(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<worker::Worker*> sub_worker_contexts_;

Просмотреть файл

@ -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 @@
}],
],
}],

Просмотреть файл

@ -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<Value>& args) {
@@ -606,6 +606,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(exports);
}

Просмотреть файл

@ -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<Value> Environment::RunBootstrapping() {
@@ -339,6 +342,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
CHECK(!has_run_bootstrapping_code());
@ -76,7 +68,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2
if (BootstrapInternalLoaders().IsEmpty()) {
return MaybeLocal<Value>();
}
@@ -726,7 +737,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
@@ -735,7 +745,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* 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<std::string>* argv,
// used in diagnostic reports.
@@ -769,6 +781,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* 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<std::string>* argv,
@@ -813,6 +827,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
}
per_process::metadata.versions.InitializeIntlVersions();
#endif

Просмотреть файл

@ -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);

Просмотреть файл

@ -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() {
}
}

Просмотреть файл

@ -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 @@

Просмотреть файл

@ -0,0 +1,80 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
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<const unsigned char*>(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;

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -3,13 +3,13 @@ From: deepak1556 <hop2deep@gmail.com>
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<v8::Value> InternalMakeCallback(
@@ -209,7 +209,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
v8::Local<v8::Value> argv[],
async_context asyncContext);

Просмотреть файл

@ -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();
}

Просмотреть файл

@ -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<bool> Decorate(Environment* env, Local<Object> 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<SecureContext> 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<const char*>(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<Array> GetClientHelloCiphers(
@@ -772,13 +778,13 @@ MaybeLocal<Array> GetClientHelloCiphers(
Environment* env,
const SSLPointer& ssl) {
EscapableHandleScope scope(env->isolate());

Просмотреть файл

@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
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<Object> target,
} // namespace node
-NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize);
+NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize)

Просмотреть файл

@ -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.

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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() {

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<void*>(
UncheckedRealloc<char>(static_cast<char*>(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);
}

Просмотреть файл

@ -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,

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<v8::Task> task) override;
void CallDelayedOnWorkerThread(std::unique_ptr<v8::Task> task,
double delay_in_seconds) override;

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -1,110 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
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 <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
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;

Просмотреть файл

@ -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",

Просмотреть файл

@ -251,9 +251,8 @@ int NodeMain(int argc, char* argv[]) {
{
v8::HandleScope scope(isolate);
node::InternalCallbackScope callback_scope(
env, v8::Local<v8::Object>(), {1, 0},
node::InternalCallbackScope::kAllowEmptyResource |
node::InternalCallbackScope::kSkipAsyncHooks);
env, v8::Object::New(isolate), {1, 0},
node::InternalCallbackScope::kSkipAsyncHooks);
node::LoadEnvironment(env);
}

Просмотреть файл

@ -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<v8::Object>(), {0, 0},
node::InternalCallbackScope::kAllowEmptyResource);
node_env->env(), v8::Object::New(isolate_), {0, 0},
node::InternalCallbackScope::kNoFlags);
}
}

Просмотреть файл

@ -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<v8::Object>(), {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();

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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