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

Commit a2ca4b7

Browse files
electron-roller[bot]codebytere
authored andcommitted
chore: bump node to v16.17.0 (main) (electron#35350)
* chore: bump node in DEPS to v16.17.0 * chore: fixup asar patch * lib: use null-prototype objects for property descriptors nodejs/node#43270 * src: make SecureContext fields private nodejs/node#43173 * crypto: remove Node.js-specific webcrypto extensions nodejs/node#43310 * test: refactor to top-level await nodejs/node#43500 * deps: cherry-pick two libuv fixes nodejs/node#43950 * src: slim down env-inl.h nodejs/node#43745 * util: add AggregateError.prototype.errors to inspect output nodejs/node#43646 * esm: improve performance & tidy tests nodejs/node#43784 * src: NodeArrayBufferAllocator delegates to v8's allocator nodejs/node#43594 * chore: update patch indices * chore: update filenames * src: refactor IsSupportedAuthenticatedMode nodejs/node#42368 * src: add --openssl-legacy-provider option nodejs/node#40478 * lib,src: add source map support for global eval nodejs/node#43428 * trace_events: trace net connect event nodejs/node#43903 * deps: update ICU to 71.1 nodejs/node#42655 This fails the test because it's missing https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3841093 * lib: give names to promisified exists() and question() nodejs/node#43218 * crypto: add CFRG curves to Web Crypto API nodejs/node#42507 * src: fix memory leak for v8.serialize nodejs/node#42695 This test does not work for Electron as they do not use V8's ArrayBufferAllocator. * buffer: fix atob input validation nodejs/node#42539 * src: fix ssize_t error from nghttp2.h nodejs/node#44393 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]>
1 parent c62f06a commit a2ca4b7

File tree

37 files changed

+383
-465
lines changed

37 files changed

+383
-465
lines changed

DEPS

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars = {
44
'chromium_version':
55
'106.0.5216.0',
66
'node_version':
7-
'v16.16.0',
7+
'v16.17.0',
88
'nan_version':
99
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
1010
'squirrel.mac_version':

lib/asar/fs-wrapper.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
263263
};
264264

265265
const { lstat } = fs;
266-
fs.lstat = function (pathArgument: string, options: any, callback: any) {
266+
fs.lstat = (pathArgument: string, options: any, callback: any) => {
267267
const pathInfo = splitPath(pathArgument);
268268
if (typeof options === 'function') {
269269
callback = options;
@@ -382,10 +382,10 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
382382

383383
fs.promises.realpath = util.promisify(fs.realpath.native);
384384

385-
const { exists } = fs;
386-
fs.exists = (pathArgument: string, callback: any) => {
385+
const { exists: nativeExists } = fs;
386+
fs.exists = function exists (pathArgument: string, callback: any) {
387387
const pathInfo = splitPath(pathArgument);
388-
if (!pathInfo.isAsar) return exists(pathArgument, callback);
388+
if (!pathInfo.isAsar) return nativeExists(pathArgument, callback);
389389
const { asarPath, filePath } = pathInfo;
390390

391391
const archive = getOrCreateArchive(asarPath);
@@ -399,9 +399,9 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
399399
nextTick(callback, [pathExists]);
400400
};
401401

402-
fs.exists[util.promisify.custom] = (pathArgument: string) => {
402+
fs.exists[util.promisify.custom] = function exists (pathArgument: string) {
403403
const pathInfo = splitPath(pathArgument);
404-
if (!pathInfo.isAsar) return exists[util.promisify.custom](pathArgument);
404+
if (!pathInfo.isAsar) return nativeExists[util.promisify.custom](pathArgument);
405405
const { asarPath, filePath } = pathInfo;
406406

407407
const archive = getOrCreateArchive(asarPath);

patches/node/.patches

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
1919
fix_crash_caused_by_gethostnamew_on_windows_7.patch
2020
fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
2121
fix_serdes_test.patch
22-
darwin_remove_eprototype_error_workaround_3405.patch
23-
darwin_translate_eprototype_to_econnreset_3413.patch
2422
darwin_bump_minimum_supported_version_to_10_15_3406.patch
2523
fix_failing_node_js_test_on_outdated.patch
2624
be_compatible_with_cppgc.patch
@@ -46,4 +44,4 @@ support_v8_sandboxed_pointers.patch
4644
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
4745
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
4846
fix_override_createjob_in_node_platform.patch
49-
buffer_fix_atob_input_validation.patch
47+
src_fix_ssize_t_error_from_nghttp2_h.patch

patches/node/be_compatible_with_cppgc.patch

+27-28
Original file line numberDiff line numberDiff line change
@@ -45,53 +45,52 @@ This patch should be upstreamed to Node.
4545

4646
See also: https://source.chromium.org/chromium/chromium/src/+/main:v8/include/v8-cppgc.h;l=70-76;drc=5a758a97032f0b656c3c36a3497560762495501a
4747

48-
diff --git a/src/base_object-inl.h b/src/base_object-inl.h
49-
index bb1e8d4b46bce3bf08f730ac5d43f7113d17ae39..6da0669943fc6465ffc47a1c8c3dadfea6beb1c9 100644
50-
--- a/src/base_object-inl.h
51-
+++ b/src/base_object-inl.h
52-
@@ -32,10 +32,21 @@
48+
diff --git a/src/base_object.h b/src/base_object.h
49+
index 842f763a56d75c55509534e3d44a8080dd283127..b6078fe83c82a5edec0f7652b8c2d1b6c2491ca4 100644
50+
--- a/src/base_object.h
51+
+++ b/src/base_object.h
52+
@@ -40,7 +40,7 @@ class TransferData;
53+
54+
class BaseObject : public MemoryRetainer {
55+
public:
56+
- enum InternalFields { kSlot, kInternalFieldCount };
57+
+ enum InternalFields { kWrapperType, kSlot, kInternalFieldCount };
5358

54-
namespace node {
59+
// Associates this object with `object`. It uses the 0th internal field for
60+
// that, and in particular aborts if there is no such field.
61+
diff --git a/src/env.cc b/src/env.cc
62+
index 22be69ec30a5b8466caacc698c791494891e5dee..cc44d578df9e146aa72f8273c1271d6a3c00d610 100644
63+
--- a/src/env.cc
64+
+++ b/src/env.cc
65+
@@ -2119,11 +2119,20 @@ void Environment::RunWeakRefCleanup() {
66+
isolate()->ClearKeptObjects();
67+
}
5568

56-
+namespace {
5769
+// This just has to be different from the Chromium ones:
5870
+// https://source.chromium.org/chromium/chromium/src/+/main:gin/public/gin_embedders.h;l=18-23;drc=5a758a97032f0b656c3c36a3497560762495501a
5971
+// Otherwise, when Node is loaded in an isolate which uses cppgc, cppgc will
6072
+// misinterpret the data stored in the embedder fields and try to garbage
6173
+// collect them.
62-
+static uint16_t kNodeEmbedderId = 0x90de;
63-
+}
74+
+uint16_t kNodeEmbedderId = 0x90de;
6475
+
65-
BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> object)
76+
// Not really any better place than env.cc at this moment.
77+
BaseObject::BaseObject(Environment* env, Local<Object> object)
6678
: persistent_handle_(env->isolate(), object), env_(env) {
6779
CHECK_EQ(false, object.IsEmpty());
6880
- CHECK_GT(object->InternalFieldCount(), 0);
6981
+ CHECK_GT(object->InternalFieldCount(), BaseObject::kSlot);
7082
+ object->SetAlignedPointerInInternalField(BaseObject::kWrapperType,
7183
+ &kNodeEmbedderId);
72-
object->SetAlignedPointerInInternalField(
73-
BaseObject::kSlot,
74-
static_cast<void*>(this));
75-
@@ -151,7 +162,8 @@ bool BaseObject::IsWeakOrDetached() const {
84+
object->SetAlignedPointerInInternalField(BaseObject::kSlot,
85+
static_cast<void*>(this));
86+
env->AddCleanupHook(DeleteMe, static_cast<void*>(this));
87+
@@ -2177,7 +2186,8 @@ void BaseObject::MakeWeak() {
7688
void BaseObject::LazilyInitializedJSTemplateConstructor(
77-
const v8::FunctionCallbackInfo<v8::Value>& args) {
89+
const FunctionCallbackInfo<Value>& args) {
7890
DCHECK(args.IsConstructCall());
7991
- DCHECK_GT(args.This()->InternalFieldCount(), 0);
8092
+ DCHECK_GT(args.This()->InternalFieldCount(), BaseObject::kSlot);
8193
+ args.This()->SetAlignedPointerInInternalField(BaseObject::kWrapperType, &kNodeEmbedderId);
8294
args.This()->SetAlignedPointerInInternalField(BaseObject::kSlot, nullptr);
8395
}
8496

85-
diff --git a/src/base_object.h b/src/base_object.h
86-
index 1c63da92fd80c042d5ea729bdd70049cae51a141..3b8127e884187b21cebeabb39b60bd3010b62217 100644
87-
--- a/src/base_object.h
88-
+++ b/src/base_object.h
89-
@@ -40,7 +40,7 @@ class TransferData;
90-
91-
class BaseObject : public MemoryRetainer {
92-
public:
93-
- enum InternalFields { kSlot, kInternalFieldCount };
94-
+ enum InternalFields { kWrapperType, kSlot, kInternalFieldCount };
95-
96-
// Associates this object with `object`. It uses the 0th internal field for
97-
// that, and in particular aborts if there is no such field.

patches/node/buffer_fix_atob_input_validation.patch

-89
This file was deleted.

patches/node/build_add_gn_build_files.patch

+19-10
Original file line numberDiff line numberDiff line change
@@ -1008,10 +1008,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
10081008
+}
10091009
diff --git a/filenames.json b/filenames.json
10101010
new file mode 100644
1011-
index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6de1bd518
1011+
index 0000000000000000000000000000000000000000..13fd1469ef0aa33853ddc6f31eda5b15f6312138
10121012
--- /dev/null
10131013
+++ b/filenames.json
1014-
@@ -0,0 +1,616 @@
1014+
@@ -0,0 +1,625 @@
10151015
+// This file is automatically generated by generate_gn_filenames_json.py
10161016
+// DO NOT EDIT
10171017
+{
@@ -1147,6 +1147,7 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
11471147
+ "lib/child_process.js",
11481148
+ "lib/assert.js",
11491149
+ "lib/_tls_wrap.js",
1150+
+ "lib/test.js",
11501151
+ "lib/http2.js",
11511152
+ "lib/inspector.js",
11521153
+ "lib/os.js",
@@ -1242,13 +1243,19 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
12421243
+ "lib/internal/http.js",
12431244
+ "lib/internal/buffer.js",
12441245
+ "lib/internal/trace_events_async_hooks.js",
1246+
+ "lib/internal/v8/startup_snapshot.js",
1247+
+ "lib/internal/test_runner/test.js",
1248+
+ "lib/internal/test_runner/harness.js",
1249+
+ "lib/internal/test_runner/utils.js",
1250+
+ "lib/internal/test_runner/tap_stream.js",
12451251
+ "lib/internal/crypto/sig.js",
12461252
+ "lib/internal/crypto/rsa.js",
12471253
+ "lib/internal/crypto/aes.js",
12481254
+ "lib/internal/crypto/util.js",
12491255
+ "lib/internal/crypto/scrypt.js",
12501256
+ "lib/internal/crypto/random.js",
12511257
+ "lib/internal/crypto/keys.js",
1258+
+ "lib/internal/crypto/cfrg.js",
12521259
+ "lib/internal/crypto/x509.js",
12531260
+ "lib/internal/crypto/certificate.js",
12541261
+ "lib/internal/crypto/ec.js",
@@ -1260,7 +1267,6 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
12601267
+ "lib/internal/crypto/hash.js",
12611268
+ "lib/internal/crypto/pbkdf2.js",
12621269
+ "lib/internal/crypto/webcrypto.js",
1263-
+ "lib/internal/crypto/dsa.js",
12641270
+ "lib/internal/crypto/hashnames.js",
12651271
+ "lib/internal/cluster/shared_handle.js",
12661272
+ "lib/internal/cluster/round_robin_handle.js",
@@ -1293,6 +1299,8 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
12931299
+ "lib/internal/util/debuglog.js",
12941300
+ "lib/internal/util/inspect.js",
12951301
+ "lib/internal/util/iterable_weak_map.js",
1302+
+ "lib/internal/util/parse_args/utils.js",
1303+
+ "lib/internal/util/parse_args/parse_args.js",
12961304
+ "lib/internal/streams/add-abort-signal.js",
12971305
+ "lib/internal/streams/compose.js",
12981306
+ "lib/internal/streams/duplexify.js",
@@ -1342,7 +1350,9 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
13421350
+ "lib/internal/main/eval_string.js",
13431351
+ "lib/internal/main/check_syntax.js",
13441352
+ "lib/internal/main/prof_process.js",
1353+
+ "lib/internal/main/test_runner.js",
13451354
+ "lib/internal/main/worker_thread.js",
1355+
+ "lib/internal/main/mksnapshot.js",
13461356
+ "lib/internal/main/inspect.js",
13471357
+ "lib/internal/main/eval_stdin.js",
13481358
+ "lib/internal/main/run_main_module.js",
@@ -1351,7 +1361,6 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
13511361
+ "lib/internal/modules/esm/module_job.js",
13521362
+ "lib/internal/modules/esm/assert.js",
13531363
+ "lib/internal/modules/esm/fetch_module.js",
1354-
+ "lib/internal/modules/esm/get_source.js",
13551364
+ "lib/internal/modules/esm/translators.js",
13561365
+ "lib/internal/modules/esm/resolve.js",
13571366
+ "lib/internal/modules/esm/create_dynamic_module.js",
@@ -1387,6 +1396,7 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
13871396
+ "lib/internal/perf/utils.js",
13881397
+ "lib/internal/perf/observe.js",
13891398
+ "lib/internal/perf/event_loop_delay.js",
1399+
+ "lib/internal/perf/resource_timing.js",
13901400
+ "lib/internal/perf/event_loop_utilization.js",
13911401
+ "lib/internal/policy/manifest.js",
13921402
+ "lib/internal/policy/sri.js",
@@ -1523,8 +1533,6 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
15231533
+ "src/aliased_buffer.h",
15241534
+ "src/aliased_struct.h",
15251535
+ "src/aliased_struct-inl.h",
1526-
+ "src/allocated_buffer.h",
1527-
+ "src/allocated_buffer-inl.h",
15281536
+ "src/async_wrap.h",
15291537
+ "src/async_wrap-inl.h",
15301538
+ "src/base_object.h",
@@ -1589,6 +1597,7 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
15891597
+ "src/node_revert.h",
15901598
+ "src/node_root_certs.h",
15911599
+ "src/node_snapshotable.h",
1600+
+ "src/node_snapshot_builder.h",
15921601
+ "src/node_sockaddr.h",
15931602
+ "src/node_sockaddr-inl.h",
15941603
+ "src/node_stat_watcher.h",
@@ -1869,7 +1878,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
18691878
+ args = rebase_path(inputs + outputs, root_build_dir)
18701879
+}
18711880
diff --git a/src/node_version.h b/src/node_version.h
1872-
index 0f1a9b52cccba1e54150494a7ee5b28961a8d59d..bb68b2dfef4a693d8a1d0fe056fe696254d12d09 100644
1881+
index d79d640b693993ee9db938e857e34629410ca1e4..f7571a5e669c539bfdce14b18acdb778f8570383 100644
18731882
--- a/src/node_version.h
18741883
+++ b/src/node_version.h
18751884
@@ -89,7 +89,10 @@
@@ -1996,10 +2005,10 @@ index 0000000000000000000000000000000000000000..2a92eccfa582df361f2a889c0d9b32c1
19962005
+
19972006
+ out_file.writelines(new_contents)
19982007
diff --git a/tools/install.py b/tools/install.py
1999-
index 8a050dfa7c8b771ceb30fd2b74dc47f3de96834c..ad3bee1660de26d3502c6247f23b091171a6416c 100755
2008+
index a6d1f8b3caa8e24148b1930ea109508f8e612735..c80c1b8202ba59bd63340baca36df8bca5e1f81d 100755
20002009
--- a/tools/install.py
20012010
+++ b/tools/install.py
2002-
@@ -172,17 +172,72 @@ def files(action):
2011+
@@ -202,17 +202,72 @@ def files(action):
20032012
def headers(action):
20042013
def wanted_v8_headers(files_arg, dest):
20052014
v8_headers = [
@@ -2082,7 +2091,7 @@ index 8a050dfa7c8b771ceb30fd2b74dc47f3de96834c..ad3bee1660de26d3502c6247f23b0911
20822091
files_arg = [name for name in files_arg if name in v8_headers]
20832092
action(files_arg, dest)
20842093

2085-
@@ -209,7 +264,7 @@ def headers(action):
2094+
@@ -239,7 +294,7 @@ def headers(action):
20862095
if sys.platform.startswith('aix'):
20872096
action(['out/Release/node.exp'], 'include/node/')
20882097

0 commit comments

Comments
 (0)