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

Commit

Permalink
chore: bump node to v16.15.0 (main) (electron#33947)
Browse files Browse the repository at this point in the history
* chore: bump node in DEPS to v16.15.0

* chore: update patches

* src: allow preventing InitializeInspector in env

nodejs/node#35025

* chore: update node gn filenames

* crypto: change default check(Host|Email) behavior

* Revert "crypto: change default check(Host|Email) behavior"

This reverts commit 1f1eb23.

* update node crypto tests to work with boringssl

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
  • Loading branch information
2 people authored and khalwa committed Feb 22, 2023
1 parent b8e5852 commit 6095bd1
Show file tree
Hide file tree
Showing 23 changed files with 111 additions and 182 deletions.
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'102.0.4999.0',
'node_version':
'v16.14.2',
'v16.15.0',
'nan_version':
# The following commit hash of NAN is v2.14.2 with *only* changes to the
# test suite. This should be updated to a specific tag when one becomes
Expand Down
2 changes: 0 additions & 2 deletions patches/node/.patches
Expand Up @@ -13,7 +13,6 @@ chore_read_nobrowserglobals_from_global_not_process.patch
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
fix_handle_boringssl_and_openssl_incompatibilities.patch
fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch
fix_allow_preventing_initializeinspector_in_env.patch
src_allow_embedders_to_provide_a_custom_pageallocator_to.patch
fix_crypto_tests_to_run_with_bssl.patch
fix_account_for_debugger_agent_race_condition.patch
Expand All @@ -22,7 +21,6 @@ fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
chore_fix_-wimplicit-fallthrough.patch
fix_crash_caused_by_gethostnamew_on_windows_7.patch
fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
fix_don_t_create_console_window_when_creating_process.patch
fix_serdes_test.patch
darwin_remove_eprototype_error_workaround_3405.patch
darwin_translate_eprototype_to_econnreset_3413.patch
Expand Down
12 changes: 8 additions & 4 deletions patches/node/build_add_gn_build_files.patch
Expand Up @@ -973,10 +973,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..d2d196a59037ed32800ab6981c6a7424afb63ca5
index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6de1bd518
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,612 @@
@@ -0,0 +1,616 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
Expand Down Expand Up @@ -1233,6 +1233,7 @@ index 0000000000000000000000000000000000000000..d2d196a59037ed32800ab6981c6a7424
+ "lib/internal/cluster/primary.js",
+ "lib/internal/cluster/utils.js",
+ "lib/internal/cluster/child.js",
+ "lib/internal/webstreams/compression.js",
+ "lib/internal/webstreams/util.js",
+ "lib/internal/webstreams/writablestream.js",
+ "lib/internal/webstreams/readablestream.js",
Expand Down Expand Up @@ -1314,6 +1315,7 @@ index 0000000000000000000000000000000000000000..d2d196a59037ed32800ab6981c6a7424
+ "lib/internal/modules/package_json_reader.js",
+ "lib/internal/modules/esm/module_job.js",
+ "lib/internal/modules/esm/assert.js",
+ "lib/internal/modules/esm/fetch_module.js",
+ "lib/internal/modules/esm/get_source.js",
+ "lib/internal/modules/esm/translators.js",
+ "lib/internal/modules/esm/resolve.js",
Expand All @@ -1323,6 +1325,7 @@ index 0000000000000000000000000000000000000000..d2d196a59037ed32800ab6981c6a7424
+ "lib/internal/modules/esm/initialize_import_meta.js",
+ "lib/internal/modules/esm/module_map.js",
+ "lib/internal/modules/esm/get_format.js",
+ "lib/internal/modules/esm/formats.js",
+ "lib/internal/modules/esm/loader.js",
+ "lib/internal/modules/cjs/helpers.js",
+ "lib/internal/modules/cjs/loader.js",
Expand Down Expand Up @@ -1381,7 +1384,8 @@ index 0000000000000000000000000000000000000000..d2d196a59037ed32800ab6981c6a7424
+ "deps/acorn/acorn/dist/acorn.js",
+ "deps/acorn/acorn-walk/dist/walk.js",
+ "deps/cjs-module-lexer/lexer.js",
+ "deps/cjs-module-lexer/dist/lexer.js"
+ "deps/cjs-module-lexer/dist/lexer.js",
+ "deps/undici/undici.js"
+ ],
+ "node_sources": [
+ "src/api/async_resource.cc",
Expand Down Expand Up @@ -1795,7 +1799,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 41081f82714169f3bf388c3a8c2d9aa78e21a3f4..48c0d2655789a0528dfea0a60f756aacb48a6f60 100644
index 29c9be6366d63be7b340b35cea141e4d7e7f71cc..587735f2ddc0e5d93edd8644d121c6fb31fc4378 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down
Expand Up @@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
of this.

diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 3c5e6fe40070f52d8b3f4e9757485845c1d6dbed..2af6b11c97ecdca3c40792ab35c69b07b9db76a0 100644
index b184a0d9ae3434af746be269495e9e4c80c58091..899d5a906683e8967746e10a6de452e99e236903 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -95,11 +95,13 @@ function patchProcessObject(expandArgv1) {
@@ -103,11 +103,13 @@ function patchProcessObject(expandArgv1) {
if (expandArgv1 && process.argv[1] &&
!StringPrototypeStartsWith(process.argv[1], '-')) {
// Expand process.argv[1] into a full path.
Expand All @@ -31,10 +31,10 @@ index 3c5e6fe40070f52d8b3f4e9757485845c1d6dbed..2af6b11c97ecdca3c40792ab35c69b07
}

diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index caca939942cb721a3efde7005b0a987a19237a8b..2d30a56a87ff8657cddb3d9e6af5bd9f81deffdb 100644
index 5195ff2da0496f2bfb9112d336c38040f662087b..5c62e367f2dd7d112096551f1c34ee67ce1a5c3a 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1077,6 +1077,13 @@ Module.prototype._compile = function(content, filename) {
@@ -1079,6 +1079,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 Down
10 changes: 5 additions & 5 deletions patches/node/chore_fix_-wimplicit-fallthrough.patch
Expand Up @@ -18,10 +18,10 @@ index 8bfecba74d4d90e9fbf0e2cd301118e4adc6cba8..63e1149f0c4a39cb944114e5824d6074
"-Wno-unreachable-code-return",
"-Wno-unused-but-set-variable",
diff --git a/deps/nghttp2/lib/nghttp2_hd.c b/deps/nghttp2/lib/nghttp2_hd.c
index 5e8693152599215261e47b152d565bbd9a0083e7..6d54e91dea6d77ad8925ad0452fd2a0a36f35f73 100644
index 30ee9b88920c0a0bb8f8b714e3deabe0207cac40..010edf48f614c23e971df0f37716275cc1656469 100644
--- a/deps/nghttp2/lib/nghttp2_hd.c
+++ b/deps/nghttp2/lib/nghttp2_hd.c
@@ -1891,7 +1891,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
@@ -1892,7 +1892,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
rv = NGHTTP2_ERR_HEADER_COMP;
goto fail;
}
Expand All @@ -30,7 +30,7 @@ index 5e8693152599215261e47b152d565bbd9a0083e7..6d54e91dea6d77ad8925ad0452fd2a0a
case NGHTTP2_HD_STATE_INFLATE_START:
case NGHTTP2_HD_STATE_OPCODE:
if ((*in & 0xe0u) == 0x20u) {
@@ -2001,7 +2001,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
@@ -2002,7 +2002,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
inflater->left = 0;
inflater->shift = 0;
DEBUGF("inflatehd: huffman encoded=%d\n", inflater->huffman_encoded != 0);
Expand All @@ -39,7 +39,7 @@ index 5e8693152599215261e47b152d565bbd9a0083e7..6d54e91dea6d77ad8925ad0452fd2a0a
case NGHTTP2_HD_STATE_NEWNAME_READ_NAMELEN:
rfin = 0;
rv = hd_inflate_read_len(inflater, &rfin, in, last, 7, NGHTTP2_HD_MAX_NV);
@@ -2085,7 +2085,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
@@ -2086,7 +2086,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
inflater->left = 0;
inflater->shift = 0;
DEBUGF("inflatehd: huffman encoded=%d\n", inflater->huffman_encoded != 0);
Expand All @@ -49,7 +49,7 @@ index 5e8693152599215261e47b152d565bbd9a0083e7..6d54e91dea6d77ad8925ad0452fd2a0a
rfin = 0;
rv = hd_inflate_read_len(inflater, &rfin, in, last, 7, NGHTTP2_HD_MAX_NV);
diff --git a/deps/nghttp2/lib/nghttp2_session.c b/deps/nghttp2/lib/nghttp2_session.c
index 36f1179f72a22595dda0b98927d87e2098cad4df..f007dbf410b1bdc5d1f603aa85c3a4f0704e9741 100644
index 380a47c1b1e82b015c271e2818aed0baf982aa2d..2f3997709cd07f6f8294f985f60b2e1e4b85a2cf 100644
--- a/deps/nghttp2/lib/nghttp2_session.c
+++ b/deps/nghttp2/lib/nghttp2_session.c
@@ -2644,10 +2644,10 @@ static int session_after_frame_sent1(nghttp2_session *session) {
Expand Down
Expand Up @@ -7,7 +7,7 @@ This is used so that we can modify the flag at runtime where
config can only be set at compile time.

diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 085dd7e09d31fb1800b3596cc068637e1956ba52..9e0f811b2a37f45a9d8162dff7c9d5c935b856d6 100644
index 8c31d0202b70ec9784b4289a175a62fd9fd85f8c..2b4c7a933d7f87050f7342e6c3ae2070e3dde030 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -209,7 +209,7 @@ const {
Expand Down
Expand Up @@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
out in memory on 64-bit machines, and will summarily fail to work.

diff --git a/common.gypi b/common.gypi
index b86c3f3bbeddfa57c223ff066451fd3e1ce1315d..59e6a857060a35ca52cff2b44bc412a3f5e8eece 100644
index 3fd1d4ddddc109dfd87f4ba6115948f1c31b1261..7ffd577817d3c6ae7164dd3945479aedcee9640e 100644
--- a/common.gypi
+++ b/common.gypi
@@ -64,7 +64,7 @@
Expand All @@ -20,7 +20,7 @@ index b86c3f3bbeddfa57c223ff066451fd3e1ce1315d..59e6a857060a35ca52cff2b44bc412a3

# Disable V8 untrusted code mitigations.
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
@@ -130,6 +130,9 @@
@@ -133,6 +133,9 @@
'v8_enable_pointer_compression': 0,
'v8_enable_31bit_smis_on_64bit_arch': 0,
}],
Expand Down
Expand Up @@ -7,11 +7,11 @@ Subject: feat: add kNoStartDebugSignalHandler to Environment to prevent
This patch should be upstreamed, it allows embedders to prevent the call to StartDebugSignalHandler which handles SIGUSR1 and starts the inspector agent. Apps that have --inspect disabled also don't want SIGUSR1 to have this affect.

diff --git a/src/env-inl.h b/src/env-inl.h
index 2da8174fe9e4209f4705af0a1cf8bca5928f088c..954602f3fc7c3344509bb57530840bb1dfeacab3 100644
index 4a34393cad7e071bf27947418be6b3d9bdd42f98..b9834a797c89f707d1e4978587af66ebf11591d4 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -886,6 +886,10 @@ inline bool Environment::should_initialize_inspector() const {
return (flags_ & EnvironmentFlags::kNoInitializeInspector) == 0;
@@ -886,6 +886,10 @@ inline bool Environment::no_global_search_paths() const {
!options_->global_search_paths;
}

+inline bool Environment::should_start_debug_signal_handler() const {
Expand All @@ -22,22 +22,22 @@ index 2da8174fe9e4209f4705af0a1cf8bca5928f088c..954602f3fc7c3344509bb57530840bb1
return emit_filehandle_warning_;
}
diff --git a/src/env.h b/src/env.h
index 2554c530f2ca7078ed0cca03968b31f56027231b..1fbf965788f9c68d2999f38b40d39579f746d768 100644
index cda7a52fa1ffc66d7ba42de3a275f49093f8557d..86f3c718ada13ee71e5af87e1b3772f39274cf43 100644
--- a/src/env.h
+++ b/src/env.h
@@ -1216,6 +1216,7 @@ class Environment : public MemoryRetainer {
inline bool tracks_unmanaged_fds() const;
inline bool hide_console_windows() const;
inline bool no_global_search_paths() const;
inline bool should_initialize_inspector() const;
+ inline bool should_start_debug_signal_handler() const;
inline uint64_t thread_id() const;
inline worker::Worker* worker_context() const;
Environment* worker_parent_env() const;
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index fd9f514b9b6a7b7b1c1a6f5fe834f51266156596..14565f6885b3f88194b3b8efb340a4099ca1966c 100644
index 5fc533741d7c8d7a8471b3c3c6a334c0e9e43501..2c36a0b132cf1b21595ac39619b99d316ad81d9e 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -680,8 +680,10 @@ bool Agent::Start(const std::string& path,
@@ -690,8 +690,10 @@ bool Agent::Start(const std::string& path,
StartIoThreadAsyncCallback));
uv_unref(reinterpret_cast<uv_handle_t*>(&start_io_thread_async));
start_io_thread_async.data = this;
Expand All @@ -51,19 +51,19 @@ index fd9f514b9b6a7b7b1c1a6f5fe834f51266156596..14565f6885b3f88194b3b8efb340a409
parent_env_->AddCleanupHook([](void* data) {
Environment* env = static_cast<Environment*>(data);
diff --git a/src/node.h b/src/node.h
index b2b766f242e02593631be087fceaf63f71d74284..535df2d8dfb48ddc4d01e94565fdc527aed15ef7 100644
index 0a9f5139276eb2e102b41a586adf61fa563b47d6..0b807cb25f9eb52b2100f0e2a7c25344790967cf 100644
--- a/src/node.h
+++ b/src/node.h
@@ -444,7 +444,11 @@ enum Flags : uint64_t {
// Controls whether or not the Environment should call InitializeInspector.
@@ -445,7 +445,11 @@ enum Flags : uint64_t {
// This control is needed by embedders who may not want to initialize the V8
// inspector in situations where it already exists.
- kNoInitializeInspector = 1 << 8
+ kNoInitializeInspector = 1 << 8,
// inspector in situations where one has already been created,
// e.g. Blink's in Chromium.
- kNoCreateInspector = 1 << 9
+ kNoCreateInspector = 1 << 9,
+ // Controls where or not the InspectorAgent for this Environment should
+ // call StartDebugSignalHandler. This control is needed by embedders who may
+ // not want to allow other processes to start the V8 inspector.
+ kNoStartDebugSignalHandler = 1 << 9
+ kNoStartDebugSignalHandler = 1 << 10
};
} // namespace EnvironmentFlags

6 changes: 3 additions & 3 deletions patches/node/feat_initialize_asar_support.patch
Expand Up @@ -6,18 +6,18 @@ Subject: feat: initialize asar support
This patch initializes asar support in Node.js.

diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index f21ba048b4863863e6c7b740f410775776a7649a..3c5e6fe40070f52d8b3f4e9757485845c1d6dbed 100644
index 8de57a5666131ff0c9f7ad844498e1bd3c357a70..b184a0d9ae3434af746be269495e9e4c80c58091 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -76,6 +76,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
@@ -84,6 +84,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
loadPreloadModules();
initializeFrozenIntrinsics();
+ setupAsarSupport();
}

function patchProcessObject(expandArgv1) {
@@ -477,6 +478,10 @@ function loadPreloadModules() {
@@ -540,6 +541,10 @@ function loadPreloadModules() {
}
}

Expand Down
Expand Up @@ -7,10 +7,10 @@ common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp.

diff --git a/common.gypi b/common.gypi
index be30169cf58d9759320f1763ede7e0ce89be3aa2..b86c3f3bbeddfa57c223ff066451fd3e1ce1315d 100644
index bdc2c105abeddc4c8e434ead05ebc0d7d82cfae8..3fd1d4ddddc109dfd87f4ba6115948f1c31b1261 100644
--- a/common.gypi
+++ b/common.gypi
@@ -81,6 +81,23 @@
@@ -84,6 +84,23 @@

##### end V8 defaults #####

Expand Down
Expand Up @@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi
This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this.

diff --git a/common.gypi b/common.gypi
index 59e6a857060a35ca52cff2b44bc412a3f5e8eece..7741f97758282d1c601eecf263cb4ce1510be284 100644
index 7ffd577817d3c6ae7164dd3945479aedcee9640e..6674f9f9b8880c40db579664fa40f62ad0139368 100644
--- a/common.gypi
+++ b/common.gypi
@@ -65,6 +65,7 @@
Expand All @@ -17,15 +17,15 @@ index 59e6a857060a35ca52cff2b44bc412a3f5e8eece..7741f97758282d1c601eecf263cb4ce1

# Disable V8 untrusted code mitigations.
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
@@ -79,6 +80,7 @@
@@ -82,6 +83,7 @@
# TODO(refack): make v8-perfetto happen
'v8_use_perfetto': 0,

+
##### end V8 defaults #####

# When building native modules using 'npm install' with the system npm,
@@ -398,6 +400,9 @@
@@ -401,6 +403,9 @@
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}],
Expand Down
81 changes: 0 additions & 81 deletions patches/node/fix_allow_preventing_initializeinspector_in_env.patch

This file was deleted.

0 comments on commit 6095bd1

Please sign in to comment.