Skip to content

Commit 43fa916

Browse files
chore: bump node to v12.12.0 (master) (electron#20584)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
1 parent 9f23bb5 commit 43fa916

16 files changed

Lines changed: 465 additions & 126 deletions

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ vars = {
1313
'chromium_version':
1414
'c3a0220e7bde049d599a8332b9b2785b0178be74',
1515
'node_version':
16-
'v12.10.0',
16+
'v12.12.0',
1717
'nan_version':
1818
'2ee313aaca52e2b478965ac50eb5082520380d1b',
1919

patches/node/.patches

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fix_do_not_define_debugoptions_s_constructors_in_header.patch
2525
src_disable_node_use_v8_platform_in_node_options.patch
2626
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
2727
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
28-
chore_add_ability_to_prevent_warn_non_context-aware_native_modules.patch
28+
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
2929
chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
3030
inherit_electron_crashpad_pipe_name_in_child_process.patch
3131
fixme_revert_crypto_add_support_for_rsa-pss_keys.patch
@@ -35,8 +35,12 @@ chore_read_nobrowserglobals_from_global_not_process.patch
3535
chore_split_createenvironment_into_createenvironment_and.patch
3636
chore_handle_default_configuration_not_being_set_in_the_electron_env.patch
3737
revert_crypto_add_outputlength_option_to_crypto_createhash.patch
38-
fix_microtasks.patch
3938
fsevents-stop-using-fsevents-to-watch-files.patch
4039
fsevents-regression-in-watching.patch
41-
fix_enable_worker_threads.patch
4240
build_bring_back_node_with_ltcg_configuration.patch
41+
revert_tls_add_option_to_override_signature_algorithms.patch
42+
revert_crypto_fix_openssl_return_code_handling.patch
43+
revert_crypto_add_oaeplabel_option.patch
44+
fix_windows_compilation_on_libuv_setsockopt.patch
45+
fix_don_t_use_node-controlled_preparestacktrace.patch
46+
fix_remove_uses_of_node_use_v8_platform.patch

patches/node/build_add_gn_build_files.patch

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2ea
882882
+}
883883
diff --git a/filenames.json b/filenames.json
884884
new file mode 100644
885-
index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792f2119fcb
885+
index 0000000000000000000000000000000000000000..bfe6555be5239c6d9cad59e8b845638d50f31ee3
886886
--- /dev/null
887887
+++ b/filenames.json
888-
@@ -0,0 +1,443 @@
888+
@@ -0,0 +1,447 @@
889889
+// This file is automatically generated by generate_gn_filenames_json.py
890890
+// DO NOT EDIT
891891
+{
@@ -960,7 +960,6 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
960960
+ "lib/internal/bootstrap/node.js",
961961
+ "lib/internal/bootstrap/pre_execution.js",
962962
+ "lib/internal/per_context/primordials.js",
963-
+ "lib/internal/per_context/setup.js",
964963
+ "lib/internal/per_context/domexception.js",
965964
+ "lib/async_hooks.js",
966965
+ "lib/assert.js",
@@ -1052,6 +1051,7 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
10521051
+ "lib/internal/fixed_queue.js",
10531052
+ "lib/internal/freelist.js",
10541053
+ "lib/internal/freeze_intrinsics.js",
1054+
+ "lib/internal/fs/dir.js",
10551055
+ "lib/internal/fs/promises.js",
10561056
+ "lib/internal/fs/read_file_context.js",
10571057
+ "lib/internal/fs/rimraf.js",
@@ -1106,6 +1106,8 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
11061106
+ "lib/internal/repl/history.js",
11071107
+ "lib/internal/repl/utils.js",
11081108
+ "lib/internal/socket_list.js",
1109+
+ "lib/internal/source_map/source_map.js",
1110+
+ "lib/internal/source_map/source_map_cache.js",
11091111
+ "lib/internal/test/binding.js",
11101112
+ "lib/internal/timers.js",
11111113
+ "lib/internal/tls.js",
@@ -1191,6 +1193,7 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
11911193
+ "src/node_constants.cc",
11921194
+ "src/node_contextify.cc",
11931195
+ "src/node_credentials.cc",
1196+
+ "src/node_dir.cc",
11941197
+ "src/node_domain.cc",
11951198
+ "src/node_env_var.cc",
11961199
+ "src/node_errors.cc",
@@ -1272,6 +1275,7 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
12721275
+ "src/node_constants.h",
12731276
+ "src/node_context_data.h",
12741277
+ "src/node_contextify.h",
1278+
+ "src/node_dir.h",
12751279
+ "src/node_errors.h",
12761280
+ "src/node_file.h",
12771281
+ "src/node_http_parser_impl.h",
@@ -1535,7 +1539,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
15351539
+ args = rebase_path(inputs + outputs, root_build_dir)
15361540
+}
15371541
diff --git a/src/node_version.h b/src/node_version.h
1538-
index 2d105483ba10533d992de3265121e6ab9edce2ed..8a8fd5f7fad4a69b65e06d67225a398385d3bbbf 100644
1542+
index a61a186edd3c92d6f0bd760a9990b5c8ed57e6fa..e4963fdfd9b93a6f50a4f1035f63e95432dd8d8e 100644
15391543
--- a/src/node_version.h
15401544
+++ b/src/node_version.h
15411545
@@ -89,7 +89,10 @@
@@ -1667,25 +1671,25 @@ index 0000000000000000000000000000000000000000..3088ae4bdf814ae255c9805ebd393b2e
16671671
+
16681672
+ out_file.writelines(new_contents)
16691673
diff --git a/tools/js2c.py b/tools/js2c.py
1670-
index 0189dd762919162c8a897d291bdda3cfd600eab6..7b3e90af88b873c32f8ed51712f7dfdff3c1c706 100755
1674+
index 1346b2a87046d3472577875c887b3b44a63280ed..752344d68c3f63b4c5e491b33d4576ed48f8b74f 100755
16711675
--- a/tools/js2c.py
16721676
+++ b/tools/js2c.py
1673-
@@ -261,9 +261,17 @@ def NormalizeFileName(filename):
1677+
@@ -261,10 +261,18 @@ def NormalizeFileName(filename):
16741678
split = ['internal'] + split
16751679
else: # `lib/**/*.js` so drop the 'lib' part
16761680
split = split[1:]
16771681
+
16781682
if len(split):
16791683
filename = '/'.join(split)
16801684
- return os.path.splitext(filename)[0]
1681-
+
1685+
16821686
+ # Electron-specific: when driving the node build from Electron, we generate
16831687
+ # config.gypi in a separate directory and pass the absolute path to js2c.
16841688
+ # This overrides the absolute path so that the variable names in the
16851689
+ # generated C are as if it was in the root node directory.
16861690
+ if filename.endswith("/config.gypi"):
16871691
+ filename = "config.gypi"
1688-
1692+
+
16891693
+ return os.path.splitext(filename)[0]
16901694

16911695
def JS2C(source_files, target):

patches/node/chore_add_ability_to_prevent_warn_non_context-aware_native_modules.patch renamed to patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Samuel Attard <sattard@slack-corp.com>
33
Date: Wed, 22 May 2019 13:34:18 -0700
4-
Subject: chore: add ability to prevent / warn non context-aware native modules
5-
being loaded
4+
Subject: chore: prevent / warn non context-aware native modules being loaded
5+
6+
This should be updated to take advantage of https://github.com/nodejs/node/pull/29631
7+
once we stop warning and begin to unilaterally prevent non-context aware modules
8+
from being loaded.
69

710
diff --git a/src/env.h b/src/env.h
811
index 2dd6bdb75f02e2ccb07129996d16df99c0c4ccf2..ecb845803776f5ff6e7eec712ec7a5ebea2e8d0a 100644
@@ -46,17 +49,19 @@ index c51a892e1bcd3df6ea8af952c8200975c7f4ac7e..9a4a7780f4ac1bcc0855cc9e3eed904d
4649
#include "util.h"
4750

4851
#if HAVE_OPENSSL
49-
@@ -463,6 +464,13 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
50-
}
52+
@@ -466,10 +466,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
5153

