Skip to content

Commit

Permalink
chore: bump node to v18.16.0 (main) (#37973)
Browse files Browse the repository at this point in the history
* chore: bump node in DEPS to v18.16.0

* build,test: add proper support for IBM i

nodejs/node#46739

* lib: enforce use of trailing commas

nodejs/node#46881

* src: add initial support for single executable applications

nodejs/node#45038

* lib: do not crash using workers with disabled shared array buffers

nodejs/node#41023

* src: remove shadowed variable in OptionsParser::Parse

nodejs/node#46672

* src: allow embedder control of code generation policy

nodejs/node#46368

* src: allow optional Isolate termination in node::Stop()

nodejs/node#46583

* lib: fix BroadcastChannel initialization location

nodejs/node#46864

* chore: fixup patch indices

* chore: sync filenames.json

* fix: add simdutf dep to src/inspector BUILD.gn

- nodejs/node#46471
- nodejs/node#46472

* deps: replace url parser with Ada

nodejs/node#46410

* tls: support automatic DHE

nodejs/node#46978

* fixup! src: add initial support for single executable applications

* http: unify header treatment

nodejs/node#46528

* fix: libc++ buffer overflow in string_view ctor

nodejs/node#46410

* test: include strace openat test

nodejs/node#46150

* fixup! fixup! src: add initial support for single executable applications

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
electron-roller[bot] and codebytere committed Apr 18, 2023
1 parent 941153b commit de192c2
Show file tree
Hide file tree
Showing 35 changed files with 240 additions and 360 deletions.
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'114.0.5715.0',
'node_version':
'v18.15.0',
'v18.16.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
Expand Down
7 changes: 2 additions & 5 deletions patches/node/.patches
Expand Up @@ -12,7 +12,6 @@ chore_add_context_to_context_aware_module_prevention.patch
fix_handle_boringssl_and_openssl_incompatibilities.patch
fix_crypto_tests_to_run_with_bssl.patch
fix_account_for_debugger_agent_race_condition.patch
repl_fix_crash_when_sharedarraybuffer_disabled.patch
fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
fix_serdes_test.patch
Expand All @@ -24,15 +23,13 @@ build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
fix_override_createjob_in_node_platform.patch
v8_api_advance_api_deprecation.patch
fixup_for_error_declaration_shadows_a_local_variable.patch
fix_parallel_test-v8-stats.patch
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
api_pass_oomdetails_to_oomerrorcallback.patch
fix_expose_lookupandcompile_with_parameters.patch
fix_prevent_changing_functiontemplateinfo_after_publish.patch
enable_crashpad_linux_node_processes.patch
allow_embedder_to_control_codegenerationfromstringscallback.patch
src_allow_optional_isolation_termination_in_node.patch
test_mark_cpu_prof_tests_as_flaky_in_electron.patch
lib_fix_broadcastchannel_initialization_location.patch
fix_adapt_debugger_tests_for_upstream_v8_changes.patch
fix_libc_buffer_overflow_in_string_view_ctor.patch
fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch

This file was deleted.

4 changes: 2 additions & 2 deletions patches/node/api_pass_oomdetails_to_oomerrorcallback.patch
Expand Up @@ -8,10 +8,10 @@ Introduced in https://chromium-review.googlesource.com/c/v8/v8/+/3647827.
This patch can be removed when Electron updates to Node.js v20.

diff --git a/src/node_errors.cc b/src/node_errors.cc
index 9f620154ce3696cff90bf308da934147319b1096..806d9700ca4b5faf46042814c0e2ce212945bece 100644
index 2dc9e085269222c70902698020fc5c7b1af2f004..655f54e369c35efefa75c69cc57776249405dc76 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -495,9 +495,9 @@ void OnFatalError(const char* location, const char* message) {
@@ -527,9 +527,9 @@ void OnFatalError(const char* location, const char* message) {
ABORT();
}

Expand Down
82 changes: 69 additions & 13 deletions patches/node/build_add_gn_build_files.patch
Expand Up @@ -7,10 +7,10 @@ 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..5e8577795316984f3073204523d82a17f44b0f88
index 0000000000000000000000000000000000000000..a3e4599c21f2faa92a0dca47b1e0b4e836bb475d
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,439 @@
@@ -0,0 +1,443 @@
+import("//v8/gni/v8.gni")
+import("node.gni")
+
Expand Down Expand Up @@ -223,6 +223,7 @@ index 0000000000000000000000000000000000000000..5e8577795316984f3073204523d82a17
+ deps = [
+ ":node_js2c",
+ "deps/googletest:gtest",
+ "deps/ada",
+ "deps/base64",
+ "deps/simdutf",
+ "deps/uvwasi",
Expand All @@ -248,7 +249,10 @@ index 0000000000000000000000000000000000000000..5e8577795316984f3073204523d82a17
+ ]
+ configs += [ ":node_internal_config" ]
+ public_configs = [ ":node_lib_config" ]
+ include_dirs = [ "src" ]
+ include_dirs = [
+ "src",
+ "deps/postject"
+ ]
+ libs = []
+ if (use_system_llhttp) {
+ libs += [ "llhttp" ]
Expand Down Expand Up @@ -450,6 +454,40 @@ index 0000000000000000000000000000000000000000..5e8577795316984f3073204523d82a17
+ ":tar_headers",
+ ]
+}
diff --git a/deps/ada/BUILD.gn b/deps/ada/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..a564653c3f05608d59fed5aa071d63b81f4e0e42
--- /dev/null
+++ b/deps/ada/BUILD.gn
@@ -0,0 +1,28 @@
+import("//v8/gni/v8.gni")
+
+config("ada_config") {
+ include_dirs = [ "." ]
+}
+
+static_library("ada") {
+ include_dirs = [ "." ]
+ sources = [ "ada.cpp" ]
+
+ public_configs = [ ":ada_config" ]
+
+ defines = []
+ deps = []
+
+ if (v8_enable_i18n_support) {
+ deps += [
+ "//third_party/icu:icui18n",
+ "//third_party/icu:icuuc",
+ ]
+
+ if (is_win) {
+ deps += [ "//third_party/icu:icudata" ]
+ }
+ } else {
+ defines += [ "ADA_HAS_ICU=0" ]
+ }
+}
diff --git a/deps/base64/BUILD.gn b/deps/base64/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..694e1991bb11c9ea85fcc69a0e06265d4b0c5aab
Expand Down Expand Up @@ -1220,10 +1258,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df6309b413
index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84d82b57f3
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,659 @@
@@ -0,0 +1,663 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
Expand Down Expand Up @@ -1478,6 +1516,7 @@ index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df
+ "lib/internal/main/prof_process.js",
+ "lib/internal/main/repl.js",
+ "lib/internal/main/run_main_module.js",
+ "lib/internal/main/single_executable_application.js",
+ "lib/internal/main/test_runner.js",
+ "lib/internal/main/watch_mode.js",
+ "lib/internal/main/worker_thread.js",
Expand All @@ -1498,6 +1537,7 @@ index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df
+ "lib/internal/modules/esm/package_config.js",
+ "lib/internal/modules/esm/resolve.js",
+ "lib/internal/modules/esm/translators.js",
+ "lib/internal/modules/esm/utils.js",
+ "lib/internal/modules/package_json_reader.js",
+ "lib/internal/modules/run_main.js",
+ "lib/internal/net.js",
Expand Down Expand Up @@ -1731,6 +1771,7 @@ index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df
+ "src/node_report.cc",
+ "src/node_report_module.cc",
+ "src/node_report_utils.cc",
+ "src/node_sea.cc",
+ "src/node_serdes.cc",
+ "src/node_shadow_realm.cc",
+ "src/node_snapshotable.cc",
Expand All @@ -1741,7 +1782,6 @@ index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df
+ "src/node_trace_events.cc",
+ "src/node_types.cc",
+ "src/node_url.cc",
+ "src/node_url_tables.cc",
+ "src/node_util.cc",
+ "src/node_v8.cc",
+ "src/node_wasi.cc",
Expand Down Expand Up @@ -1840,6 +1880,7 @@ index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df
+ "src/node_report.h",
+ "src/node_revert.h",
+ "src/node_root_certs.h",
+ "src/node_sea.h",
+ "src/node_shadow_realm.h",
+ "src/node_snapshotable.h",
+ "src/node_snapshot_builder.h",
Expand Down Expand Up @@ -1880,7 +1921,8 @@ index 0000000000000000000000000000000000000000..71173dd5c0958d473972dfb397f230df
+ "src/udp_wrap.h",
+ "src/util.h",
+ "src/util-inl.h",
+ "//v8/include/v8.h"
+ "//v8/include/v8.h",
+ "deps/postject/postject-api.h"
+ ]
+}
diff --git a/node.gni b/node.gni
Expand Down Expand Up @@ -1918,12 +1960,25 @@ index 0000000000000000000000000000000000000000..9b1a4048a4a64c36d88de0bbe1a548c9
+ args += invoker.args
+ }
+}
diff --git a/node.gyp b/node.gyp
index cf52281bb4479ba20fbe852518edadc2185f0dae..81254f1d4fff9be925ecbb85fb0811c0909900dd 100644
--- a/node.gyp
+++ b/node.gyp
@@ -687,7 +687,7 @@
'src/util-inl.h',
# Dependency headers
'deps/v8/include/v8.h',
- 'deps/postject/postject-api.h'
+ 'deps/postject/postject-api.h',
# javascript files to make for an even more pleasant IDE experience
'<@(library_files)',
'<@(deps_files)',
diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb3048361d9d591
index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868bd1321be2
--- /dev/null
+++ b/src/inspector/BUILD.gn
@@ -0,0 +1,199 @@
@@ -0,0 +1,200 @@
+import("//v8/gni/v8.gni")
+
+inspector_protocol_dir = "../../tools/inspector_protocol"
Expand Down Expand Up @@ -1983,6 +2038,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ ":protocol_generated_sources",
+ ":v8_inspector_compress_protocol_json",
+ "../../deps/uv",
+ "../../deps/simdutf",
+ "//third_party/icu:icuuc",
+ ]
+ configs += [ "../..:node_internal_config" ]
Expand Down Expand Up @@ -2124,7 +2180,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index ee035efadf123464a7b4696a6351364a642cd947..afb9c47cc9324a6197a66e58bc59d40afc37dcf8 100644
index cfab30173a4311582b1ebdc5a1b84b37117a8e69..c254fe22f9e2bc0f1746e773f7ecb0d1db31294b 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down Expand Up @@ -2257,7 +2313,7 @@ index 0000000000000000000000000000000000000000..2a92eccfa582df361f2a889c0d9b32c1
+
+ out_file.writelines(new_contents)
diff --git a/tools/install.py b/tools/install.py
index 9d5f4a48bca2c926b3ffb3c51c070222d4f7ce7b..c9ea9f67d3ccb213db3a5d149f0458987e855c08 100755
index f13f2ecd662a5fb985839b394b45319c091b56d4..21bc48324946d52ed2b1c9eec35c1fcd4c536570 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -202,60 +202,74 @@ def files(action):
Expand Down Expand Up @@ -2389,7 +2445,7 @@ index 9d5f4a48bca2c926b3ffb3c51c070222d4f7ce7b..c9ea9f67d3ccb213db3a5d149f045898
action(files_arg, dest)

