Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump node to v12.18.3 (master) #24707

Merged
merged 5 commits into from Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -16,7 +16,7 @@ vars = {
'chromium_version':
'93a6ebbe22f1a093e6a0cb5e72ba78990fe39824',
'node_version':
'v12.18.2',
'v12.18.3',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
'squirrel.mac_version':
Expand Down
11 changes: 6 additions & 5 deletions lib/asar/fs-wrapper.ts
Expand Up @@ -675,23 +675,24 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
const { asarPath, filePath } = pathInfo;

const archive = getOrCreateArchive(asarPath);
if (!archive) return;
if (!archive) return [];

const info = archive.getFileInfo(filePath);
if (!info) return;
if (info.size === 0) return '';
if (!info) return [];
if (info.size === 0) return ['', false];
if (info.unpacked) {
const realPath = archive.copyFileOut(filePath);
return fs.readFileSync(realPath, { encoding: 'utf8' });
}

const buffer = Buffer.alloc(info.size);
const fd = archive.getFd();
if (!(fd >= 0)) return;
if (!(fd >= 0)) return [];

logASARAccess(asarPath, filePath, info.offset);
fs.readSync(fd, buffer, 0, info.size, info.offset);
return buffer.toString('utf8');
const str = buffer.toString('utf8');
return [str, str.length > 0];
};

