chore: bump node to v20.16.0 (main) (#43029)

* chore: bump node in DEPS to v20.16.0

* test: skip unstable shadow realm gc tests

https://github.com/nodejs/node/pull/52855

* test: extend env for `test-node-output-errors`

https://github.com/nodejs/node/pull/53535

* src: fix typo in env.cc

https://github.com/nodejs/node/pull/53418

* src: reset `process.versions` during pre-execution

https://github.com/nodejs/node/pull/53444

* chore: fixup patch indices

* src,permission: --allow-wasi & prevent WASI exec

https://github.com/nodejs/node/pull/53124

* tls: use SSL_get_peer_tmp_key

https://github.com/nodejs/node/pull/53366

* deps: update c-ares to 1.29.0

https://github.com/nodejs/node/pull/53155

* src: account for OpenSSL unexpected version

* crypto: fix propagation of "memory limit exceeded"

https://github.com/nodejs/node/pull/53300

* process: add process.getBuiltinModule(id)

https://github.com/nodejs/node/pull/52762

* windows 32bit: config change callback needs to be stdcall

8f265c9d51

* fix: building with UNICODE

https://github.com/c-ares/c-ares/pull/802

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
electron-roller[bot] 2024-07-26 12:52:05 -04:00 коммит произвёл GitHub
Родитель 77ba40bc01
Коммит b3d52c01e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
22 изменённых файлов: 210 добавлений и 57 удалений

2
DEPS
Просмотреть файл

@ -4,7 +4,7 @@ vars = {
'chromium_version':
'128.0.6611.0',
'node_version':
'v20.15.1',
'v20.16.0',
'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version':

Просмотреть файл

@ -51,3 +51,6 @@ test_update_v8-stats_test_for_v8_12_6.patch
chore_remove_calls_to_v8_functioncallbackinfo_holder.patch
src_do_not_use_soon-to-be-deprecated_v8_api.patch
fix_add_property_query_interceptors.patch
src_account_for_openssl_unexpected_version.patch
windows_32bit_config_change_callback_needs_to_be_stdcall.patch
fix_building_with_unicode.patch

Просмотреть файл

@ -537,10 +537,10 @@ index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c7
cflags_c = [
"-mavx512vl",
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..3f253daee0f9b1faa50857f61d76de001bd8947e 100644
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04b8802321 100644
--- a/deps/cares/BUILD.gn
+++ b/deps/cares/BUILD.gn
@@ -1,14 +1,163 @@
@@ -1,14 +1,170 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
@ -582,6 +582,8 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..3f253daee0f9b1faa50857f61d76de00
+ "src/lib/ares__htable_strvp.h",
+ "src/lib/ares__htable_szvp.c",
+ "src/lib/ares__htable_szvp.h",
+ "src/lib/ares__htable_vpvp.c",
+ "src/lib/ares__htable_vpvp.h",
+ "src/lib/ares__iface_ips.c",
+ "src/lib/ares__iface_ips.h",
+ "src/lib/ares__llist.c",
@ -607,6 +609,7 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..3f253daee0f9b1faa50857f61d76de00
+ "src/lib/ares_dns_record.c",
+ "src/lib/ares_dns_private.h",
+ "src/lib/ares_dns_write.c",
+ "src/lib/ares_event_configchg.c",
+ "src/lib/ares_event.h",
+ "src/lib/ares_event_win32.h",
+ "src/lib/ares_event_epoll.c",
@ -711,7 +714,11 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..3f253daee0f9b1faa50857f61d76de00
-cares_gn_build("cares") {
+ if (is_mac) {
+ include_dirs += [ "config/darwin" ]
+ sources += [ "config/darwin/ares_config.h" ]
+ sources += [
+ "config/darwin/ares_config.h",
+ "src/lib/ares_sysconfig_mac.c",
+ "src/lib/thirdparty/apple/dnsinfo.h",
+ ]
+ }
}
diff --git a/deps/googletest/BUILD.gn b/deps/googletest/BUILD.gn
@ -1256,10 +1263,10 @@ index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..fd42e2a5e6163ff70db0f716d2f9a32f13cdf668
index 0000000000000000000000000000000000000000..679329d847fbfe303792cab5881287890c9961f4
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,734 @@
@@ -0,0 +1,736 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
@ -1842,6 +1849,7 @@ index 0000000000000000000000000000000000000000..fd42e2a5e6163ff70db0f716d2f9a32f
+ "src/permission/fs_permission.cc",
+ "src/permission/inspector_permission.cc",
+ "src/permission/permission.cc",
+ "src/permission/wasi_permission.cc",
+ "src/permission/worker_permission.cc",
+ "src/pipe_wrap.cc",
+ "src/process_wrap.cc",
@ -1963,6 +1971,7 @@ index 0000000000000000000000000000000000000000..fd42e2a5e6163ff70db0f716d2f9a32f
+ "src/permission/fs_permission.h",
+ "src/permission/inspector_permission.h",
+ "src/permission/permission.h",
+ "src/permission/wasi_permission.h",
+ "src/permission/worker_permission.h",
+ "src/pipe_wrap.h",
+ "src/req_wrap.h",

Просмотреть файл

@ -50,7 +50,7 @@ index f9a090f5c3e04403602ba383032e7f3230669a92..3f82db324d406e342abee23ab0d7f7c9
BuiltinCodeCacheData cached_data{};
{
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67..f6969e635f692b17b4efca1dfbee086a0199db6e 100644
index 708fa03d088e67a50dc4e69bb3f2cc14529dc3f1..4b7c4556d4cc94f589065409ed2a0aca497c99d0 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -850,16 +850,15 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@ -96,7 +96,7 @@ index df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67..f6969e635f692b17b4efca1dfbee086a
ContextifyScript* wrapped_script;
ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.Holder(), false);
Local<UnboundScript> unbound_script =
@@ -1244,8 +1242,7 @@ void ContextifyContext::CompileFunction(
@@ -1259,8 +1257,7 @@ void ContextifyContext::CompileFunction(
Local<PrimitiveArray> host_defined_options =
GetHostDefinedOptions(isolate, id_symbol);
ScriptCompiler::Source source =
@ -106,7 +106,7 @@ index df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67..f6969e635f692b17b4efca1dfbee086a
filename,
line_offset,
column_offset,
@@ -1300,15 +1297,13 @@ void ContextifyContext::CompileFunction(
@@ -1315,15 +1312,13 @@ void ContextifyContext::CompileFunction(
}
ScriptCompiler::Source ContextifyContext::GetCommonJSSourceInstance(
@ -123,7 +123,7 @@ index df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67..f6969e635f692b17b4efca1dfbee086a
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
@@ -1486,7 +1481,7 @@ void ContextifyContext::ContainsModuleSyntax(
@@ -1501,7 +1496,7 @@ void ContextifyContext::ContainsModuleSyntax(
Local<PrimitiveArray> host_defined_options =
GetHostDefinedOptions(isolate, id_symbol);
ScriptCompiler::Source source = GetCommonJSSourceInstance(
@ -132,7 +132,7 @@ index df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67..f6969e635f692b17b4efca1dfbee086a
ScriptCompiler::CompileOptions options = GetCompileOptions(source);
std::vector<Local<String>> params = GetCJSParameters(env->isolate_data());
@@ -1534,7 +1529,7 @@ void ContextifyContext::ContainsModuleSyntax(
@@ -1549,7 +1544,7 @@ void ContextifyContext::ContainsModuleSyntax(
code,
String::NewFromUtf8(isolate, "})();").ToLocalChecked());
ScriptCompiler::Source wrapped_source = GetCommonJSSourceInstance(
@ -141,7 +141,7 @@ index df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67..f6969e635f692b17b4efca1dfbee086a
std::ignore = ScriptCompiler::CompileFunction(
context,
&wrapped_source,
@@ -1587,8 +1582,7 @@ static void CompileFunctionForCJSLoader(
@@ -1602,8 +1597,7 @@ static void CompileFunctionForCJSLoader(
Local<Symbol> symbol = env->vm_dynamic_import_default_internal();
Local<PrimitiveArray> hdo = GetHostDefinedOptions(isolate, symbol);

Просмотреть файл

@ -26,7 +26,7 @@ index 155485dbab0d46bb225fa40e99f555d805659c4f..8183cffe9d7060571c08f696abb7c090
try {
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
index 16e291484bfe85d5614557f070ab0d2ae59655d4..b4272f01e84d7fec263dcad444d92459743780a8 100644
index 8fad2fe617e4f8d2364b8c9d3cfb27c265f08b5b..710af646aaf97f88ac2ee003d8f83388ccf9a84f 100644
--- a/lib/internal/process/pre_execution.js
+++ b/lib/internal/process/pre_execution.js
@@ -244,12 +244,14 @@ function patchProcessObject(expandArgv1) {

Просмотреть файл

@ -45,10 +45,10 @@ index f995c170540ffaa80b1b5f8b95dbd8f52bbd5431..6455dbdd015477e16c414b6d21131393
fixtures.path(name),
transform ?? defaultTransform,
diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs
index c0acee2bfc8c124e9d9b254041589a49c8301b8f..0e266899ffc0918b2f94e8f636043a6ec5f0870f 100644
index 84f20a77dda367fe1ada8d616c7b6813d39efd43..27d16d74884a006ba01b777f5a20339b4906197b 100644
--- a/test/parallel/test-node-output-errors.mjs
+++ b/test/parallel/test-node-output-errors.mjs
@@ -61,21 +61,22 @@ describe('errors output', { concurrency: true }, () => {
@@ -59,21 +59,22 @@ describe('errors output', { concurrency: true }, () => {
{ name: 'errors/events_unhandled_error_subclass.js', transform: errTransform },
{ name: 'errors/if-error-has-good-stack.js', transform: errTransform },
{ name: 'errors/throw_custom_error.js', transform: errTransform },
@ -69,11 +69,11 @@ index c0acee2bfc8c124e9d9b254041589a49c8301b8f..0e266899ffc0918b2f94e8f636043a6e
- { skip: skipForceColors, name: 'errors/force_colors.js',
- transform: forceColorsTransform, env: { FORCE_COLOR: 1 } },
+ // { skip: skipForceColors, name: 'errors/force_colors.js',
+ // transform: forceColorsTransform, env: { FORCE_COLOR: 1 } },
+ // transform: forceColorsTransform, env: { FORCE_COLOR: 1 } },
];
for (const { name, transform = defaultTransform, env, skip = false } of tests) {
it(name, { skip }, async () => {
+ if (env) env.ELECTRON_RUN_AS_NODE = 1;
await snapshot.spawnAndAssert(fixtures.path(name), transform, { env });
await snapshot.spawnAndAssert(fixtures.path(name), transform, { env: { ...env, ...process.env } });
});
}

Просмотреть файл

@ -28,7 +28,7 @@ In file included from ../../third_party/electron_node/src/env-inl.h:32:
1 error generated.
diff --git a/src/util.h b/src/util.h
index cd4fe2e422a7843f5a3f0f4b336a8625a0b24bcf..8edd50e598d8612144b8da9236e63f9079b99156 100644
index 3ae876e5484f0ebacfae6749cc336f42cd69bf14..8e9e8289de249119d6b8078abe32db6b885dfaab 100644
--- a/src/util.h
+++ b/src/util.h
@@ -146,9 +146,9 @@ void DumpJavaScriptBacktrace(FILE* fp);

Просмотреть файл

@ -13,7 +13,7 @@ CL: https://chromium-review.googlesource.com/c/v8/v8/+/5630388
This patch can be removed when the node change is incorporated into main.
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index f6969e635f692b17b4efca1dfbee086a0199db6e..6ace71b04e9da761c77838dde2abd8088abcb6c4 100644
index 4b7c4556d4cc94f589065409ed2a0aca497c99d0..b4d6116f0c84b0cf3e1045c6b9571fd295fe5412 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -49,6 +49,7 @@ using v8::FunctionTemplate;

Просмотреть файл

@ -58,10 +58,10 @@ index f9d29f0065b1de63a62cfdce74a9705c22dd87d7..3f44160f1bd40fc2d4658f10edf0d0b3
}
diff --git a/src/node_options.cc b/src/node_options.cc
index 753311e15f161547be4277016efe11cc57d351db..8e98b76e29824565739010b885375d63c992bdf8 100644
index 28fbd93c5d4a6f379844e10e556920b7614910d8..53cf93719bea001db09697b56f197815549dc953 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -1317,6 +1317,11 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
@@ -1321,6 +1321,11 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
Local<Context> context = env->context();
Local<Object> ret = Object::New(isolate);

Просмотреть файл

@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Keeley Hammond <khammond@slack-corp.com>
Date: Thu, 25 Jul 2024 15:29:12 -0700
Subject: fix: building with UNICODE
Use the unicode version of 'RegOpenKeyEx' to avoid compilation error on string type.
Backport of https://github.com/c-ares/c-ares/pull/802.
diff --git a/deps/cares/src/lib/ares_event_configchg.c b/deps/cares/src/lib/ares_event_configchg.c
index c9b39f7b3358f37e61fb95e440695a9b590c2090..b33141ce3a30dd92509de8a4aff1a7fc76a5b915 100644
--- a/deps/cares/src/lib/ares_event_configchg.c
+++ b/deps/cares/src/lib/ares_event_configchg.c
@@ -319,15 +319,15 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg,
/* Monitor HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\Interfaces
* and HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
* for changes via RegNotifyChangeKeyValue() */
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces",
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+ L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces",
0, KEY_NOTIFY, &c->regip4) != ERROR_SUCCESS) {
status = ARES_ESERVFAIL;
goto done;
}
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters\\Interfaces",
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+ L"SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters\\Interfaces",
0, KEY_NOTIFY, &c->regip6) != ERROR_SUCCESS) {
status = ARES_ESERVFAIL;
goto done;

Просмотреть файл

@ -24,7 +24,7 @@ index 69e2a389f9e1480a1a4ba37f5df5356b42f7d52d..0c29b00298b44b97f88a63aa5b89f1c2
wrap->object()->Has(env->context(), env->handle_onclose_symbol())
.FromMaybe(false)) {
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index ca8575e9a21b9a0b8089484a04abe702b2fe6d4e..df1d9cb4fd0442ec6ce6164a136b7a5fbcbe5b67 100644
index d873792ab95e41d54579f552c6c1fa43447ca4cd..708fa03d088e67a50dc4e69bb3f2cc14529dc3f1 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -460,6 +460,7 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {

Просмотреть файл

@ -31,7 +31,7 @@ index 4e3c32fdcd23fbe3e74bd5e624b739d224689f33..19d65aae7fa8ec9f9b907733ead17a20
// Test Parallel Execution w/ KeyObject is threadsafe in openssl3
{
diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js
index 6178445adbc634160c3c3ca699a36868f894e544..ff4dc2f7d527b5eb1fa442ba6b0f9ba04af39357 100644
index 59dd3b69c4bdf6dbd7b5e4f03df74caac551d459..1e0f9ce4c979683530afdf83ac3dc095acad2eb8 100644
--- a/test/parallel/test-crypto-authenticated.js
+++ b/test/parallel/test-crypto-authenticated.js
@@ -48,7 +48,9 @@ const errMessages = {
@ -381,7 +381,7 @@ index fcf1922bcdba733af6c22f142db4f7b099947757..9f72ae4e41a113e752f40795103c2af5
assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex);
assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex);
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
index 3b738b7f47ec59ba718a92e3a0024fed45a9c87c..fabf5775a263804f5974b10cf73c6886d59bf1fa 100644
index fb580e1b315445182538c56fc114742ce896bf4c..36014fe7cb411016d72a7f4ab118923d12e97898 100644
--- a/test/parallel/test-crypto-dh.js
+++ b/test/parallel/test-crypto-dh.js
@@ -55,18 +55,17 @@ const crypto = require('crypto');
@ -594,6 +594,19 @@ index 5f4fafdfffbf726b7cb39c472baa3df25c9794cf..73bb53b0405b20f51b13326cc70e5275
assert.strictEqual(verify.verify(dsaPubPem, signature, 'hex'), true);
}
+*/
diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js
index 61bd65fc92678c24baa3c0eb9ffb1ead64ace70b..cb690351696a811210b9d990ee4cde3cfb2a3446 100644
--- a/test/parallel/test-crypto-scrypt.js
+++ b/test/parallel/test-crypto-scrypt.js
@@ -178,7 +178,7 @@ for (const options of bad) {
for (const options of toobig) {
const expected = {
- message: /Invalid scrypt params:.*memory limit exceeded/,
+ message: /Invalid scrypt params/,
code: 'ERR_CRYPTO_INVALID_SCRYPT_PARAMS',
};
assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}),
diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js
index 56e5c16c2867f019caccf42f228193cae6167150..dc585c44db9894ae57a5e11d453af03e1ea4f211 100644
--- a/test/parallel/test-crypto-sign-verify.js

Просмотреть файл

@ -38,10 +38,10 @@ index 67cd4f2adf15e7d8511f561c54163b1842e971af..88471fd6bc0b8a810bb55464cd2d1933
const EVP_MD* digest = nullptr;
diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc
index ee1c7931a5c83eec00fe05807ddb97572fe70cc9..008fa0c04c3dadfe69f87728840f9326a150c7b3 100644
index 962018583360a137639682d4aec8b0ebad2f3070..4f569daa0d5e9976f40f30b77425679798a0b8b8 100644
--- a/src/crypto/crypto_common.cc
+++ b/src/crypto/crypto_common.cc
@@ -158,7 +158,7 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
@@ -166,7 +166,7 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
const unsigned char* buf;
size_t len;
size_t rem;
@ -50,7 +50,7 @@ index ee1c7931a5c83eec00fe05807ddb97572fe70cc9..008fa0c04c3dadfe69f87728840f9326
if (!SSL_client_hello_get0_ext(
ssl.get(),
TLSEXT_TYPE_application_layer_protocol_negotiation,
@@ -171,13 +171,15 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
@@ -179,13 +179,15 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
len = (buf[0] << 8) | buf[1];
if (len + 2 != rem) return nullptr;
return reinterpret_cast<const char*>(buf + 3);
@ -67,7 +67,7 @@ index ee1c7931a5c83eec00fe05807ddb97572fe70cc9..008fa0c04c3dadfe69f87728840f9326
if (!SSL_client_hello_get0_ext(
ssl.get(),
TLSEXT_TYPE_server_name,
@@ -199,6 +201,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
@@ -207,6 +209,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
if (len + 2 > rem)
return nullptr;
return reinterpret_cast<const char*>(buf + 5);
@ -95,8 +95,21 @@ index ee1c7931a5c83eec00fe05807ddb97572fe70cc9..008fa0c04c3dadfe69f87728840f9326
Local<Object> obj = Object::New(env->isolate());
if (!Set(env->context(),
obj,
@@ -1104,8 +1108,11 @@ MaybeLocal<Object> GetEphemeralKey(Environment* env, const SSLPointer& ssl) {
EscapableHandleScope scope(env->isolate());
Local<Object> info = Object::New(env->isolate());
+#ifndef OPENSSL_IS_BORINGSSL
if (!SSL_get_peer_tmp_key(ssl.get(), &raw_key)) return scope.Escape(info);
-
+#else
+ if (!SSL_get_server_tmp_key(ssl.get(), &raw_key)) return scope.Escape(info);
+#endif
Local<Context> context = env->context();
crypto::EVPKeyPointer key(raw_key);
diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
index 6e5bbe07d0c337b36f3157c2e6404fdc91849fd1..7ec682833213de9054a8c30751436d12baaea235 100644
index e26e64834bee7fd9cd4e18bfe69a4f41d51fa8e9..a5b1ec5ea6284ab9892d5a2e576f369ae3bbac91 100644
--- a/src/crypto/crypto_context.cc
+++ b/src/crypto/crypto_context.cc
@@ -63,7 +63,7 @@ inline X509_STORE* GetOrCreateRootCertStore() {
@ -224,7 +237,7 @@ index 3fa4a415dc911a13afd90dfb31c1ed4ad0fd268f..fa48dffc31342c44a1c1207b9d4c3dc7
return EVPKeyCtxPointer();
diff --git a/src/crypto/crypto_keys.cc b/src/crypto/crypto_keys.cc
index c5dd2fb8fce40f2bf6f9a8543047ffb50cc08084..d850af9257cc194ee385130ce3cd2c0101b2455f 100644
index a4979cf5586a7be6308a917eb020bedafa17f683..e4705482c6d45138deac84c59d8192bb2a284a76 100644
--- a/src/crypto/crypto_keys.cc
+++ b/src/crypto/crypto_keys.cc
@@ -1241,6 +1241,7 @@ void KeyObjectHandle::GetAsymmetricKeyType(
@ -340,7 +353,7 @@ index 5734d8fdc5505e1586f571c19b840bd56e9c9f1f..3034b114e081e2b32dd5b71653927a41
} // namespace
diff --git a/src/env.h b/src/env.h
index 3b3724d6c7156b87555be31470e75b1cf28b5e3f..910c69b6d1d17ef25201dbb39d3d074f4f3f011f 100644
index cd8db07919dc4d00675bbaae976e8fa1fcc16028..2310c89227f08cdcca6c4965cc163031af303626 100644
--- a/src/env.h
+++ b/src/env.h
@@ -49,7 +49,7 @@
@ -352,7 +365,7 @@ index 3b3724d6c7156b87555be31470e75b1cf28b5e3f..910c69b6d1d17ef25201dbb39d3d074f
#include <openssl/evp.h>
#endif
@@ -1036,7 +1036,7 @@ class Environment : public MemoryRetainer {
@@ -1038,7 +1038,7 @@ class Environment : public MemoryRetainer {
kExitInfoFieldCount
};
@ -375,7 +388,7 @@ index cf051585e779e2b03bd7b95fe5008b89cc7f8162..9de49c6828468fdf846dcd4ad445390f
#if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h>
diff --git a/src/node_options.cc b/src/node_options.cc
index 7110b4d984b72fa8c9bef2cbe6e37b1871e14d08..753311e15f161547be4277016efe11cc57d351db 100644
index 1ba0bfcd9b3096c4bffe518ad08973edb895e8c3..28fbd93c5d4a6f379844e10e556920b7614910d8 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -6,7 +6,7 @@
@ -388,7 +401,7 @@ index 7110b4d984b72fa8c9bef2cbe6e37b1871e14d08..753311e15f161547be4277016efe11cc
#endif
diff --git a/src/node_options.h b/src/node_options.h
index 3c67c3680b045786dafb8435f5b311c3f386a943..546c3979e2c8d7498aa92df4c89ee867c6485080 100644
index 1357e5b42869e8e3a30d2bf6db0faed565d99754..49c6d8b4162977a926e36bad7183a10502b2beaf 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -11,7 +11,7 @@

Просмотреть файл

@ -86,10 +86,10 @@ index 149c7c107322919dfeea1dfe89dc223f78b0e979..e4e8dac6b8b5924a7eae83935031e091
NODE_DEFINE_CONSTANT(target, ETIMEDOUT);
#endif
diff --git a/src/node_errors.cc b/src/node_errors.cc
index ff091fd20d915b58a7a23dd393d46e1021bdb2f5..8c2cf5d65bb8b1d9461286c9a54be8ac9786900a 100644
index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a139051cc 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -852,10 +852,6 @@ const char* errno_string(int errorno) {
@@ -855,10 +855,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOBUFS);
#endif
@ -100,7 +100,7 @@ index ff091fd20d915b58a7a23dd393d46e1021bdb2f5..8c2cf5d65bb8b1d9461286c9a54be8ac
#ifdef ENODEV
ERRNO_CASE(ENODEV);
#endif
@@ -894,14 +890,6 @@ const char* errno_string(int errorno) {
@@ -897,14 +893,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOSPC);
#endif
@ -115,7 +115,7 @@ index ff091fd20d915b58a7a23dd393d46e1021bdb2f5..8c2cf5d65bb8b1d9461286c9a54be8ac
#ifdef ENOSYS
ERRNO_CASE(ENOSYS);
#endif
@@ -984,10 +972,6 @@ const char* errno_string(int errorno) {
@@ -987,10 +975,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ESTALE);
#endif

Просмотреть файл

@ -7,7 +7,7 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index d42e766555a83ec7421b13c2bf75bfd28f086102..57125a271394dda0d3aa3a261ba087c978582c29 100644
index 12262f40ce123440a9a0f974386cfbe8511f4459..f3c15b61d33bdae44de528e106fcc6f930f1c388 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -134,6 +134,10 @@ process.domain = null;

Просмотреть файл

@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 25 Jul 2024 12:19:41 +0200
Subject: src: account for OpenSSL unexpected version
Fixes a crash that occurs because the logic to parse for an OpenSSL
version didn't account for OpenSSL_version returning a value that
doesn't match the expected pattern of OpenSSL 1.1.0i 14 Aug 2018.
In Electron's case, OpenSSL_version returns just BoringSSL, which in
combination with the search logic not accounting for the delimiter not
being present caused an out-of-bounds crash:
out_of_range was thrown in -fno-exceptions mode with message "basic_string"
This fixes that by checking for the null terminator and returning 0.0.0
when the target delimiter isn't present.
Upstreamed at https://github.com/nodejs/node/pull/54038
diff --git a/src/node_metadata.cc b/src/node_metadata.cc
index 985d44b3cd1f1aa5c09f99e868083f2e48c7e32b..1876249eb88065f649aee2c8348f42ec90ab70da 100644
--- a/src/node_metadata.cc
+++ b/src/node_metadata.cc
@@ -48,14 +48,19 @@ Metadata metadata;
#if HAVE_OPENSSL
static constexpr size_t search(const char* s, char c, size_t n = 0) {
- return *s == c ? n : search(s + 1, c, n + 1);
+ return *s == '\0' ? n : (*s == c ? n : search(s + 1, c, n + 1));
}
static inline std::string GetOpenSSLVersion() {
// sample openssl version string format
// for reference: "OpenSSL 1.1.0i 14 Aug 2018"
const char* version = OpenSSL_version(OPENSSL_VERSION);
- const size_t start = search(version, ' ') + 1;
+ const size_t first_space = search(version, ' ');
+ if (version[first_space] == '\0') {
+ return std::string("0.0.0");
+ }
+
+ const size_t start = first_space + 1;
const size_t len = search(&version[start], ' ');
return std::string(version, start, len);
}

Просмотреть файл

@ -33,7 +33,7 @@ Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
diff --git a/src/node_process_object.cc b/src/node_process_object.cc
index 274f1f01de8d84596ea24bd2bd65e83d69605178..935a6c612d706a611d4cf3f812f30978e0a81210 100644
index a13f8d15724cb00fe0e9d722395bd9b9514a3943..3f8a4fbd1a65971645e6785e469bc887a1afbad1 100644
--- a/src/node_process_object.cc
+++ b/src/node_process_object.cc
@@ -13,7 +13,6 @@
@ -44,7 +44,7 @@ index 274f1f01de8d84596ea24bd2bd65e83d69605178..935a6c612d706a611d4cf3f812f30978
using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
@@ -183,13 +182,12 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
@@ -188,13 +187,12 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
// process.title
CHECK(process
@ -59,7 +59,7 @@ index 274f1f01de8d84596ea24bd2bd65e83d69605178..935a6c612d706a611d4cf3f812f30978
None,
SideEffectType::kHasNoSideEffect)
.FromJust());
@@ -208,9 +206,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
@@ -213,9 +211,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
READONLY_PROPERTY(process, "pid",
Integer::New(isolate, uv_os_getpid()));
@ -78,7 +78,7 @@ index 274f1f01de8d84596ea24bd2bd65e83d69605178..935a6c612d706a611d4cf3f812f30978
// --security-revert flags
#define V(code, _, __) \
@@ -235,11 +239,14 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
@@ -240,12 +244,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
// process.debugPort
CHECK(process
@ -87,6 +87,7 @@ index 274f1f01de8d84596ea24bd2bd65e83d69605178..935a6c612d706a611d4cf3f812f30978
- DebugPortGetter,
- env->owns_process_state() ? DebugPortSetter : nullptr,
- Local<Value>())
- .FromJust());
+ ->SetNativeDataProperty(
+ context,
+ FIXED_ONE_BYTE_STRING(isolate, "debugPort"),
@ -95,9 +96,10 @@ index 274f1f01de8d84596ea24bd2bd65e83d69605178..935a6c612d706a611d4cf3f812f30978
+ Local<Value>(),
+ None,
+ SideEffectType::kHasNoSideEffect)
.FromJust());
}
+ .FromJust());
// process.versions
Local<Object> versions = Object::New(isolate);
diff --git a/test/parallel/test-worker-unsupported-things.js b/test/parallel/test-worker-unsupported-things.js
index 18c1617c3cde5ef12f9c97828840c39e0be3dc2c..95d93d24dec9f1944091a97574f01c94d617cc49 100644
--- a/test/parallel/test-worker-unsupported-things.js

Просмотреть файл

@ -52,7 +52,7 @@ index 63ce35ba68b48a55d8150395304bf86c2bf23aae..c6fc53d1666ae51e69257c9bbcaf4cbf
return &(wrapper_data_->cppgc_id);
}
diff --git a/src/env.cc b/src/env.cc
index 7bd5edf61c339daa1e1b0df8e2e91680948641de..b75f3d11054a656ac0acadea27cd183d71b5d90f 100644
index ea0ae4e08ec7dd98721bc89d2fe80fa47eaddfec..0f9846baeef6fd490cdc43893e29ea2d0a731d1d 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -22,6 +22,7 @@
@ -71,7 +71,7 @@ index 7bd5edf61c339daa1e1b0df8e2e91680948641de..b75f3d11054a656ac0acadea27cd183d
using worker::Worker;
int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64;
@@ -518,6 +518,14 @@ void IsolateData::CreateProperties() {
@@ -530,6 +530,14 @@ void IsolateData::CreateProperties() {
CreateEnvProxyTemplate(this);
}
@ -83,13 +83,13 @@ index 7bd5edf61c339daa1e1b0df8e2e91680948641de..b75f3d11054a656ac0acadea27cd183d
+// should simply use v8::Object::Wrap() and v8::Object::Unwrap(). We preserve
+// this layout only to distinguish internally how the memory of a Node.js
+// wrapper is managed or whether a wrapper is managed by Node.js.
constexpr uint16_t kDefaultCppGCEmebdderID = 0x90de;
constexpr uint16_t kDefaultCppGCEmbedderID = 0x90de;
Mutex IsolateData::isolate_data_mutex_;
std::unordered_map<uint16_t, std::unique_ptr<PerIsolateWrapperData>>
@@ -539,36 +547,16 @@ IsolateData::IsolateData(Isolate* isolate,
@@ -551,36 +559,16 @@ IsolateData::IsolateData(Isolate* isolate,
v8::CppHeap* cpp_heap = isolate->GetCppHeap();
uint16_t cppgc_id = kDefaultCppGCEmebdderID;
uint16_t cppgc_id = kDefaultCppGCEmbedderID;
- if (cpp_heap != nullptr) {
- // The general convention of the wrappable layout for cppgc in the
- // ecosystem is:
@ -130,7 +130,7 @@ index 7bd5edf61c339daa1e1b0df8e2e91680948641de..b75f3d11054a656ac0acadea27cd183d
{
// GC could still be run after the IsolateData is destroyed, so we store
@@ -600,11 +588,12 @@ IsolateData::~IsolateData() {
@@ -612,11 +600,12 @@ IsolateData::~IsolateData() {
}
}
@ -146,7 +146,7 @@ index 7bd5edf61c339daa1e1b0df8e2e91680948641de..b75f3d11054a656ac0acadea27cd183d
void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
diff --git a/src/env.h b/src/env.h
index 910c69b6d1d17ef25201dbb39d3d074f4f3f011f..5fd375f143dd529c83aca59348182cce47d3abf8 100644
index 2310c89227f08cdcca6c4965cc163031af303626..d00dcc4e6661999d97943ce0398f568fc5e1e44f 100644
--- a/src/env.h
+++ b/src/env.h
@@ -164,10 +164,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {

Просмотреть файл

@ -7,7 +7,7 @@ Instead of disabling the tests, flag them as flaky so they still run
but don't cause CI failures on flakes.
diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status
index 8840bd004ba87aa4a310b381310bb9612b96d861..892980bb90e433b16756f33c554b299ecc185eb4 100644
index c2b988f9b2f76940c1c6b05af13898ba2062ba72..d45260cee87349cc8642d814dd11b904bdcf3762 100644
--- a/test/parallel/parallel.status
+++ b/test/parallel/parallel.status
@@ -5,6 +5,16 @@ prefix parallel
@ -24,9 +24,9 @@ index 8840bd004ba87aa4a310b381310bb9612b96d861..892980bb90e433b16756f33c554b299e
+test-cluster-bind-privileged-port: PASS, FLAKY
+test-cluster-shared-handle-bind-privileged-port: PASS, FLAKY
+test-debugger-random-port-with-inspect-port: PASS, FLAKY
# https://github.com/nodejs/node/issues/51862
test-fs-read-stream-concurrent-reads: PASS, FLAKY
# https://github.com/nodejs/node/issues/52273
test-net-write-fully-async-hex-string: PASS, FLAKY
# https://github.com/nodejs/node/issues/52273
diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status
index ccab879b6e5fcdcc0d3a4b790b97db94d92f1a59..11339325697ae98f6996101163679590451c0b81 100644
--- a/test/sequential/sequential.status

Просмотреть файл

@ -7,7 +7,7 @@ Subject: test: match wpt/streams/transferable/transform-stream-members.any.js
All four of this calls should fail - see third_party/blink/web_tests/external/wpt/streams/transferable/transform-stream-members.any-expected.txt
diff --git a/test/wpt/status/streams.json b/test/wpt/status/streams.json
index 8d6a4c6d2fe27b349ca8a4cbcdc51c3eec06ede9..1e7af48a149ba2c8bed01cd6584e59dc0bc6b676 100644
index 3b6e0ce6429f9dddb0b1a6882ce9e3a5158300e5..7ec49a378bfc84728b473d5df69675fff1dfdfef 100644
--- a/test/wpt/status/streams.json
+++ b/test/wpt/status/streams.json
@@ -50,7 +50,9 @@

Просмотреть файл

@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Keeley Hammond <khammond@slack-corp.com>
Date: Thu, 25 Jul 2024 15:26:37 -0700
Subject: windows 32bit: config change callback needs to be stdcall
Patch of upstream fix: https://github.com/c-ares/c-ares/commit/8f265c9d5109e5665136396d347c0a93ea78999e
diff --git a/deps/cares/src/lib/ares_event_configchg.c b/deps/cares/src/lib/ares_event_configchg.c
index b7c5ad8c75b6218cf36283fb6d0f8cd702224b87..c9b39f7b3358f37e61fb95e440695a9b590c2090 100644
--- a/deps/cares/src/lib/ares_event_configchg.c
+++ b/deps/cares/src/lib/ares_event_configchg.c
@@ -239,9 +239,10 @@ void ares_event_configchg_destroy(ares_event_configchg_t *configchg)
# ifndef __WATCOMC__
-static void ares_event_configchg_ip_cb(PVOID CallerContext,
- PMIB_IPINTERFACE_ROW Row,
- MIB_NOTIFICATION_TYPE NotificationType)
+static void NETIOAPI_API_
+ ares_event_configchg_ip_cb(PVOID CallerContext,
+ PMIB_IPINTERFACE_ROW Row,
+ MIB_NOTIFICATION_TYPE NotificationType)
{
ares_event_configchg_t *configchg = CallerContext;
(void)Row;
@@ -308,7 +309,7 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg,
* that didn't get triggered either.
*/
if (NotifyIpInterfaceChange(
- AF_UNSPEC, (PIPINTERFACE_CHANGE_CALLBACK)ares_event_configchg_ip_cb,
+ AF_UNSPEC, ares_event_configchg_ip_cb,
*configchg, FALSE, &c->ifchg_hnd) != NO_ERROR) {
status = ARES_ESERVFAIL;
goto done;

Просмотреть файл

@ -37,6 +37,7 @@
"parallel/test-module-loading-globalpaths",
"parallel/test-openssl-ca-options",
"parallel/test-process-versions",
"parallel/test-process-get-builtin",
"parallel/test-repl",
"parallel/test-repl-underscore",
"parallel/test-single-executable-blob-config",