@@ -282,7 +296,7 @@ def headers(action):
if sys.platform.startswith('aix'):
if sys.platform.startswith('aix') or sys.platform == "os400":
action(['out/Release/node.exp'], 'include/node/')

- subdir_files('deps/v8/include', 'include/node/', wanted_v8_headers)
Expand All @@ -2398,7 +2454,7 @@ index 9d5f4a48bca2c926b3ffb3c51c070222d4f7ce7b..c9ea9f67d3ccb213db3a5d149f045898
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 e295949a18508d7989f0925093a9dd6a284fecd6..8ba46c5d78c5c86d9f7b8b6972f3febbe87de61e 100755
index f9c202e861b986e3171aa21079c3b29f51fe0398..ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -131,6 +131,14 @@ def NormalizeFileName(filename):
Expand Down
Expand Up @@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.

diff --git a/common.gypi b/common.gypi
index 528ae2c370bc41fd245daea33ff8114cee68fce9..d56ed716c3245c9f89c750df232639318927749b 100644
index f3e0047fea1319034bf8b05b8d54d8a4ef181b4b..be0289ea7df50d7c2cb002c6343b75014729c923 100644
--- a/common.gypi
+++ b/common.gypi
@@ -79,6 +79,8 @@
Expand Down Expand Up @@ -40,10 +40,10 @@ index 528ae2c370bc41fd245daea33ff8114cee68fce9..d56ed716c3245c9f89c750df23263931
'defines': [
'V8_COMPRESS_POINTERS',
diff --git a/configure.py b/configure.py
index bfa20f5fc7a64b30b464327f4086a027e9a23359..f9d849260c3d7b1368d375125ae587eaa396c49e 100755
index 03ccbae0a1a837a382b98b828990d5a511f7a9d7..b5c747971a10b549007a8a3247aa5bd8058f311f 100755
--- a/configure.py
+++ b/configure.py
@@ -1517,6 +1517,7 @@ def configure_library(lib, output, pkgname=None):
@@ -1529,6 +1529,7 @@ def configure_library(lib, output, pkgname=None):


def configure_v8(o):
Expand All @@ -52,7 +52,7 @@ index bfa20f5fc7a64b30b464327f4086a027e9a23359..f9d849260c3d7b1368d375125ae587ea
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
diff --git a/src/node.h b/src/node.h
index 173e0bc669a2fd90e764da72e09003f4c7311fd7..03f55b0a1853c055eb6c709a8e7916c2a95672d3 100644
index 4b9b416e77b07407eae7b9587705b74ad3e6f211..deefda5c684c062f3c707fbdee30878a74d5dbb0 100644
--- a/src/node.h
+++ b/src/node.h
@@ -22,6 +22,12 @@
Expand Down
Expand Up @@ -8,7 +8,7 @@ Aligns common.gypi with the current build flag state of //v8.
Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`.

diff --git a/common.gypi b/common.gypi
index 497a73ed8a7515292eb65435b9b8a44dcaa57899..528ae2c370bc41fd245daea33ff8114cee68fce9 100644
index 543ede0020fd79251bdd9eac897d9a0e330ef239..f3e0047fea1319034bf8b05b8d54d8a4ef181b4b 100644
--- a/common.gypi
+++ b/common.gypi
@@ -65,6 +65,7 @@
Expand Down Expand Up @@ -42,10 +42,10 @@ index 497a73ed8a7515292eb65435b9b8a44dcaa57899..528ae2c370bc41fd245daea33ff8114c
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}],
diff --git a/configure.py b/configure.py
index 62c01aaf6a386d24e82289554520140f03699c95..bfa20f5fc7a64b30b464327f4086a027e9a23359 100755
index 40e0395ebd2c3cbcff587294bf9f1646dcab21aa..03ccbae0a1a837a382b98b828990d5a511f7a9d7 100755
--- a/configure.py
+++ b/configure.py
@@ -1530,6 +1530,7 @@ def configure_v8(o):
@@ -1542,6 +1542,7 @@ def configure_v8(o):
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
Expand Down
Expand Up @@ -14,7 +14,7 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded
through LoadEmbedderJavaScriptSource()

diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
index bc4555584ab1f97806a1e9cd17085a2488320908..b17dbf2a98c9f4b14fea60c87f05afcee6ec54fb 100644
index ce885c154c81c5703365fa34957697698da9aff6..229b0d522aeee3632145c86715bea1394d496bc4 100644
--- a/lib/internal/fs/watchers.js
+++ b/lib/internal/fs/watchers.js
@@ -293,11 +293,13 @@ function emitCloseNT(self) {
Expand All @@ -24,7 +24,7 @@ index bc4555584ab1f97806a1e9cd17085a2488320908..b17dbf2a98c9f4b14fea60c87f05afce
-ObjectDefineProperty(FSEvent.prototype, 'owner', {
- __proto__: null,
- get() { return this[owner_symbol]; },
- set(v) { return this[owner_symbol] = v; }
- set(v) { return this[owner_symbol] = v; },
-});
+if (!'owner' in FSEvent.prototype) {
+ ObjectDefineProperty(FSEvent.prototype, 'owner', {
Expand Down Expand Up @@ -61,7 +61,7 @@ index 90b158b84bb2a66781cf92f5b4c1a64f9e2ee651..8d9f7c409659a30747e5feeac6cfec42

std::vector<std::string> GetBuiltinIds();
diff --git a/tools/js2c.py b/tools/js2c.py
index 8ba46c5d78c5c86d9f7b8b6972f3febbe87de61e..38057495e04eba46ca87f6a0ea607f0fff46846e 100755
index ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb..ece70a8d7a1fdca051d4b821ba114be54bd34e4e 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -39,6 +39,8 @@ import codecs
Expand Down
Expand Up @@ -8,7 +8,7 @@ modules from being used in the renderer process. This should be upstreamed as
a customizable error message.

diff --git a/src/node_binding.cc b/src/node_binding.cc
index 175d0bee02d3592891f671533857b737057ab684..cf1cbcd54448754c7199a128b5447945aecf3e92 100644
index 5093c3e53cee6d0ad9a9100b487549c3b4e7ae46..3e7b796fe5d285289e409985a5dba77b0d230910 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -4,6 +4,7 @@
Expand All @@ -19,7 +19,7 @@ index 175d0bee02d3592891f671533857b737057ab684..cf1cbcd54448754c7199a128b5447945
#include "util.h"

#include <string>
@@ -474,7 +475,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
@@ -475,7 +476,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
if (mp->nm_context_register_func == nullptr) {
if (env->force_context_aware()) {
dlib->Close();
Expand Down

0 comments on commit de192c2

Please sign in to comment.