Skip to content

Commit

Permalink
chore: bump node to v12.18.0 (master) (electron#23789)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
2 people authored and sentialx committed Jul 11, 2020
1 parent 293affd commit ec96213
Show file tree
Hide file tree
Showing 41 changed files with 266 additions and 314 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ vars = {
'chromium_version':
'ff6c4f4b826d66c2e32380bf5d1eb5e1fe37faef',
'node_version':
'v12.16.3',
'v12.18.0',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',

Expand Down
1 change: 1 addition & 0 deletions patches/common/zlib/.patches
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix_export_zlib_symbols.patch
22 changes: 22 additions & 0 deletions patches/common/zlib/fix_export_zlib_symbols.patch
Original file line number Diff line number Diff line change
@@ -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).
3 changes: 2 additions & 1 deletion patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion patches/node/avoid_calling_deprecated_method.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
114 changes: 24 additions & 90 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ 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")
+
+declare_args() {
+ # 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
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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" ]
+}
Expand All @@ -862,7 +846,7 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71
+ deps = [ "../../deps/uv" ]
+
+ public_configs = [ ":uvwasi_config" ]
+
+
+ cflags_c = []
+ if (!is_win) {
+ cflags_c += [ "-fvisibility=hidden" ]
Expand All @@ -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
+{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 @@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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;

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

Expand All @@ -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 @@
Expand All @@ -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) {
Expand Down

0 comments on commit ec96213

Please sign in to comment.