Skip to content

Commit b665eb6

Browse files
chore: bump node to v12.18.0 (master) (electron#23789)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
1 parent 4e66f1b commit b665eb6

File tree

41 files changed

+266
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+266
-314
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ vars = {
1515
'chromium_version':
1616
'ff6c4f4b826d66c2e32380bf5d1eb5e1fe37faef',
1717
'node_version':
18-
'v12.16.3',
18+
'v12.18.0',
1919
'nan_version':
2020
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
2121

patches/common/zlib/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix_export_zlib_symbols.patch
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Shelley Vohr <shelley.vohr@gmail.com>
3+
Date: Mon, 1 Jun 2020 15:30:47 -0800
4+
Subject: fix: export zlib symbols
5+
6+
This patch sets ZLIB_DLL so that we properly export zlib symbols.
7+
8+
diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn
9+
index aeff252d66abe1797154b975d3b98d02cab6f4f6..5c34134486b30ae650aab93abb8da38b7aa4fe13 100644
10+
--- a/third_party/zlib/BUILD.gn
11+
+++ b/third_party/zlib/BUILD.gn
12+
@@ -272,6 +272,10 @@ component("zlib") {
13+
defines = []
14+
deps = []
15+
16+
+ if (is_win) {
17+
+ defines += [ "ZLIB_DLL" ]
18+
+ }
19+
+
20+
if (!use_x86_x64_optimizations && !use_arm_neon_optimizations) {
21+
# Apparently android_cronet bot builds with NEON disabled and
22+
# we also should disable optimizations for iOS@x86 (a.k.a. simulator).

patches/node/.patches

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch
3535
weakrefs_split_out_finalizationregistry_cleanupsome.patch
3636
fix_window_c-ares_incompatibilities.patch
3737
chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch
38-
win_use_rtlgenrandom_from_advapi32_dll_directly.patch
38+
fix_remove_bad_semicolon_outside_fn.patch
39+
fix_comment_out_incompatible_crypto_modules.patch

patches/node/avoid_calling_deprecated_method.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ V8 v8.1.
99
This is already present in Node.js v14 and can be removed when we upgrade.
1010

1111
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
12-
index a2d185c4167a75e227cd4b2abbf5c5abc7e16acb..e918ed9d12e9fb1d13b2fc05a98cab099fb71a68 100644
12+
index bcdcd19b261e8815e3c0c0f150f2eda72ef47cf5..86fb822dd5bfa9da7767418e6c6f206f8e96ca73 100644
1313
--- a/src/node_serdes.cc
1414
+++ b/src/node_serdes.cc
1515
@@ -286,7 +286,6 @@ DeserializerContext::DeserializerContext(Environment* env,

patches/node/build_add_gn_build_files.patch

Lines changed: 24 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,17 @@ This adds GN build files for Node, so we don't have to build with GYP.
77

88
diff --git a/BUILD.gn b/BUILD.gn
99
new file mode 100644
10-
index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e30c77dd71
10+
index 0000000000000000000000000000000000000000..b5ea846fd9fd46f34dd4260b67282186fddbc0be
1111
--- /dev/null
1212
+++ b/BUILD.gn
13-
@@ -0,0 +1,376 @@
13+
@@ -0,0 +1,360 @@
1414
+import("//electron/build/asar.gni")
1515
+import("//v8/gni/v8.gni")
1616
+
1717
+declare_args() {
1818
+ # Enable the V8 inspector protocol for use with node.
1919
+ node_enable_inspector = true
2020
+
21-
+ # Enable diagnostic reporting withing Node.js
22-
+ node_report = true
23-
+
2421
+ # Build node with SSL support.
2522
+ # The variable is called "openssl" for parity with node's GYP build.
2623
+ node_use_openssl = true
@@ -126,11 +123,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
126123
+ } else {
127124
+ defines += [ "NODE_USE_V8_PLATFORM=0" ]
128125
+ }
129-
+ if (node_report) {
130-
+ defines += [ "NODE_REPORT=1" ]
131-
+ } else {
132-
+ defines += [ "NODE_REPORT=0" ]
133-
+ }
134126
+}
135127
+
136128
+config("node_lib_config") {
@@ -217,7 +209,7 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
217209
+ "deps/llhttp",
218210
+ "deps/nghttp2",
219211
+ "deps/uvwasi",
220-
+ "deps/zlib",
212+
+ "//third_party/zlib",
221213
+ "//third_party/brotli:dec",
222214
+ "//third_party/brotli:enc",
223215
+ "//v8:v8_libplatform",
@@ -262,14 +254,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
262254
+ libs += [ "CoreFoundation.framework" ]
263255
+ }
264256
+
265-
+ if (node_report) {
266-
+ sources += [
267-
+ "src/node_report.cc",
268-
+ "src/node_report_module.cc",
269-
+ "src/node_report_utils.cc",
270-
+ ]
271-
+ }
272-
+
273257
+ if (node_enable_inspector) {
274258
+ sources += [
275259
+ "src/inspector_agent.cc",
@@ -291,7 +275,7 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
291275
+ sources += [
292276
+ "src/node_crypto.cc",
293277
+ "src/node_crypto.h",
294-
+ "src/node_crypto_common.cc",
278+
+ "src/node_crypto_common.cc",
295279
+ "src/node_crypto_common.h",
296280
+ "src/node_crypto_bio.cc",
297281
+ "src/node_crypto_bio.h",
@@ -837,10 +821,10 @@ index 0000000000000000000000000000000000000000..67116f2070bb9200aace81afdf0b1e7a
837821
+}
838822
diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn
839823
new file mode 100644
840-
index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c7128ab5eec
824+
index 0000000000000000000000000000000000000000..b1c2cb80193bd0a0c56867428f2da8b46f11b16b
841825
--- /dev/null
842826
+++ b/deps/uvwasi/BUILD.gn
843-
@@ -0,0 +1,35 @@
827+
@@ -0,0 +1,36 @@
844828
+config("uvwasi_config") {
845829
+ include_dirs = [ "include" ]
846830
+}
@@ -862,7 +846,7 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71
862846
+ deps = [ "../../deps/uv" ]
863847
+
864848
+ public_configs = [ ":uvwasi_config" ]
865-
+
849+
+
866850
+ cflags_c = []
867851
+ if (!is_win) {
868852
+ cflags_c += [ "-fvisibility=hidden" ]
@@ -871,81 +855,18 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71
871855
+ sources = [
872856
+ "src/clocks.c",
873857
+ "src/fd_table.c",
858+
+ "src/path_resolver.c",
874859
+ "src/uv_mapping.c",
875860
+ "src/uvwasi.c",
876861
+ "src/wasi_rights.c",
877862
+ ]
878863
+}
879-
diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn
880-
new file mode 100644
881-
index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2eaaea76280
882-
--- /dev/null
883-
+++ b/deps/zlib/BUILD.gn
884-
@@ -0,0 +1,58 @@
885-
+config("includes") {
886-
+ include_dirs = [ "." ]
887-
+}
888-
+
889-
+config("ignored_warnings") {
890-
+ if (is_win) {
891-
+ cflags = [
892-
+ "/wd4131", # old-style declarator
893-
+ "/wd4127", # conditional expression is constant
894-
+ "/wd4244", # possible loss of data on type conversion
895-
+ "/wd4996", # deprecated 'open'
896-
+ ]
897-
+ } else {
898-
+ cflags = [
899-
+ "-Wno-implicit-function-declaration",
900-
+ "-Wno-shift-negative-value",
901-
+ ]
902-
+ }
903-
+}
904-
+
905-
+source_set("zlib") {
906-
+ sources = [
907-
+ "adler32.c",
908-
+ "compress.c",
909-
+ "crc32.c",
910-
+ "crc32.h",
911-
+ "deflate.c",
912-
+ "deflate.h",
913-
+ "gzclose.c",
914-
+ "gzguts.h",
915-
+ "gzlib.c",
916-
+ "gzread.c",
917-
+ "gzwrite.c",
918-
+ "infback.c",
919-
+ "inffast.c",
920-
+ "inffast.h",
921-
+ "inffixed.h",
922-
+ "inflate.c",
923-
+ "inflate.h",
924-
+ "inftrees.c",
925-
+ "inftrees.h",
926-
+ "trees.c",
927-
+ "trees.h",
928-
+ "uncompr.c",
929-
+ "zconf.h",
930-
+ "zlib.h",
931-
+ "zutil.c",
932-
+ "zutil.h",
933-
+ ]
934-
+
935-
+ if (is_win) {
936-
+ defines = [ "ZLIB_DLL" ]
937-
+ }
938-
+
939-
+ configs += [ ":ignored_warnings" ]
940-
+
941-
+ public_configs = [ ":includes" ]
942-
+}
943864
diff --git a/filenames.json b/filenames.json
944865
new file mode 100644
945-
index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf1520b376e7e
866+
index 0000000000000000000000000000000000000000..ca5ae6d2e24d53db37257192f3c34068ba0f8e69
946867
--- /dev/null
947868
+++ b/filenames.json
948-
@@ -0,0 +1,500 @@
869+
@@ -0,0 +1,513 @@
949870
+// This file is automatically generated by generate_gn_filenames_json.py
950871
+// DO NOT EDIT
951872
+{
@@ -1161,6 +1082,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
11611082
+ "lib/internal/fs/utils.js",
11621083
+ "lib/internal/fs/watchers.js",
11631084
+ "lib/internal/http.js",
1085+
+ "lib/internal/heap_utils.js",
11641086
+ "lib/internal/histogram.js",
11651087
+ "lib/internal/idna.js",
11661088
+ "lib/internal/inspector_async_hook.js",
@@ -1235,6 +1157,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
12351157
+ "lib/internal/vm/module.js",
12361158
+ "lib/internal/worker.js",
12371159
+ "lib/internal/worker/io.js",
1160+
+ "lib/internal/watchdog.js",
12381161
+ "lib/internal/streams/lazy_transform.js",
12391162
+ "lib/internal/streams/async_iterator.js",
12401163
+ "lib/internal/streams/buffer_list.js",
@@ -1291,6 +1214,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
12911214
+ "src/js_native_api_v8.h",
12921215
+ "src/js_native_api_v8_internals.h",
12931216
+ "src/js_stream.cc",
1217+
+ "src/json_utils.cc",
12941218
+ "src/module_wrap.cc",
12951219
+ "src/node.cc",
12961220
+ "src/node_api.cc",
@@ -1322,7 +1246,11 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
13221246
+ "src/node_process_events.cc",
13231247
+ "src/node_process_methods.cc",
13241248
+ "src/node_process_object.cc",
1249+
+ "src/node_report.cc",
1250+
+ "src/node_report_module.cc",
1251+
+ "src/node_report_utils.cc",
13251252
+ "src/node_serdes.cc",
1253+
+ "src/node_sockaddr.cc",
13261254
+ "src/node_stat_watcher.cc",
13271255
+ "src/node_symbols.cc",
13281256
+ "src/node_task_queue.cc",
@@ -1373,6 +1301,9 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
13731301
+ "src/histogram-inl.h",
13741302
+ "src/http_parser_adaptor.h",
13751303
+ "src/js_stream.h",
1304+
+ "src/json_utils.h",
1305+
+ "src/large_pages/node_large_page.cc",
1306+
+ "src/large_pages/node_large_page.h",
13761307
+ "src/memory_tracker.h",
13771308
+ "src/memory_tracker-inl.h",
13781309
+ "src/module_wrap.h",
@@ -1408,8 +1339,11 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
14081339
+ "src/node_perf_common.h",
14091340
+ "src/node_platform.h",
14101341
+ "src/node_process.h",
1342+
+ "src/node_report.h",
14111343
+ "src/node_revert.h",
14121344
+ "src/node_root_certs.h",
1345+
+ "src/node_sockaddr.h",
1346+
+ "src/node_sockaddr-inl.h",
14131347
+ "src/node_stat_watcher.h",
14141348
+ "src/node_union_bytes.h",
14151349
+ "src/node_url.h",
@@ -1652,7 +1586,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
16521586
+ args = rebase_path(inputs + outputs, root_build_dir)
16531587
+}
16541588
diff --git a/src/node_version.h b/src/node_version.h
1655-
index 958519fbe4a83293f5c7bfabb310d3f15d319922..935ead39a1148c22f8c778df750e0c24ceafe909 100644
1589+
index 49d0f6f8a69b48b79556e36c54daae080a00386b..aa1563e93ee66f1c1a2c6840b3d020dc8f9cef68 100644
16561590
--- a/src/node_version.h
16571591
+++ b/src/node_version.h
16581592
@@ -89,7 +89,10 @@

patches/node/build_bring_back_node_with_ltcg_configuration.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ THe fix for this should land in node-gyp as discussed in above issue,
1010
landing this as temporary patch.
1111

1212
diff --git a/common.gypi b/common.gypi
13-
index 1c753edfefa96d69c5de7d54078fa3136b244b52..71b20b28d923c39f047bf57e05558879c9d002ec 100644
13+
index 1e8cac3c5123698d9551835639e87a0afa7a2246..325382613e59ef8796c1e878afed0cf66bc1e0ca 100644
1414
--- a/common.gypi
1515
+++ b/common.gypi
1616
@@ -19,7 +19,7 @@

patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded
1414
through LoadEmbedderJavaScriptSource()
1515

1616
diff --git a/src/node_native_module.cc b/src/node_native_module.cc
17-
index 43c13ea30a0dc56151cba3d4597ae81b27c41300..e9a43592d558409d5fd43e2f51b22efb4e41551d 100644
17+
index 1b916d645d863929710ce5e4e930ec72fb426844..6d39a8858e093199fb935b68ff84388d48d6c35e 100644
1818
--- a/src/node_native_module.cc
1919
+++ b/src/node_native_module.cc
2020
@@ -23,6 +23,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
@@ -26,7 +26,7 @@ index 43c13ea30a0dc56151cba3d4597ae81b27c41300..e9a43592d558409d5fd43e2f51b22efb
2626

2727
NativeModuleLoader* NativeModuleLoader::GetInstance() {
2828
diff --git a/src/node_native_module.h b/src/node_native_module.h
29-
index fabaea75686161f488a03349e07049a513b98fad..5a6b01dc12fb77d5f8c26a1153ead2a1b2a8d061 100644
29+
index c0bce3bce42c848d63a10147ef483c9d4465f5ce..7f296e459d46b4cda51baf9887df060f0372227d 100644
3030
--- a/src/node_native_module.h
3131
+++ b/src/node_native_module.h
3232
@@ -44,6 +44,7 @@ class NativeModuleLoader {

patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ once we stop warning and begin to unilaterally prevent non-context aware modules
88
from being loaded.
99

1010
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
11-
index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af2ccee362 100644
11+
index 0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc..b4a0f71af5853f427a10449b52509052fbe3facd 100644
1212
--- a/lib/internal/bootstrap/pre_execution.js
1313
+++ b/lib/internal/bootstrap/pre_execution.js
14-
@@ -86,8 +86,10 @@ function patchProcessObject(expandArgv1) {
14+
@@ -89,8 +89,10 @@ function patchProcessObject(expandArgv1) {
1515

1616
if (expandArgv1 && process.argv[1] && !process.argv[1].startsWith('-')) {
1717
// Expand process.argv[1] into a full path.
@@ -23,10 +23,10 @@ index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af
2323

2424
// TODO(joyeecheung): most of these should be deprecated and removed,
2525
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
26-
index 992482525f8bdea399528f1e5673f4efa21b7246..800c22dea9c07a4039e6e7eabeae73a9b8013e09 100644
26+
index e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19e11526c3 100644
2727
--- a/lib/internal/modules/cjs/loader.js
2828
+++ b/lib/internal/modules/cjs/loader.js
29-
@@ -1104,6 +1104,13 @@ Module.prototype._compile = function(content, filename) {
29+
@@ -1109,6 +1109,13 @@ Module.prototype._compile = function(content, filename) {
3030
if (getOptionValue('--inspect-brk') && process._eval == null) {
3131
if (!resolvedArgv) {
3232
// We enter the repl if we're not given a filename argument.
@@ -41,10 +41,10 @@ index 992482525f8bdea399528f1e5673f4efa21b7246..800c22dea9c07a4039e6e7eabeae73a9
4141
try {
4242
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
4343
diff --git a/src/env.h b/src/env.h
44-
index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5 100644
44+
index deeeb2a385ab75fbfd86af619e1aad118f1a0794..5c0392a59b3938b0b6e433024f9dd92e222a1b47 100644
4545
--- a/src/env.h
4646
+++ b/src/env.h
47-
@@ -880,6 +880,15 @@ class Environment : public MemoryRetainer {
47+
@@ -887,6 +887,15 @@ class Environment : public MemoryRetainer {
4848
uint64_t thread_id = kNoThreadId);
4949
~Environment() override;
5050

@@ -60,7 +60,7 @@ index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f
6060
void InitializeLibuv(bool start_profiler_idle_notifier);
6161
inline const std::vector<std::string>& exec_argv();
6262
inline const std::vector<std::string>& argv();
63-
@@ -1266,6 +1275,9 @@ class Environment : public MemoryRetainer {
63+
@@ -1270,6 +1279,9 @@ class Environment : public MemoryRetainer {
6464
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
6565
const char* errmsg);
6666

@@ -71,7 +71,7 @@ index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f
7171
v8::Isolate* const isolate_;
7272
IsolateData* const isolate_data_;
7373
diff --git a/src/node_binding.cc b/src/node_binding.cc
74-
index db60617cebee83ac09371aa1e2200280e29bd772..714f973a7e984fef2e705882a3f30d8a95c33653 100644
74+
index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca2179b4a0 100644
7575
--- a/src/node_binding.cc
7676
+++ b/src/node_binding.cc
7777
@@ -3,6 +3,7 @@
@@ -82,7 +82,7 @@ index db60617cebee83ac09371aa1e2200280e29bd772..714f973a7e984fef2e705882a3f30d8a
8282
#include "util.h"
8383

8484
#if HAVE_OPENSSL
85-
@@ -467,10 +468,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
85+
@@ -462,10 +463,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
8686

8787
if (mp != nullptr) {
8888
if (mp->nm_context_register_func == nullptr) {

0 commit comments

Comments
 (0)