5254
if (mp != nullptr) {
53-
+ if (mp->nm_context_register_func == nullptr) {
55+
if (mp->nm_context_register_func == nullptr) {
56+
- if (env->options()->force_context_aware) {
5457
+ if (env->force_context_aware()) {
58+
dlib->Close();
59+
- THROW_ERR_NON_CONTEXT_AWARE_DISABLED(env);
5560
+ env->ThrowError("Loading non context-aware native modules has been disabled in this process. This means you have loaded a non context-aware native module with app.allowRendererProcessReuse set to true. See https://github.com/electron/electron/issues/18397 for more information");
61+
return false;
5662
+ } else if (env->warn_non_context_aware()) {
5763
+ ProcessEmitWarningGeneric(env, "Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information", "Electron");
58-
+ }
59-
+ }
64+
}
65+
}
6066
mp->nm_dso_handle = dlib->handle_;
61-
dlib->SaveInGlobalHandleMap(mp);
62-
} else {
67+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Shelley Vohr <shelley.vohr@gmail.com>
3+
Date: Thu, 17 Oct 2019 15:15:12 -0700
4+
Subject: fix: don't use node-controlled prepareStackTrace
5+
6+
At the moment, Electron uses the v8 version of Error.prepareStackTrace as
7+
defined in v7.9.74 (where https://crbug.com/v8/7848 has been fixed) and
8+
not the one polyfilled by Node.js. As a result, we were experiencing failures
9+
in parallel/test-buffer-constructor-outside-node-modules.js because
10+
the polyfilled prepareStackTrace was not being run and thus code
11+
inside that function would never be executed.
12+
13+
Upstreamed at https://github.com/nodejs/node/pull/30014.
14+
15+
diff --git a/lib/internal/util.js b/lib/internal/util.js
16+
index 58502f3b7a7a937c896ff6d32a90a45c6912e3b3..e91362cc3a8a6c5d2462a017f177bebfd607a850 100644
17+
--- a/lib/internal/util.js
18+
+++ b/lib/internal/util.js
19+
@@ -340,10 +340,10 @@ function isInsideNodeModules() {
20+
// the perf implications should be okay.
21+
getStructuredStack = runInNewContext(`(function() {
22+
Error.stackTraceLimit = Infinity;
23+
+ Error.prepareStackTrace = (err, trace) => trace;
24+
+
25+
return function structuredStack() {
26+
- const e = new Error();
27+
- overrideStackTrace.set(e, (err, trace) => trace);
28+
- return e.stack;
29+
+ return new Error().stack;
30+
};
31+
})()`, { overrideStackTrace }, { filename: 'structured-stack' });
32+
}

patches/node/fix_enable_worker_threads.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

patches/node/fix_microtasks.patch

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)