const { internalModuleStat } = internalBinding('fs');
Expand Down
2 changes: 0 additions & 2 deletions patches/node/.patches
Expand Up @@ -35,9 +35,7 @@ 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
fix_remove_bad_semicolon_outside_fn.patch
fix_comment_out_incompatible_crypto_modules.patch
test_account_for_non-node_basename.patch
lib_src_switch_buffer_kmaxlength_to_size_t.patch
update_tests_after_increasing_typed_array_size.patch
darwin_work_around_clock_jumping_back_in_time.patch
Expand Down
11 changes: 6 additions & 5 deletions patches/node/build_add_gn_build_files.patch
Expand Up @@ -866,10 +866,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612afdc6d9e1a
index 0000000000000000000000000000000000000000..964255d66b8c77ccd919853c8fceb53789756255
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,518 @@
@@ -0,0 +1,519 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
Expand Down Expand Up @@ -926,6 +926,7 @@ index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612af
+ {
+ "dest_dir": "include/node//",
+ "files": [
+ "//v8/include/v8-cppgc.h",
+ "//v8/include/v8-fast-api-calls.h",
+ "//v8/include/v8-internal.h",
+ "//v8/include/v8-platform.h",
Expand Down Expand Up @@ -1105,6 +1106,7 @@ index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612af
+ "lib/internal/main/run_third_party_main.js",
+ "lib/internal/main/worker_thread.js",
+ "lib/internal/modules/run_main.js",
+ "lib/internal/modules/package_json_reader.js",
+ "lib/internal/modules/cjs/helpers.js",
+ "lib/internal/modules/cjs/loader.js",
+ "lib/internal/modules/esm/loader.js",
Expand Down Expand Up @@ -1231,7 +1233,6 @@ index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612af
+ "src/node_contextify.cc",
+ "src/node_credentials.cc",
+ "src/node_dir.cc",
+ "src/node_domain.cc",
+ "src/node_env_var.cc",
+ "src/node_errors.cc",
+ "src/node_file.cc",
Expand Down Expand Up @@ -1594,7 +1595,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 a43e451ab0cd5f2bc24453d5821deb380d2ab6d0..190479619f188bd05d1faac4696670fe18425a53 100644
index 9252d51555f0e1bf0957bc4f8bc6e399c1ac6c23..431dd57a7dddc7476a179a5f30ce9e66814006ec 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down Expand Up @@ -1750,7 +1751,7 @@ index 655802980a6ea94d1d4ca1dc63c8c8e905fbb83a..ab1a18a215cb7393310324c6dbcacc66
if 'false' == variables.get('node_shared_libuv'):
subdir_files('deps/uv/include', 'include/node/', action)
diff --git a/tools/js2c.py b/tools/js2c.py
index 4594694a2cab0d878d86127a72714ed60c251b6e..9e9883129bed62c591d23f71d139514c5034ac8d 100755
index 195e6a6189a98916bcfb7abb1b73595b8bc8eb38..d5109fcae5542730623f5ec3ca244ec0973109f2 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -130,6 +130,14 @@ def NormalizeFileName(filename):
Expand Down
Expand Up @@ -14,10 +14,10 @@ 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 1b916d645d863929710ce5e4e930ec72fb426844..6d39a8858e093199fb935b68ff84388d48d6c35e 100644
index 7362207412efa49bddfab4e32a64c7e07cf29074..acd9afa62d3aa1b01ce54f189a7261e7e61aa60d 100644
--- a/src/node_native_module.cc
+++ b/src/node_native_module.cc
@@ -23,6 +23,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
@@ -20,6 +20,7 @@ NativeModuleLoader NativeModuleLoader::instance_;

NativeModuleLoader::NativeModuleLoader() : config_(GetConfig()) {
LoadJavaScriptSource();
Expand All @@ -38,7 +38,7 @@ index c0bce3bce42c848d63a10147ef483c9d4465f5ce..7f296e459d46b4cda51baf9887df060f

bool Exists(const char* id);
diff --git a/tools/js2c.py b/tools/js2c.py
index 9e9883129bed62c591d23f71d139514c5034ac8d..ad073bd7f023c8436985f177011a7d29829098b4 100755
index d5109fcae5542730623f5ec3ca244ec0973109f2..8537f7fd50b0441307f91cad3bf9f730c2cb8cdf 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -56,13 +56,15 @@ namespace native_module {{
Expand Down Expand Up @@ -118,7 +118,7 @@ index 9e9883129bed62c591d23f71d139514c5034ac8d..ad073bd7f023c8436985f177011a7d29
write_if_chaged(out, target)


@@ -208,17 +223,21 @@ def main():
@@ -209,17 +224,21 @@ def main():
)
parser.add_argument('--target', help='output file')
parser.add_argument('--verbose', action='store_true', help='output file')
Expand Down
Expand Up @@ -23,10 +23,10 @@ index 0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc..b4a0f71af5853f427a10449b52509052

// 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 e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19e11526c3 100644
index 7d08fb05e9a0abeb82d416891968b23002dc3685..1f6f5e0cee36fb2a07963264f513a930c349b8fa 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1109,6 +1109,13 @@ Module.prototype._compile = function(content, filename) {
@@ -1111,6 +1111,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.
Expand All @@ -41,7 +41,7 @@ index e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19
try {
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
diff --git a/src/env.h b/src/env.h
index 6de5ba9b192dd1ec23afe7a7736373acb59a6c4e..b6e02a2910cd8fe5ff3a17d6e1a98b937323ae3a 100644
index d22b579b25ce4e6af8ec042e282e94248ea14162..67cefbe35f390ba25b49e422d10bca8b423a49a8 100644
--- a/src/env.h
+++ b/src/env.h
@@ -890,6 +890,15 @@ class Environment : public MemoryRetainer {
Expand All @@ -60,7 +60,7 @@ index 6de5ba9b192dd1ec23afe7a7736373acb59a6c4e..b6e02a2910cd8fe5ff3a17d6e1a98b93
void InitializeLibuv(bool start_profiler_idle_notifier);
inline const std::vector<std::string>& exec_argv();
inline const std::vector<std::string>& argv();
@@ -1273,6 +1282,9 @@ class Environment : public MemoryRetainer {
@@ -1271,6 +1280,9 @@ class Environment : public MemoryRetainer {
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
const char* errmsg);

Expand All @@ -71,7 +71,7 @@ index 6de5ba9b192dd1ec23afe7a7736373acb59a6c4e..b6e02a2910cd8fe5ff3a17d6e1a98b93
v8::Isolate* const isolate_;
IsolateData* const isolate_data_;
diff --git a/src/node_binding.cc b/src/node_binding.cc
index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca2179b4a0 100644
index 5291858bb164a262ca1d69d2582e037aeab23d55..a9ce41fbba4e8b0c4704c1d7795308ce18916739 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -3,6 +3,7 @@
Expand All @@ -82,7 +82,7 @@ index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca
#include "util.h"

#if HAVE_OPENSSL
@@ -462,10 +463,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
@@ -461,10 +462,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {

if (mp != nullptr) {
if (mp->nm_context_register_func == nullptr) {
Expand Down
Expand Up @@ -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 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea463070456c77 100644
index e2aa9c821de685a022fd78935399b7d219468403..2bfba8a011c2b902932e6b1714bbb55b945cd96d 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -12,7 +12,6 @@ using errors::TryCatchScope;
Expand All @@ -16,7 +16,7 @@ index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea4630
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
@@ -78,15 +77,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
@@ -72,15 +71,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
return result;
}

Expand All @@ -32,7 +32,7 @@ index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea4630
void* NodeArrayBufferAllocator::Allocate(size_t size) {
void* ret;
if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers)
@@ -255,11 +245,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
@@ -249,11 +239,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
s.promise_reject_callback : task_queue::PromiseRejectCallback;
isolate->SetPromiseRejectCallback(promise_reject_cb);

Expand Down Expand Up @@ -62,7 +62,7 @@ index c6ef9dc13ab6f1d1a778871a62a0a98a01d84ec6..222555831aa1bf0b7b29b4b46e235c98
const CleanupHookCallback& cb) const {
return std::hash<void*>()(cb.arg_);
diff --git a/src/env.cc b/src/env.cc
index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66731d9dde 100644
index 18788e4ceaf208c13704c9c43f017bb1b6dfb0b6..ee76d5889e5672716ac2f0c586f1ddc47fa56be7 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -30,7 +30,6 @@ using v8::ArrayBuffer;
Expand All @@ -73,15 +73,15 @@ index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66
using v8::Function;
using v8::FunctionTemplate;
using v8::HandleScope;
@@ -494,7 +493,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) {
@@ -487,7 +486,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) {
[](uv_async_t* async) {
Environment* env = ContainerOf(
&Environment::task_queues_async_, async);
- env->CleanupFinalizationGroups();
env->RunAndClearNativeImmediates();
});
uv_unref(reinterpret_cast<uv_handle_t*>(&idle_prepare_handle_));
@@ -1121,25 +1119,6 @@ void Environment::RunWeakRefCleanup() {
@@ -1085,25 +1083,6 @@ void Environment::RunWeakRefCleanup() {
isolate()->ClearKeptObjects();
}

Expand All @@ -108,10 +108,10 @@ index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66
void BaseObject::DeleteMe(void* data) {
BaseObject* self = static_cast<BaseObject*>(data);
diff --git a/src/env.h b/src/env.h
index b6e02a2910cd8fe5ff3a17d6e1a98b937323ae3a..c1966a9f55126bdd65d8c9d529d934977bb4ad65 100644
index 67cefbe35f390ba25b49e422d10bca8b423a49a8..9420bdf3f71e2df1011ddd7e583071f5c99beac8 100644
--- a/src/env.h
+++ b/src/env.h
@@ -1132,9 +1132,7 @@ class Environment : public MemoryRetainer {
@@ -1130,9 +1130,7 @@ class Environment : public MemoryRetainer {
void AtExit(void (*cb)(void* arg), void* arg);
void RunAtExitCallbacks();

Expand All @@ -121,7 +121,7 @@ index b6e02a2910cd8fe5ff3a17d6e1a98b937323ae3a..c1966a9f55126bdd65d8c9d529d93497

// Strings and private symbols are shared across shared contexts
// The getters simply proxy to the per-isolate primitive.
@@ -1357,8 +1355,6 @@ class Environment : public MemoryRetainer {
@@ -1355,8 +1353,6 @@ class Environment : public MemoryRetainer {
uint64_t thread_id_;
std::unordered_set<worker::Worker*> sub_worker_contexts_;

Expand Down
4 changes: 2 additions & 2 deletions patches/node/expose_get_builtin_module_function.patch
Expand Up @@ -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 91ae3530d09b162c910eef4199d89c33c9feb379..565a3fff85a25ef25ccf5c74d2ade7f5a6994b05 100644
index 0b5f6cfa038369be758e3b0857ee6fa594358b58..5291858bb164a262ca1d69d2582e037aeab23d55 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -606,6 +606,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
@@ -605,6 +605,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(exports);
}

Expand Down
Expand Up @@ -24,7 +24,7 @@ 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/node.cc b/src/node.cc
index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a4928f36b 100644
index 728785d5d2773df68a891a4c81e7b0ebfa6021bb..15abe45edb39597d4fcc686cca4d79314090fa6f 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -122,6 +122,8 @@ using v8::Undefined;
Expand All @@ -36,7 +36,7 @@ index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a
namespace per_process {

// node_revert.h
@@ -733,7 +735,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
@@ -736,7 +738,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
binding::RegisterBuiltinModules();

// Make inherited handles noninheritable.
Expand All @@ -47,7 +47,7 @@ index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a

// Cache the original command line to be
// used in diagnostic reports.
@@ -767,6 +771,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
@@ -770,6 +774,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
if (exit_code != 0) return exit_code;
}
#endif
Expand All @@ -56,7 +56,7 @@ index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a

const int exit_code = ProcessGlobalArgs(argv,
exec_argv,
@@ -811,6 +817,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
@@ -814,6 +820,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
}
per_process::metadata.versions.InitializeIntlVersions();
#endif
Expand Down
Expand Up @@ -9,10 +9,10 @@ We need to use the one Blink already provides, and so we need to
slightly augment IsolateSettings to allow for that.

diff --git a/src/api/environment.cc b/src/api/environment.cc
index 21980987644c6e83029157785dea463070456c77..20d9f91dcf6b5def05a706cf3389d64e9edbcf3e 100644
index 2bfba8a011c2b902932e6b1714bbb55b945cd96d..28851b8a8f8bdd6dec0f54c62f79fd75a3be08ed 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -241,9 +241,11 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
@@ -235,9 +235,11 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
s.allow_wasm_code_generation_callback : AllowWasmCodeGenerationCallback;
isolate->SetAllowWasmCodeGenerationCallback(allow_wasm_codegen_cb);

Expand Down
6 changes: 3 additions & 3 deletions patches/node/fix_build_and_expose_inspector_agent.patch
Expand Up @@ -6,10 +6,10 @@ Subject: fix: build and expose inspector agent
Node inspector initialization happens in a different start-up function in node.cc, which we don't call in Electron. This allows for us to use the inspector agent in electron/atom/browser/node_debugger.cc

diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index 94433b75d0fdb2ef902e20a60288995fcbf2bbac..3e865357f409470f15ed29a3f87b717812637c37 100644
index 7712a62d7cbeb0975f00877be36b55da150f1459..1e990059198de3fedc912bfbd5eb6eae8e5c3eea 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -222,7 +222,7 @@ const int CONTEXT_GROUP_ID = 1;
@@ -220,7 +220,7 @@ const int CONTEXT_GROUP_ID = 1;

std::string GetWorkerLabel(node::Environment* env) {
std::ostringstream result;
Expand All @@ -18,7 +18,7 @@ index 94433b75d0fdb2ef902e20a60288995fcbf2bbac..3e865357f409470f15ed29a3f87b7178
return result.str();
}

@@ -470,7 +470,7 @@ class NodeInspectorClient : public V8InspectorClient {
@@ -468,7 +468,7 @@ class NodeInspectorClient : public V8InspectorClient {
client_ = V8Inspector::create(env->isolate(), this);
// TODO(bnoordhuis) Make name configurable from src/node.cc.
std::string name =
Expand Down