Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit a3a8cf5

Browse files
electron-roller[bot]codebytere
authored andcommitted
chore: bump node to v18.14.0 (main) (electron#37129)
* chore: bump node in DEPS to v18.14.0 * src: add support for externally shared js builtins nodejs/node#44376 * test: fix test broken under --node-builtin-modules-path nodejs/node#45894 * build: add option to disable shared readonly heap nodejs/node#45887 * src: remove unnecessary semicolons nodejs/node#46171 * src: remove return after abort nodejs/node#46172 * chore: fixup patch indices * test_runner: parse yaml nodejs/node#45815 * src: use simdutf for converting externalized builtins to UTF-16 nodejs/node#46119 * src: rename internal module declaration as internal bindings nodejs/node#45551 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]>
1 parent 0b9b993 commit a3a8cf5

26 files changed

+98
-131
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars = {
44
'chromium_version':
55
'111.0.5560.0',
66
'node_version':
7-
'v18.13.0',
7+
'v18.14.0',
88
'nan_version':
99
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
1010
'squirrel.mac_version':

patches/node/.patches

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,3 @@ fix_expose_lookupandcompile_with_parameters.patch
3434
fix_prevent_changing_functiontemplateinfo_after_publish.patch
3535
enable_crashpad_linux_node_processes.patch
3636
allow_embedder_to_control_codegenerationfromstringscallback.patch
37-
chore_remove_errant_semicolons.patch
38-
chore_remove_unreached_return.patch

patches/node/allow_embedder_to_control_codegenerationfromstringscallback.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ This is needed to blend Blink and Node's code generation policy.
88
This should be upstreamed.
99

1010
diff --git a/src/api/environment.cc b/src/api/environment.cc
11-
index c0c422e969543dcd570dabfd8ff0755abe37face..4f14b308d14f3653c8646345a5b375014a51851f 100644
11+
index e3c42d892eed8dd605301348c08ad24f4362a7aa..c718b9919bb30627e5da2b92a8de58c494bf4b93 100644
1212
--- a/src/api/environment.cc
1313
+++ b/src/api/environment.cc
14-
@@ -267,11 +267,15 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
14+
@@ -268,11 +268,15 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
1515
void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
1616
isolate->SetMicrotasksPolicy(s.policy);
1717

patches/node/api_pass_oomdetails_to_oomerrorcallback.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This patch can be removed when Node.js updates to a V8 version containing
99
the above CL.
1010

1111
diff --git a/src/node_errors.cc b/src/node_errors.cc
12-
index 323fc7d4ff635ca287ee241cee234da0600340a2..36ab78f739f3faecab47eead99f9aa3c403672c0 100644
12+
index 9f620154ce3696cff90bf308da934147319b1096..806d9700ca4b5faf46042814c0e2ce212945bece 100644
1313
--- a/src/node_errors.cc
1414
+++ b/src/node_errors.cc
1515
@@ -495,9 +495,9 @@ void OnFatalError(const char* location, const char* message) {
@@ -25,7 +25,7 @@ index 323fc7d4ff635ca287ee241cee234da0600340a2..36ab78f739f3faecab47eead99f9aa3c
2525
if (location) {
2626
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
2727
diff --git a/src/node_errors.h b/src/node_errors.h
28-
index 926f54286ec72fda98a9a477ac8e22feef522291..f926cc1c70dd6f883c0729c46f09e10972ce6385 100644
28+
index 850d437acdfe09fc43a7a37790c2926e6109749d..5a33d17b0e90e8ca8dc670e14f93de8fef99d526 100644
2929
--- a/src/node_errors.h
3030
+++ b/src/node_errors.h
3131
@@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env,

patches/node/build_add_gn_build_files.patch

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ 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..db80a8f00a84bf54f723c21300e7579c994d0514
10+
index 0000000000000000000000000000000000000000..5e8577795316984f3073204523d82a17f44b0f88
1111
--- /dev/null
1212
+++ b/BUILD.gn
13-
@@ -0,0 +1,438 @@
13+
@@ -0,0 +1,439 @@
1414
+import("//v8/gni/v8.gni")
1515
+import("node.gni")
1616
+
@@ -223,8 +223,9 @@ index 0000000000000000000000000000000000000000..db80a8f00a84bf54f723c21300e7579c
223223
+ deps = [
224224
+ ":node_js2c",
225225
+ "deps/googletest:gtest",
226-
+ "deps/uvwasi",
227226
+ "deps/base64",
227+
+ "deps/simdutf",
228+
+ "deps/uvwasi",
228229
+ "//third_party/zlib",
229230
+ "//third_party/brotli:dec",
230231
+ "//third_party/brotli:enc",
@@ -945,6 +946,32 @@ index 0000000000000000000000000000000000000000..23eed033d31eced6a85c794eee550655
945946
+ "lib/nghttp2_version.c",
946947
+ ]
947948
+}
949+
diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn
950+
new file mode 100644
951+
index 0000000000000000000000000000000000000000..bfbd4e656db1a6c73048443f96f1d576a0df7519
952+
--- /dev/null
953+
+++ b/deps/simdutf/BUILD.gn
954+
@@ -0,0 +1,20 @@
955+
+config("simdutf_config") {
956+
+ include_dirs = [ "." ]
957+
+}
958+
+
959+
+static_library("simdutf") {
960+
+ include_dirs = [ "." ]
961+
+ sources = [
962+
+ "simdutf.cpp",
963+
+ ]
964+
+
965+
+ public_configs = [ ":simdutf_config" ]
966+
+
967+
+ cflags_cc = [
968+
+ "-Wno-ambiguous-reversed-operator",
969+
+ "-Wno-c++98-compat-extra-semi",
970+
+ "-Wno-unreachable-code-break",
971+
+ "-Wno-unused-const-variable",
972+
+ "-Wno-unused-function",
973+
+ ]
974+
+}
948975
diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
949976
new file mode 100644
950977
index 0000000000000000000000000000000000000000..d6bed57461820ce08391fc424a1f842bd282fa75
@@ -1193,7 +1220,7 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
11931220
+}
11941221
diff --git a/filenames.json b/filenames.json
11951222
new file mode 100644
1196-
index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101af305de82
1223+
index 0000000000000000000000000000000000000000..2a9146e592429c1726527353c6484bd4534731b1
11971224
--- /dev/null
11981225
+++ b/filenames.json
11991226
@@ -0,0 +1,653 @@
@@ -1358,7 +1385,6 @@ index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101a
13581385
+ "lib/internal/assert.js",
13591386
+ "lib/internal/assert/assertion_error.js",
13601387
+ "lib/internal/assert/calltracker.js",
1361-
+ "lib/internal/assert/snapshot.js",
13621388
+ "lib/internal/async_hooks.js",
13631389
+ "lib/internal/blob.js",
13641390
+ "lib/internal/blocklist.js",
@@ -1548,6 +1574,7 @@ index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101a
15481574
+ "lib/internal/test_runner/tap_stream.js",
15491575
+ "lib/internal/test_runner/test.js",
15501576
+ "lib/internal/test_runner/utils.js",
1577+
+ "lib/internal/test_runner/yaml_parser.js",
15511578
+ "lib/internal/timers.js",
15521579
+ "lib/internal/tls/secure-context.js",
15531580
+ "lib/internal/tls/secure-pair.js",
@@ -2091,7 +2118,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
20912118
+ args = rebase_path(inputs + outputs, root_build_dir)
20922119
+}
20932120
diff --git a/src/node_version.h b/src/node_version.h
2094-
index d6b2f18cf8599ed7994954c808379565b740ac83..cd73f646bb3e9dbc4d9f4a3f24ef5970ec33b3a5 100644
2121+
index c42b070a3367283155f9ff6b861b9f0160b5e9ed..ff8a64174e6f09af533b2fe05b2fe6e600624910 100644
20952122
--- a/src/node_version.h
20962123
+++ b/src/node_version.h
20972124
@@ -89,7 +89,10 @@

patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new
77
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
88

99
diff --git a/common.gypi b/common.gypi
10-
index 6704d96142f806be9c0605f0b41206e77f492b96..f1404d27e14ce7143d3b2dbccde7af8269369cbf 100644
10+
index b661dc4a1b3149e780eef46033e70e68038417b0..15b6155017233ed9d4c60c2453f498ba8a33403d 100644
1111
--- a/common.gypi
1212
+++ b/common.gypi
1313
@@ -79,6 +79,8 @@
@@ -40,10 +40,10 @@ index 6704d96142f806be9c0605f0b41206e77f492b96..f1404d27e14ce7143d3b2dbccde7af82
4040
'defines': [
4141
'V8_COMPRESS_POINTERS',
4242
diff --git a/configure.py b/configure.py
43-
index bae674fd264ff0bfbe025c286279182358872b23..1f3c398c034d2c0bf0eca51b892ca87c3fcf7ce1 100755
43+
index 171afd04030e6933da054db866d44428ae808acf..363bf746101c85630a6c52146303986e7e0dcdce 100755
4444
--- a/configure.py
4545
+++ b/configure.py
46-
@@ -1511,6 +1511,7 @@ def configure_library(lib, output, pkgname=None):
46+
@@ -1517,6 +1517,7 @@ def configure_library(lib, output, pkgname=None):
4747

4848

4949
def configure_v8(o):

patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Aligns common.gypi with the current build flag state of //v8.
88
Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`.
99

1010
diff --git a/common.gypi b/common.gypi
11-
index cbbc7264c6ad097c5da4902ac1bdbdcebfdd36af..6704d96142f806be9c0605f0b41206e77f492b96 100644
11+
index 2c2f3218a8ae387802af3d154ede601aedcb52dd..b661dc4a1b3149e780eef46033e70e68038417b0 100644
1212
--- a/common.gypi
1313
+++ b/common.gypi
1414
@@ -65,6 +65,7 @@
@@ -42,14 +42,14 @@ index cbbc7264c6ad097c5da4902ac1bdbdcebfdd36af..6704d96142f806be9c0605f0b41206e7
4242
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
4343
}],
4444
diff --git a/configure.py b/configure.py
45-
index 81d54a14b7af51b77b6340a4f7bf605d6f1656bc..bae674fd264ff0bfbe025c286279182358872b23 100755
45+
index 0a45c07f587ed8d21dff45d523b7074606c586ac..171afd04030e6933da054db866d44428ae808acf 100755
4646
--- a/configure.py
4747
+++ b/configure.py
48-
@@ -1524,6 +1524,7 @@ def configure_v8(o):
48+
@@ -1530,6 +1530,7 @@ def configure_v8(o):
4949
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
5050
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
5151
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
5252
+ o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0
53-
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression else 1
53+
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression or options.disable_shared_ro_heap else 1
5454
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
5555
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)

patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

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

1616
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
17-
index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f266e53c2e 100644
17+
index bc4555584ab1f97806a1e9cd17085a2488320908..b17dbf2a98c9f4b14fea60c87f05afcee6ec54fb 100644
1818
--- a/lib/internal/fs/watchers.js
1919
+++ b/lib/internal/fs/watchers.js
20-
@@ -290,11 +290,13 @@ function emitCloseNT(self) {
20+
@@ -293,11 +293,13 @@ function emitCloseNT(self) {
2121

2222
// Legacy alias on the C++ wrapper object. This is not public API, so we may
2323
// want to runtime-deprecate it at some point. There's no hurry, though.
@@ -28,31 +28,31 @@ index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f2
2828
-});
2929
+if (!'owner' in FSEvent.prototype) {
3030
+ ObjectDefineProperty(FSEvent.prototype, 'owner', {
31-
+ __proto__: null,
31+
+ __proto__: null,
3232
+ get() { return this[owner_symbol]; },
3333
+ set(v) { return this[owner_symbol] = v; }
3434
+ });
3535
+}
3636

37-
async function* watch(filename, options = {}) {
37+
async function* watch(filename, options = kEmptyObject) {
3838
const path = toNamespacedPath(getValidatedPath(filename));
3939
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
40-
index 9d82a06adcefe386ea230c7cfbdccffb67d0b8c1..6e1a55adbd0b01383f3e54e924864dfeb6a57f0b 100644
40+
index 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e155345a454 100644
4141
--- a/src/node_builtins.cc
4242
+++ b/src/node_builtins.cc
43-
@@ -32,6 +32,7 @@ BuiltinLoader BuiltinLoader::instance_;
43+
@@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_;
4444

4545
BuiltinLoader::BuiltinLoader() : config_(GetConfig()), has_code_cache_(false) {
4646
LoadJavaScriptSource();
4747
+ LoadEmbedderJavaScriptSource();
48-
#if defined(NODE_HAVE_I18N_SUPPORT)
4948
#ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH
5049
AddExternalizedBuiltin(
50+
"internal/deps/cjs-module-lexer/lexer",
5151
diff --git a/src/node_builtins.h b/src/node_builtins.h
52-
index a6fbff98ccb0a7f5fd33cf3b084cfdf47aaa995e..8228e57d27b2f883d87ec12274f2745628caa6e1 100644
52+
index 90b158b84bb2a66781cf92f5b4c1a64f9e2ee651..8d9f7c409659a30747e5feeac6cfec4208791370 100644
5353
--- a/src/node_builtins.h
5454
+++ b/src/node_builtins.h
55-
@@ -73,6 +73,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
55+
@@ -71,6 +71,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
5656

5757
// Generated by tools/js2c.py as node_javascript.cc
5858
void LoadJavaScriptSource(); // Loads data into source_

patches/node/chore_add_context_to_context_aware_module_prevention.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ modules from being used in the renderer process. This should be upstreamed as
88
a customizable error message.
99

1010
diff --git a/src/node_binding.cc b/src/node_binding.cc
11-
index c4e6347f6f302b46fe4569f543335e426cd4ded5..f772e71521c71edd7d40b0489c5fc875357e3790 100644
11+
index 175d0bee02d3592891f671533857b737057ab684..cf1cbcd54448754c7199a128b5447945aecf3e92 100644
1212
--- a/src/node_binding.cc
1313
+++ b/src/node_binding.cc
1414
@@ -4,6 +4,7 @@

patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
88
of this.
99

1010
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
11-
index 44e4c22ebf39fc9c52f789173a2cc50300bcd181..035de64bf1f0ab46de2b803edeaf0596c8bf68a0 100644
11+
index 207142322bba89e94f4e3052a22bef6ffebcdc39..c83d8b0db630d3fc26fb273170945c872bede091 100644
1212
--- a/lib/internal/modules/cjs/loader.js
1313
+++ b/lib/internal/modules/cjs/loader.js
14-
@@ -1192,6 +1192,13 @@ Module.prototype._compile = function(content, filename) {
14+
@@ -1200,6 +1200,13 @@ Module.prototype._compile = function(content, filename) {
1515
if (getOptionValue('--inspect-brk') && process._eval == null) {
1616
if (!resolvedArgv) {
1717
// We enter the repl if we're not given a filename argument.

0 commit comments

Comments
 (0)