Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump node to v16.17.0 (main) #35350

Merged
merged 23 commits into from
Aug 29, 2022
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
241b207
chore: bump node in DEPS to v16.17.0
electron-roller[bot] Aug 16, 2022
61e7fad
chore: fixup asar patch
codebytere Aug 22, 2022
30c7840
lib: use null-prototype objects for property descriptors
codebytere Aug 22, 2022
9aa457e
src: make SecureContext fields private
codebytere Aug 22, 2022
9828218
crypto: remove Node.js-specific webcrypto extensions
codebytere Aug 22, 2022
2dae231
test: refactor to top-level await
codebytere Aug 22, 2022
d90f914
deps: cherry-pick two libuv fixes
codebytere Aug 22, 2022
cd8b004
src: slim down env-inl.h
codebytere Aug 22, 2022
9afd11e
util: add AggregateError.prototype.errors to inspect output
codebytere Aug 22, 2022
e1bbdd2
esm: improve performance & tidy tests
codebytere Aug 22, 2022
734423c
src: NodeArrayBufferAllocator delegates to v8's allocator
codebytere Aug 23, 2022
f4ca633
chore: update patch indices
codebytere Aug 23, 2022
f7a5006
chore: update filenames
codebytere Aug 23, 2022
109a027
src: refactor IsSupportedAuthenticatedMode
codebytere Aug 23, 2022
6a969f5
src: add --openssl-legacy-provider option
codebytere Aug 23, 2022
1476ff6
lib,src: add source map support for global eval
codebytere Aug 24, 2022
28089cd
trace_events: trace net connect event
codebytere Aug 24, 2022
18d73b9
deps: update ICU to 71.1
codebytere Aug 24, 2022
16462bc
lib: give names to promisified exists() and question()
codebytere Aug 24, 2022
4829355
crypto: add CFRG curves to Web Crypto API
codebytere Aug 24, 2022
b9becbe
src: fix memory leak for v8.serialize
codebytere Aug 24, 2022
ed65e52
buffer: fix atob input validation
codebytere Aug 25, 2022
0f89c67
src: fix ssize_t error from nghttp2.h
codebytere Aug 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ vars = {
'chromium_version':
'106.0.5216.0',
'node_version':
'v16.16.0',
'v16.17.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
12 changes: 6 additions & 6 deletions lib/asar/fs-wrapper.ts
Original file line number Diff line number Diff line change
@@ -263,7 +263,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
};

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

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

const { exists } = fs;
fs.exists = (pathArgument: string, callback: any) => {
const { exists: nativeExists } = fs;
fs.exists = function exists (pathArgument: string, callback: any) {
const pathInfo = splitPath(pathArgument);
if (!pathInfo.isAsar) return exists(pathArgument, callback);
if (!pathInfo.isAsar) return nativeExists(pathArgument, callback);
const { asarPath, filePath } = pathInfo;

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

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

const archive = getOrCreateArchive(asarPath);
4 changes: 1 addition & 3 deletions patches/node/.patches
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@ chore_fix_-wimplicit-fallthrough.patch
fix_crash_caused_by_gethostnamew_on_windows_7.patch
fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
fix_serdes_test.patch
darwin_remove_eprototype_error_workaround_3405.patch
darwin_translate_eprototype_to_econnreset_3413.patch
darwin_bump_minimum_supported_version_to_10_15_3406.patch
fix_failing_node_js_test_on_outdated.patch
be_compatible_with_cppgc.patch
@@ -47,4 +45,4 @@ support_v8_sandboxed_pointers.patch
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
buffer_fix_atob_input_validation.patch
src_fix_ssize_t_error_from_nghttp2_h.patch
55 changes: 27 additions & 28 deletions patches/node/be_compatible_with_cppgc.patch
Original file line number Diff line number Diff line change
@@ -45,53 +45,52 @@ This patch should be upstreamed to Node.

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

diff --git a/src/base_object-inl.h b/src/base_object-inl.h
index bb1e8d4b46bce3bf08f730ac5d43f7113d17ae39..6da0669943fc6465ffc47a1c8c3dadfea6beb1c9 100644
--- a/src/base_object-inl.h
+++ b/src/base_object-inl.h
@@ -32,10 +32,21 @@
diff --git a/src/base_object.h b/src/base_object.h
index 842f763a56d75c55509534e3d44a8080dd283127..b6078fe83c82a5edec0f7652b8c2d1b6c2491ca4 100644
--- a/src/base_object.h
+++ b/src/base_object.h
@@ -40,7 +40,7 @@ class TransferData;

class BaseObject : public MemoryRetainer {
public:
- enum InternalFields { kSlot, kInternalFieldCount };
+ enum InternalFields { kWrapperType, kSlot, kInternalFieldCount };

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

+namespace {
+// This just has to be different from the Chromium ones:
+// https://source.chromium.org/chromium/chromium/src/+/main:gin/public/gin_embedders.h;l=18-23;drc=5a758a97032f0b656c3c36a3497560762495501a
+// Otherwise, when Node is loaded in an isolate which uses cppgc, cppgc will
+// misinterpret the data stored in the embedder fields and try to garbage
+// collect them.
+static uint16_t kNodeEmbedderId = 0x90de;
+}
+uint16_t kNodeEmbedderId = 0x90de;
+
BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> object)
// Not really any better place than env.cc at this moment.
BaseObject::BaseObject(Environment* env, Local<Object> object)
: persistent_handle_(env->isolate(), object), env_(env) {
CHECK_EQ(false, object.IsEmpty());
- CHECK_GT(object->InternalFieldCount(), 0);
+ CHECK_GT(object->InternalFieldCount(), BaseObject::kSlot);
+ object->SetAlignedPointerInInternalField(BaseObject::kWrapperType,
+ &kNodeEmbedderId);
object->SetAlignedPointerInInternalField(
BaseObject::kSlot,
static_cast<void*>(this));
@@ -151,7 +162,8 @@ bool BaseObject::IsWeakOrDetached() const {
object->SetAlignedPointerInInternalField(BaseObject::kSlot,
static_cast<void*>(this));
env->AddCleanupHook(DeleteMe, static_cast<void*>(this));
@@ -2177,7 +2186,8 @@ void BaseObject::MakeWeak() {
void BaseObject::LazilyInitializedJSTemplateConstructor(
const v8::FunctionCallbackInfo<v8::Value>& args) {
const FunctionCallbackInfo<Value>& args) {
DCHECK(args.IsConstructCall());
- DCHECK_GT(args.This()->InternalFieldCount(), 0);
+ DCHECK_GT(args.This()->InternalFieldCount(), BaseObject::kSlot);
+ args.This()->SetAlignedPointerInInternalField(BaseObject::kWrapperType, &kNodeEmbedderId);
args.This()->SetAlignedPointerInInternalField(BaseObject::kSlot, nullptr);
}

diff --git a/src/base_object.h b/src/base_object.h
index 1c63da92fd80c042d5ea729bdd70049cae51a141..3b8127e884187b21cebeabb39b60bd3010b62217 100644
--- a/src/base_object.h
+++ b/src/base_object.h
@@ -40,7 +40,7 @@ class TransferData;

class BaseObject : public MemoryRetainer {
public:
- enum InternalFields { kSlot, kInternalFieldCount };
+ enum InternalFields { kWrapperType, kSlot, kInternalFieldCount };

// Associates this object with `object`. It uses the 0th internal field for
// that, and in particular aborts if there is no such field.
89 changes: 0 additions & 89 deletions patches/node/buffer_fix_atob_input_validation.patch

This file was deleted.

29 changes: 19 additions & 10 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
@@ -1010,10 +1010,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6de1bd518
index 0000000000000000000000000000000000000000..13fd1469ef0aa33853ddc6f31eda5b15f6312138
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,616 @@
@@ -0,0 +1,625 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
@@ -1149,6 +1149,7 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "lib/child_process.js",
+ "lib/assert.js",
+ "lib/_tls_wrap.js",
+ "lib/test.js",
+ "lib/http2.js",
+ "lib/inspector.js",
+ "lib/os.js",
@@ -1244,13 +1245,19 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "lib/internal/http.js",
+ "lib/internal/buffer.js",
+ "lib/internal/trace_events_async_hooks.js",
+ "lib/internal/v8/startup_snapshot.js",
+ "lib/internal/test_runner/test.js",
+ "lib/internal/test_runner/harness.js",
+ "lib/internal/test_runner/utils.js",
+ "lib/internal/test_runner/tap_stream.js",
+ "lib/internal/crypto/sig.js",
+ "lib/internal/crypto/rsa.js",
+ "lib/internal/crypto/aes.js",
+ "lib/internal/crypto/util.js",
+ "lib/internal/crypto/scrypt.js",
+ "lib/internal/crypto/random.js",
+ "lib/internal/crypto/keys.js",
+ "lib/internal/crypto/cfrg.js",
+ "lib/internal/crypto/x509.js",
+ "lib/internal/crypto/certificate.js",
+ "lib/internal/crypto/ec.js",
@@ -1262,7 +1269,6 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "lib/internal/crypto/hash.js",
+ "lib/internal/crypto/pbkdf2.js",
+ "lib/internal/crypto/webcrypto.js",
+ "lib/internal/crypto/dsa.js",
+ "lib/internal/crypto/hashnames.js",
+ "lib/internal/cluster/shared_handle.js",
+ "lib/internal/cluster/round_robin_handle.js",
@@ -1295,6 +1301,8 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "lib/internal/util/debuglog.js",
+ "lib/internal/util/inspect.js",
+ "lib/internal/util/iterable_weak_map.js",
+ "lib/internal/util/parse_args/utils.js",
+ "lib/internal/util/parse_args/parse_args.js",
+ "lib/internal/streams/add-abort-signal.js",
+ "lib/internal/streams/compose.js",
+ "lib/internal/streams/duplexify.js",
@@ -1344,7 +1352,9 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "lib/internal/main/eval_string.js",
+ "lib/internal/main/check_syntax.js",
+ "lib/internal/main/prof_process.js",
+ "lib/internal/main/test_runner.js",
+ "lib/internal/main/worker_thread.js",
+ "lib/internal/main/mksnapshot.js",
+ "lib/internal/main/inspect.js",
+ "lib/internal/main/eval_stdin.js",
+ "lib/internal/main/run_main_module.js",
@@ -1353,7 +1363,6 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "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",
+ "lib/internal/modules/esm/create_dynamic_module.js",
@@ -1389,6 +1398,7 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "lib/internal/perf/utils.js",
+ "lib/internal/perf/observe.js",
+ "lib/internal/perf/event_loop_delay.js",
+ "lib/internal/perf/resource_timing.js",
+ "lib/internal/perf/event_loop_utilization.js",
+ "lib/internal/policy/manifest.js",
+ "lib/internal/policy/sri.js",
@@ -1525,8 +1535,6 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "src/aliased_buffer.h",
+ "src/aliased_struct.h",
+ "src/aliased_struct-inl.h",
+ "src/allocated_buffer.h",
+ "src/allocated_buffer-inl.h",
+ "src/async_wrap.h",
+ "src/async_wrap-inl.h",
+ "src/base_object.h",
@@ -1591,6 +1599,7 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
+ "src/node_revert.h",
+ "src/node_root_certs.h",
+ "src/node_snapshotable.h",
+ "src/node_snapshot_builder.h",
+ "src/node_sockaddr.h",
+ "src/node_sockaddr-inl.h",
+ "src/node_stat_watcher.h",
@@ -1871,7 +1880,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 0f1a9b52cccba1e54150494a7ee5b28961a8d59d..bb68b2dfef4a693d8a1d0fe056fe696254d12d09 100644
index d79d640b693993ee9db938e857e34629410ca1e4..f7571a5e669c539bfdce14b18acdb778f8570383 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
@@ -1998,10 +2007,10 @@ index 0000000000000000000000000000000000000000..2a92eccfa582df361f2a889c0d9b32c1
+
+ out_file.writelines(new_contents)
diff --git a/tools/install.py b/tools/install.py
index 8a050dfa7c8b771ceb30fd2b74dc47f3de96834c..ad3bee1660de26d3502c6247f23b091171a6416c 100755
index a6d1f8b3caa8e24148b1930ea109508f8e612735..c80c1b8202ba59bd63340baca36df8bca5e1f81d 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -172,17 +172,72 @@ def files(action):
@@ -202,17 +202,72 @@ def files(action):
def headers(action):
def wanted_v8_headers(files_arg, dest):
v8_headers = [
@@ -2084,7 +2093,7 @@ index 8a050dfa7c8b771ceb30fd2b74dc47f3de96834c..ad3bee1660de26d3502c6247f23b0911
files_arg = [name for name in files_arg if name in v8_headers]
action(files_arg, dest)

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

Loading