chore: bump node to v22.17.0 (37-x-y) (#47555)

* chore: bump node in DEPS to v22.17.0

* build: use //third_party/simdutf by default in GN

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

* chore: adjust crypto specs:

- https://github.com/nodejs/node/pull/58117
- https://github.com/nodejs/node/pull/58387

* deps: update libuv to 1.51.0

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

* test: fix test-buffer-tostring-range on allocation failure

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

* build: use FILE_OFFSET_BITS=64 esp. on 32-bit arch

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

* build: use //third_party/simdutf by default in GN

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

* inspector: add protocol method Network.dataReceived

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

* test: force slow JSON.stringify path for overflow

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

* chore: fixup patch indices

* 6049967: Remove protocol::Maybe and roll inspector_protocol

https://chromium-review.googlesource.com/c/chromium/src/+/6049967

* chore: fixup crypto test patch

* src: fix module buffer allocation

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

* crypto: expose process.features.openssl_is_boringssl

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

* util: add internal assignFunctionName() function

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

* build: fix pointer compression builds

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

* chore: put back config options

* fixup! deps: update libuv to 1.51.0

* chore: update patches

---------

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: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com>
This commit is contained in:
electron-roller[bot] 2025-06-30 14:49:16 +02:00 committed by GitHub
commit 65c062d3f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 360 additions and 621 deletions

2
DEPS
View file

@ -4,7 +4,7 @@ vars = {
'chromium_version': 'chromium_version':
'138.0.7204.49', '138.0.7204.49',
'node_version': 'node_version':
'v22.16.0', 'v22.17.0',
'nan_version': 'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213', 'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version': 'squirrel.mac_version':

View file

@ -54,6 +54,10 @@ const {
getDirent getDirent
} = __non_webpack_require__('internal/fs/utils'); } = __non_webpack_require__('internal/fs/utils');
const {
assignFunctionName
} = __non_webpack_require__('internal/util');
const { const {
validateBoolean, validateBoolean,
validateFunction validateFunction
@ -235,7 +239,10 @@ const overrideAPI = function (module: Record<string, any>, name: string, pathArg
}; };
if (old[util.promisify.custom]) { if (old[util.promisify.custom]) {
module[name][util.promisify.custom] = makePromiseFunction(old[util.promisify.custom], pathArgumentIndex); module[name][util.promisify.custom] = assignFunctionName(
name,
makePromiseFunction(old[util.promisify.custom], pathArgumentIndex)
);
} }
if (module.promises && module.promises[name]) { if (module.promises && module.promises[name]) {
@ -1238,7 +1245,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
// command as a single path to an archive. // command as a single path to an archive.
const { exec, execSync } = childProcess; const { exec, execSync } = childProcess;
childProcess.exec = invokeWithNoAsar(exec); childProcess.exec = invokeWithNoAsar(exec);
childProcess.exec[util.promisify.custom] = invokeWithNoAsar(exec[util.promisify.custom]); childProcess.exec[util.promisify.custom] = assignFunctionName('exec', invokeWithNoAsar(exec[util.promisify.custom]));
childProcess.execSync = invokeWithNoAsar(execSync); childProcess.execSync = invokeWithNoAsar(execSync);
overrideAPI(childProcess, 'execFile'); overrideAPI(childProcess, 'execFile');

View file

@ -34,10 +34,8 @@ fix_remove_harmony-import-assertions_from_node_cc.patch
chore_disable_deprecation_ftbfs_in_simdjson_header.patch chore_disable_deprecation_ftbfs_in_simdjson_header.patch
build_allow_unbundling_of_node_js_dependencies.patch build_allow_unbundling_of_node_js_dependencies.patch
test_use_static_method_names_in_call_stacks.patch test_use_static_method_names_in_call_stacks.patch
build_use_third_party_simdutf.patch
fix_remove_fastapitypedarray_usage.patch fix_remove_fastapitypedarray_usage.patch
test_handle_explicit_resource_management_globals.patch test_handle_explicit_resource_management_globals.patch
linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch
build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch
build_option_to_use_custom_inspector_protocol_path.patch build_option_to_use_custom_inspector_protocol_path.patch
fix_adjust_wpt_and_webidl_tests_for_enabled_float16array.patch fix_adjust_wpt_and_webidl_tests_for_enabled_float16array.patch
@ -48,4 +46,5 @@ cli_move_--trace-atomics-wait_to_eol.patch
fix_cppgc_initializing_twice.patch fix_cppgc_initializing_twice.patch
fix_task_starvation_in_inspector_context_test.patch fix_task_starvation_in_inspector_context_test.patch
fix_expose_readfilesync_override_for_modules.patch fix_expose_readfilesync_override_for_modules.patch
test_force_slow_json_stringify_path_for_overflow.patch chore_remove_protocol_maybe_from_node_string.patch
fix_-wmismatched-new-delete_in_debug_utils_cc.patch

View file

@ -10,8 +10,21 @@ however those files were cherry-picked from main branch and do not
really in 20/21. We have to wait until 22 is released to be able to really in 20/21. We have to wait until 22 is released to be able to
build with upstream GN files. build with upstream GN files.
diff --git a/configure.py b/configure.py
index 4560bac7b8e3c707ecea5a425f642efb9de9ed36..e9c2a4391f4058a21a259cacaac4fde5d199288e 100755
--- a/configure.py
+++ b/configure.py
@@ -1722,7 +1722,7 @@ def configure_v8(o, configs):
# Until we manage to get rid of all those, v8_enable_sandbox cannot be used.
# Note that enabling pointer compression without enabling sandbox is unsupported by V8,
# so this can be broken at any time.
- o['variables']['v8_enable_sandbox'] = 0
+ o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_pointer_compression_shared_cage'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_external_code_space'] = 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
diff --git a/node.gni b/node.gni diff --git a/node.gni b/node.gni
index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3fd219be7d 100644 index 35ccd0487f20cece033d58827ecb7ed016908ee4..b4450e3dd17994d1eaf59eb5cff5912545e89793 100644
--- a/node.gni --- a/node.gni
+++ b/node.gni +++ b/node.gni
@@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
@ -55,10 +68,10 @@ index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3f
assert(!node_enable_inspector || node_use_openssl, assert(!node_enable_inspector || node_use_openssl,
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index defb657a62a0316224a02b68505ac1142fd89d03..d637faac88875bfa110e2b8d1f53962061d98279 100644 index 092341dbfbabe15b15ed43057d399f754505f6fd..f14b45850e42585f5686b7201e2b8281ed8c24e1 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -785,6 +785,7 @@ void BuiltinLoader::RegisterExternalReferences( @@ -788,6 +788,7 @@ void BuiltinLoader::RegisterExternalReferences(
registry->Register(GetNatives); registry->Register(GetNatives);
RegisterExternalReferencesForInternalizedBuiltinCode(registry); RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@ -80,10 +93,10 @@ index f9426599f2d5dc6ad061407f0c4eb2c9203a4433..302030f610965f07dd6998d282275c1b
// Handles compilation and caching of built-in JavaScript modules and // Handles compilation and caching of built-in JavaScript modules and
// bootstrap scripts, whose source are bundled into the binary as static data. // bootstrap scripts, whose source are bundled into the binary as static data.
diff --git a/tools/install.py b/tools/install.py diff --git a/tools/install.py b/tools/install.py
index 17515720ba9c85d533465365188021074a8d30f4..92f83a83be67aafc9ead6923b868dbb0de39db34 100755 index 8797b59e59c85a8877b977fa3281e50165e6f6b2..0af01e075616195f38fb242626dcab770ec1eb57 100755
--- a/tools/install.py --- a/tools/install.py
+++ b/tools/install.py +++ b/tools/install.py
@@ -212,6 +212,7 @@ def headers(options, action): @@ -222,6 +222,7 @@ def headers(options, action):
'include/cppgc/internal/caged-heap-local-data.h', 'include/cppgc/internal/caged-heap-local-data.h',
'include/cppgc/internal/caged-heap.h', 'include/cppgc/internal/caged-heap.h',
'include/cppgc/internal/compiler-specific.h', 'include/cppgc/internal/compiler-specific.h',
@ -91,7 +104,7 @@ index 17515720ba9c85d533465365188021074a8d30f4..92f83a83be67aafc9ead6923b868dbb0
'include/cppgc/internal/finalizer-trait.h', 'include/cppgc/internal/finalizer-trait.h',
'include/cppgc/internal/gc-info.h', 'include/cppgc/internal/gc-info.h',
'include/cppgc/internal/logging.h', 'include/cppgc/internal/logging.h',
@@ -291,6 +292,7 @@ def headers(options, action): @@ -301,6 +302,7 @@ def headers(options, action):
'include/v8-promise.h', 'include/v8-promise.h',
'include/v8-proxy.h', 'include/v8-proxy.h',
'include/v8-regexp.h', 'include/v8-regexp.h',

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com> From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 12 Feb 2025 15:31:07 +0100 Date: Thu, 26 Jun 2025 09:25:24 +0000
Subject: build: change crdtp::ProtocolTypeTraits signatures to avoid conflict Subject: build: change crdtp::ProtocolTypeTraits signatures to avoid conflict
After https://github.com/nodejs/node/pull/56649 we see conflicts with the After https://github.com/nodejs/node/pull/56649 we see conflicts with the
@ -14,7 +14,7 @@ error: duplicate symbol: crdtp::ProtocolTypeTraits<std::__Cr::basic_string<char,
Some distinguishing change should be upstreamed to Node.js. Some distinguishing change should be upstreamed to Node.js.
diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc
index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb314eb33666 100644 index 8521730bd03cdfce47e9b5d0f5d68a568bc3de8c..28f4598aa7ea0e93350f79566c06d0f08313be9f 100644
--- a/src/inspector/node_string.cc --- a/src/inspector/node_string.cc
+++ b/src/inspector/node_string.cc +++ b/src/inspector/node_string.cc
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
@ -27,7 +27,7 @@ index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb31
if (state->tokenizer()->TokenTag() == cbor::CBORTokenTag::STRING8) { if (state->tokenizer()->TokenTag() == cbor::CBORTokenTag::STRING8) {
span<uint8_t> cbor_span = state->tokenizer()->GetString8(); span<uint8_t> cbor_span = state->tokenizer()->GetString8();
value->assign(reinterpret_cast<const char*>(cbor_span.data()), value->assign(reinterpret_cast<const char*>(cbor_span.data()),
@@ -24,12 +25,13 @@ bool ProtocolTypeTraits<std::string>::Deserialize(DeserializerState* state, @@ -24,7 +25,8 @@ bool ProtocolTypeTraits<std::string>::Deserialize(DeserializerState* state,
} }
void ProtocolTypeTraits<std::string>::Serialize(const std::string& value, void ProtocolTypeTraits<std::string>::Serialize(const std::string& value,
@ -36,18 +36,12 @@ index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb31
+ void* extra) { + void* extra) {
cbor::EncodeString8(SpanFrom(value), bytes); cbor::EncodeString8(SpanFrom(value), bytes);
} }
-
} // namespace crdtp
+
namespace node {
namespace inspector {
namespace protocol {
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
index 38cf96e874dcc49cde87137b2737c35a84f418d0..b2f67c224acc7b3a3b867867e251a7c62833f46e 100644 index 94ec9b2301998c4c5aad9ca3dae72ecf323fa0bb..a0d19a592d7bf9b00d6b98ef1ae931626ebb945c 100644
--- a/src/inspector/node_string.h --- a/src/inspector/node_string.h
+++ b/src/inspector/node_string.h +++ b/src/inspector/node_string.h
@@ -15,8 +15,8 @@ namespace crdtp { @@ -19,8 +19,8 @@ namespace crdtp {
template <> template <>
struct ProtocolTypeTraits<std::string> { struct ProtocolTypeTraits<std::string> {
@ -57,4 +51,4 @@ index 38cf96e874dcc49cde87137b2737c35a84f418d0..b2f67c224acc7b3a3b867867e251a7c6
+ static void Serialize(const std::string& value, std::vector<uint8_t>* bytes, void* extra = nullptr); + static void Serialize(const std::string& value, std::vector<uint8_t>* bytes, void* extra = nullptr);
}; };
} // namespace crdtp template <>

View file

@ -10,10 +10,10 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8
This can be removed when Electron upgrades to a version of Node.js containing the required V8 version. This can be removed when Electron upgrades to a version of Node.js containing the required V8 version.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index f3476a91e4c3cda7cecf49e07bb594a167ac46ef..de73f6c18131f43e6fe3107c866599aa3398cf10 100644 index 03fefab4b0a9727925411b95310831ffdc33e8d9..f9b5e47f1d67807435529c99d12f419d0fd4269f 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -530,7 +530,7 @@ @@ -538,7 +538,7 @@
'-fno-rtti', '-fno-rtti',
'-fno-exceptions', '-fno-exceptions',
'-fno-strict-aliasing', '-fno-strict-aliasing',
@ -22,7 +22,7 @@ index f3476a91e4c3cda7cecf49e07bb594a167ac46ef..de73f6c18131f43e6fe3107c866599aa
], ],
'defines': [ '__STDC_FORMAT_MACROS' ], 'defines': [ '__STDC_FORMAT_MACROS' ],
'ldflags': [ '-rdynamic' ], 'ldflags': [ '-rdynamic' ],
@@ -700,7 +700,7 @@ @@ -708,7 +708,7 @@
['clang==1', { ['clang==1', {
'xcode_settings': { 'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',

View file

@ -64,10 +64,10 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
module.exports = { module.exports = {
diff --git a/node.gyp b/node.gyp diff --git a/node.gyp b/node.gyp
index ad010a8d99cf08013b7202eddce66e5b3885652d..d735b887d05ddfadec8e56dd8eae09646890aa84 100644 index 0434887c363a586cbfa0438765fc8800d4237057..20fbf03cee24e66f9ad0d394dbcfa3ad03348890 100644
--- a/node.gyp --- a/node.gyp
+++ b/node.gyp +++ b/node.gyp
@@ -176,7 +176,6 @@ @@ -175,7 +175,6 @@
'src/timers.cc', 'src/timers.cc',
'src/timer_wrap.cc', 'src/timer_wrap.cc',
'src/tracing/agent.cc', 'src/tracing/agent.cc',
@ -75,7 +75,7 @@ index ad010a8d99cf08013b7202eddce66e5b3885652d..d735b887d05ddfadec8e56dd8eae0964
'src/tracing/node_trace_writer.cc', 'src/tracing/node_trace_writer.cc',
'src/tracing/trace_event.cc', 'src/tracing/trace_event.cc',
'src/tracing/traced_value.cc', 'src/tracing/traced_value.cc',
@@ -305,7 +304,6 @@ @@ -302,7 +301,6 @@
'src/tcp_wrap.h', 'src/tcp_wrap.h',
'src/timers.h', 'src/timers.h',
'src/tracing/agent.h', 'src/tracing/agent.h',

View file

@ -7,10 +7,10 @@ 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. This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a167ac46ef 100644 index bfe567e016cf102d2087f7647e64cc051116ab8d..03fefab4b0a9727925411b95310831ffdc33e8d9 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -88,6 +88,8 @@ @@ -89,6 +89,8 @@
'v8_use_perfetto': 0, 'v8_use_perfetto': 0,
'tsan%': 0, 'tsan%': 0,
@ -19,15 +19,17 @@ index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a1
##### end V8 defaults ##### ##### end V8 defaults #####
# When building native modules using 'npm install' with the system npm, # When building native modules using 'npm install' with the system npm,
@@ -293,6 +295,7 @@ @@ -297,7 +299,8 @@
# Defines these mostly for node-gyp to pickup.
'defines': [
'_GLIBCXX_USE_CXX11_ABI=1', '_GLIBCXX_USE_CXX11_ABI=1',
# This help forks when building Node.js on a 32-bit arch as
# libuv is always compiled with _FILE_OFFSET_BITS=64
- '_FILE_OFFSET_BITS=64'
+ '_FILE_OFFSET_BITS=64',
+ 'ELECTRON_ENSURE_CONFIG_GYPI', + 'ELECTRON_ENSURE_CONFIG_GYPI',
], ],
# Forcibly disable -Werror. We support a wide range of compilers, it's # Forcibly disable -Werror. We support a wide range of compilers, it's
@@ -449,6 +452,11 @@ @@ -454,6 +457,11 @@
}], }],
], ],
}], }],
@ -40,10 +42,10 @@ index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a1
# list in v8/BUILD.gn. # list in v8/BUILD.gn.
['v8_enable_v8_checks == 1', { ['v8_enable_v8_checks == 1', {
diff --git a/configure.py b/configure.py diff --git a/configure.py b/configure.py
index 932484674e5b15b765b8bfe307bdf99b49b5039f..befaa85527b9ebebad226e603586e23d04ec1e51 100755 index e9c2a4391f4058a21a259cacaac4fde5d199288e..7821a0d3a7179a9e7fa9e48a062c2b0e7705ca6f 100755
--- a/configure.py --- a/configure.py
+++ b/configure.py +++ b/configure.py
@@ -1698,6 +1698,7 @@ def configure_library(lib, output, pkgname=None): @@ -1704,6 +1704,7 @@ def configure_library(lib, output, pkgname=None):
def configure_v8(o, configs): def configure_v8(o, configs):
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0) set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)

View file

@ -34,7 +34,7 @@ index 411eab8136d5957ae8a491bc38ffbdc88e59f5da..63c93b5be09692d0d4b6bfbb214b173b
let kResistStopPropagation; let kResistStopPropagation;
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index d637faac88875bfa110e2b8d1f53962061d98279..e0b58c4d0ac5640a677c22d710f88f1b318378d7 100644 index f14b45850e42585f5686b7201e2b8281ed8c24e1..915b8cba6d512096e6090272ab3fbc63d5c61ce8 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -35,6 +35,7 @@ using v8::Value; @@ -35,6 +35,7 @@ using v8::Value;

View file

@ -25,32 +25,6 @@ index 203b4abbc44df9e58083c819f61f9025104abdc6..73bf3839866a2652ca660f1117e8f249
# The NODE_MODULE_VERSION defined in node_version.h. # The NODE_MODULE_VERSION defined in node_version.h.
node_module_version = exec_script("$node_path/tools/getmoduleversion.py", [], "value") node_module_version = exec_script("$node_path/tools/getmoduleversion.py", [], "value")
diff --git a/src/inspector/node_json.cc b/src/inspector/node_json.cc
index d8aacbdf1a8fc858c792ad3ce17ca2f46baebe7e..4625008c048532c2c3340130670647d2877430bd 100644
--- a/src/inspector/node_json.cc
+++ b/src/inspector/node_json.cc
@@ -72,7 +72,7 @@ class ValueParserHandler : public ParserHandler {
void HandleBinary(span<uint8_t> bytes) override {
AddValueToParent(
- BinaryValue::create(Binary::fromSpan(bytes.data(), bytes.size())));
+ BinaryValue::create(Binary::fromSpan(bytes)));
}
void HandleDouble(double value) override {
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
index b2f67c224acc7b3a3b867867e251a7c62833f46e..33e93ce5bf7dda7e30b7b1b198ff3b53ccfac22a 100644
--- a/src/inspector/node_string.h
+++ b/src/inspector/node_string.h
@@ -66,7 +66,7 @@ class Binary {
static Binary fromBase64(const std::string_view base64, bool* success) {
UNREACHABLE();
}
- static Binary fromSpan(const uint8_t* data, size_t size) { UNREACHABLE(); }
+ static Binary fromSpan(crdtp::span<const uint8_t> data) { UNREACHABLE(); }
};
} // namespace protocol
diff --git a/src/inspector/unofficial.gni b/src/inspector/unofficial.gni diff --git a/src/inspector/unofficial.gni b/src/inspector/unofficial.gni
index 3d7aa148678b2646b88fa7c32abec91791b02b82..4810d93eb971b253f7dadff7011a632f6dbe6a2b 100644 index 3d7aa148678b2646b88fa7c32abec91791b02b82..4810d93eb971b253f7dadff7011a632f6dbe6a2b 100644
--- a/src/inspector/unofficial.gni --- a/src/inspector/unofficial.gni

View file

@ -11,10 +11,10 @@ node-gyp will use the result of `process.config` that reflects the environment
in which the binary got built. in which the binary got built.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index de73f6c18131f43e6fe3107c866599aa3398cf10..e2171e14b9e29dfc3c629f8164545d56d5e9057e 100644 index f9b5e47f1d67807435529c99d12f419d0fd4269f..c99f583d3674347dd6eb9a5eea1ed5588e376d31 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -127,6 +127,7 @@ @@ -128,6 +128,7 @@
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
}], }],
['OS=="mac"', { ['OS=="mac"', {

View file

@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Mon, 9 Dec 2024 11:18:51 -0600
Subject: build: use third_party/simdutf
use the Chromium version of simdutf to avoid duplicate symbols
diff --git a/node.gni b/node.gni
index 56a554175b805c1703f13d62041f8c80d6e94dd9..203b4abbc44df9e58083c819f61f9025104abdc6 100644
--- a/node.gni
+++ b/node.gni
@@ -14,7 +14,7 @@ declare_args() {
node_openssl_path = "//third_party/boringssl"
# The location of simdutf - use the one from node's deps by default.
- node_simdutf_path = "$node_path/deps/simdutf"
+ node_simdutf_path = "//third_party/simdutf"
# The NODE_MODULE_VERSION defined in node_version.h.
node_module_version = exec_script("$node_path/tools/getmoduleversion.py", [], "value")

View file

@ -11,10 +11,10 @@ Without this patch, building with simdjson fails with
This patch can be removed once this is fixed upstream in simdjson. This patch can be removed once this is fixed upstream in simdjson.
diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h
index c1535ee81300b9cb93eb9ee6e769246793f936c3..3350287401e181e1d4ee432b8bd16081d0d7a73e 100644 index a0d449975224a3e0db5c05de79b290763d6e390c..e77e47f972b4609e38aa8b68ab0d81ed1575effb 100644
--- a/deps/simdjson/simdjson.h --- a/deps/simdjson/simdjson.h
+++ b/deps/simdjson/simdjson.h +++ b/deps/simdjson/simdjson.h
@@ -3837,12 +3837,17 @@ inline std::ostream& operator<<(std::ostream& out, simdjson_result<padded_string @@ -3868,12 +3868,17 @@ inline std::ostream& operator<<(std::ostream& out, simdjson_result<padded_string
} // namespace simdjson } // namespace simdjson
@ -32,7 +32,7 @@ index c1535ee81300b9cb93eb9ee6e769246793f936c3..3350287401e181e1d4ee432b8bd16081
namespace simdjson { namespace simdjson {
namespace internal { namespace internal {
@@ -4242,6 +4247,9 @@ inline simdjson_result<padded_string> padded_string::load(std::string_view filen @@ -4273,6 +4278,9 @@ inline simdjson_result<padded_string> padded_string::load(std::string_view filen
} // namespace simdjson } // namespace simdjson
@ -42,7 +42,7 @@ index c1535ee81300b9cb93eb9ee6e769246793f936c3..3350287401e181e1d4ee432b8bd16081
inline simdjson::padded_string operator ""_padded(const char *str, size_t len) { inline simdjson::padded_string operator ""_padded(const char *str, size_t len) {
return simdjson::padded_string(str, len); return simdjson::padded_string(str, len);
} }
@@ -4250,6 +4258,8 @@ inline simdjson::padded_string operator ""_padded(const char8_t *str, size_t len @@ -4281,6 +4289,8 @@ inline simdjson::padded_string operator ""_padded(const char8_t *str, size_t len
return simdjson::padded_string(reinterpret_cast<const char8_t *>(str), len); return simdjson::padded_string(reinterpret_cast<const char8_t *>(str), len);
} }
#endif #endif

View file

@ -11,7 +11,7 @@ its own blended handler between Node and Blink.
Not upstreamable. Not upstreamable.
diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js
index fd17ce8695c55f8f38ed19d59960acc1a7692bc8..96754db3277b3a0445b69275368602166c6d5423 100644 index 9d6f850f667c5186efe6855bc3d5f5af332bdaa7..8521759e20adf53024e5893dbf3cb36e1752085e 100644
--- a/lib/internal/modules/esm/utils.js --- a/lib/internal/modules/esm/utils.js
+++ b/lib/internal/modules/esm/utils.js +++ b/lib/internal/modules/esm/utils.js
@@ -30,7 +30,7 @@ const { @@ -30,7 +30,7 @@ const {
@ -40,10 +40,10 @@ index fd17ce8695c55f8f38ed19d59960acc1a7692bc8..96754db3277b3a0445b6927536860216
/** /**
diff --git a/src/module_wrap.cc b/src/module_wrap.cc diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 912acc8da815405531d8b527383f19c3731be100..8d48f4693c3b5f0d1d94d3edadc48c4f36d1bf97 100644 index cdd0ba00eb0cafbc79b816017423f9021ca2979d..6916497f6feb14e482cf5080b57d639ae7292d20 100644
--- a/src/module_wrap.cc --- a/src/module_wrap.cc
+++ b/src/module_wrap.cc +++ b/src/module_wrap.cc
@@ -858,7 +858,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback( @@ -875,7 +875,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
return module->module_.Get(isolate); return module->module_.Get(isolate);
} }
@ -52,7 +52,7 @@ index 912acc8da815405531d8b527383f19c3731be100..8d48f4693c3b5f0d1d94d3edadc48c4f
Local<Context> context, Local<Context> context,
Local<Data> host_defined_options, Local<Data> host_defined_options,
Local<Value> resource_name, Local<Value> resource_name,
@@ -923,12 +923,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( @@ -947,12 +947,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
Realm* realm = Realm::GetCurrent(args); Realm* realm = Realm::GetCurrent(args);
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
@ -68,7 +68,7 @@ index 912acc8da815405531d8b527383f19c3731be100..8d48f4693c3b5f0d1d94d3edadc48c4f
} }
void ModuleWrap::HostInitializeImportMetaObjectCallback( void ModuleWrap::HostInitializeImportMetaObjectCallback(
@@ -970,13 +971,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( @@ -994,13 +995,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
Realm* realm = Realm::GetCurrent(args); Realm* realm = Realm::GetCurrent(args);
Isolate* isolate = realm->isolate(); Isolate* isolate = realm->isolate();
@ -87,7 +87,7 @@ index 912acc8da815405531d8b527383f19c3731be100..8d48f4693c3b5f0d1d94d3edadc48c4f
MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback( MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
diff --git a/src/module_wrap.h b/src/module_wrap.h diff --git a/src/module_wrap.h b/src/module_wrap.h
index 83b5793013cbc453cf92c0a006fc7be3c06ad276..90353954bc497cb4ae413dc134850f8abb4efc7c 100644 index ef4dfd1d6b091d2b0f71b946904a47415b6435ba..862f946a75f2a2949d7eeb7f97e96289beab8078 100644
--- a/src/module_wrap.h --- a/src/module_wrap.h
+++ b/src/module_wrap.h +++ b/src/module_wrap.h
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
@ -123,7 +123,7 @@ index 83b5793013cbc453cf92c0a006fc7be3c06ad276..90353954bc497cb4ae413dc134850f8a
private: private:
ModuleWrap(Realm* realm, ModuleWrap(Realm* realm,
v8::Local<v8::Object> object, v8::Local<v8::Object> object,
@@ -129,7 +139,6 @@ class ModuleWrap : public BaseObject { @@ -130,7 +140,6 @@ class ModuleWrap : public BaseObject {
v8::Local<v8::String> specifier, v8::Local<v8::String> specifier,
v8::Local<v8::FixedArray> import_attributes, v8::Local<v8::FixedArray> import_attributes,
v8::Local<v8::Module> referrer); v8::Local<v8::Module> referrer);

View file

@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 26 Jun 2025 09:20:43 +0000
Subject: chore: remove protocol::Maybe from node_string
It was removed upstream in https://chromium-review.googlesource.com/c/chromium/src/+/6049967.
This should be upstreamed.
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
index a0d19a592d7bf9b00d6b98ef1ae931626ebb945c..ddedca4a5b9b35258050f8b4cb446ceeba956896 100644
--- a/src/inspector/node_string.h
+++ b/src/inspector/node_string.h
@@ -6,7 +6,6 @@
#include <cstring>
#include <sstream>
#include <string>
-#include "crdtp/maybe.h"
#include "crdtp/protocol_core.h"
#include "util.h"
#include "v8-inspector.h"
@@ -31,11 +30,6 @@ struct ProtocolTypeTraits<node::inspector::protocol::Binary> {
std::vector<uint8_t>* bytes);
};
-template <>
-struct detail::MaybeTypedef<node::inspector::protocol::Binary> {
- typedef ValueMaybe<node::inspector::protocol::Binary> type;
-};
-
} // namespace crdtp
namespace node {

View file

@ -15,10 +15,10 @@ Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
diff --git a/doc/api/cli.md b/doc/api/cli.md diff --git a/doc/api/cli.md b/doc/api/cli.md
index 121d8f2bbd2b1d93067a06a902b1e7b986bcdb49..3460ad33c6186dcc3aa3281d80b723a1cc1d50dd 100644 index d924287df3ca29681cf71e2fbd402314ce8edd97..f2f4d25a838b9758234cd667b0fb537d0d0fcced 100644
--- a/doc/api/cli.md --- a/doc/api/cli.md
+++ b/doc/api/cli.md +++ b/doc/api/cli.md
@@ -3367,7 +3367,6 @@ one is included in the list below. @@ -3386,7 +3386,6 @@ one is included in the list below.
* `--tls-min-v1.1` * `--tls-min-v1.1`
* `--tls-min-v1.2` * `--tls-min-v1.2`
* `--tls-min-v1.3` * `--tls-min-v1.3`
@ -43,7 +43,7 @@ index 663d123ac728f097e8a76c94cf10c53d059983d7..497f5a61182beafbaa26b94518105635
Print stack traces for deprecations. Print stack traces for deprecations.
. .
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 6f8f6386d0db8aef1e2e0126cc9064101cbe6112..bc670a6c8b5027417cdc35e1cd94a60f63fd342d 100644 index 0c2a4d344c991c2ca0d9d90934cf7921abf2a629..19d9fb77f1aaf003e43b7d7016f45e6c35df06b3 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -232,44 +232,6 @@ void Environment::WaitForInspectorFrontendByOptions() { @@ -232,44 +232,6 @@ void Environment::WaitForInspectorFrontendByOptions() {
@ -110,10 +110,10 @@ index 6f8f6386d0db8aef1e2e0126cc9064101cbe6112..bc670a6c8b5027417cdc35e1cd94a60f
isolate_->SetPromiseHook(TracePromises); isolate_->SetPromiseHook(TracePromises);
} }
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index a9500716f2a955fc591628a969c5fba40783a2e7..b153d2c6a771e80bcdf5ed6adbc1cd225b3bf97e 100644 index 9829b0b2b2d013b93ac14d3ec6d46c35abcc4635..5fb2e713a50185b997935cb15fddd7b8b65a5b82 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -770,10 +770,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { @@ -773,10 +773,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"throw an exception on deprecations", "throw an exception on deprecations",
&EnvironmentOptions::throw_deprecation, &EnvironmentOptions::throw_deprecation,
kAllowedInEnvvar); kAllowedInEnvvar);
@ -125,10 +125,10 @@ index a9500716f2a955fc591628a969c5fba40783a2e7..b153d2c6a771e80bcdf5ed6adbc1cd22
"show stack traces on deprecations", "show stack traces on deprecations",
&EnvironmentOptions::trace_deprecation, &EnvironmentOptions::trace_deprecation,
diff --git a/src/node_options.h b/src/node_options.h diff --git a/src/node_options.h b/src/node_options.h
index 60068b008b2e2a034c3f0c58b947a8d04d55e3b2..d821bc6a9adf28ea312a9c446f8acfc8ed586ae3 100644 index eb18fdd617fd19e5b97cd67f351e70c28fee3e75..216c0f92167bd131e5ef2ea96ad47425ff51c3f7 100644
--- a/src/node_options.h --- a/src/node_options.h
+++ b/src/node_options.h +++ b/src/node_options.h
@@ -203,7 +203,6 @@ class EnvironmentOptions : public Options { @@ -204,7 +204,6 @@ class EnvironmentOptions : public Options {
std::vector<std::string> coverage_include_pattern; std::vector<std::string> coverage_include_pattern;
std::vector<std::string> coverage_exclude_pattern; std::vector<std::string> coverage_exclude_pattern;
bool throw_deprecation = false; bool throw_deprecation = false;

View file

@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
diff --git a/doc/api/cli.md b/doc/api/cli.md diff --git a/doc/api/cli.md b/doc/api/cli.md
index 6f984926a62973ba36bd3c27cc39b01f2bcac819..121d8f2bbd2b1d93067a06a902b1e7b986bcdb49 100644 index cc311472678108f21eed70281e91b0d40c5fe7b6..d924287df3ca29681cf71e2fbd402314ce8edd97 100644
--- a/doc/api/cli.md --- a/doc/api/cli.md
+++ b/doc/api/cli.md +++ b/doc/api/cli.md
@@ -3404,7 +3404,6 @@ V8 options that are allowed are: @@ -3423,7 +3423,6 @@ V8 options that are allowed are:
* `--disallow-code-generation-from-strings` * `--disallow-code-generation-from-strings`
* `--enable-etw-stack-walking` * `--enable-etw-stack-walking`
* `--expose-gc` * `--expose-gc`
@ -30,10 +30,10 @@ index 6f984926a62973ba36bd3c27cc39b01f2bcac819..121d8f2bbd2b1d93067a06a902b1e7b9
* `--jitless` * `--jitless`
* `--max-old-space-size` * `--max-old-space-size`
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index bb1e80ece4158dfed1b8bab7dc6d00dd56505aac..a9500716f2a955fc591628a969c5fba40783a2e7 100644 index d2e945b1d6ef6729709cc73c238cfae46d4e56b6..9829b0b2b2d013b93ac14d3ec6d46c35abcc4635 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -992,11 +992,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( @@ -995,11 +995,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"disallow eval and friends", "disallow eval and friends",
V8Option{}, V8Option{},
kAllowedInEnvvar); kAllowedInEnvvar);

View file

@ -8,10 +8,10 @@ to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used
by the crashpad client to connect with the handler process. by the crashpad client to connect with the handler process.
diff --git a/lib/child_process.js b/lib/child_process.js diff --git a/lib/child_process.js b/lib/child_process.js
index bb27670112c1ea42c7ff00883fe4b684544d9cd4..4d4da798ce59ce42e42d1f05fccf07699c033d46 100644 index e848b3d5ee9b13ea3ea303eb3b57ef47ef951580..5b89c420f1a917526ab311fed52bff01637a86fe 100644
--- a/lib/child_process.js --- a/lib/child_process.js
+++ b/lib/child_process.js +++ b/lib/child_process.js
@@ -61,6 +61,7 @@ let debug = require('internal/util/debuglog').debuglog( @@ -62,6 +62,7 @@ let debug = require('internal/util/debuglog').debuglog(
); );
const { Buffer } = require('buffer'); const { Buffer } = require('buffer');
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
@ -19,7 +19,7 @@ index bb27670112c1ea42c7ff00883fe4b684544d9cd4..4d4da798ce59ce42e42d1f05fccf0769
const { const {
AbortError, AbortError,
@@ -153,7 +154,6 @@ function fork(modulePath, args = [], options) { @@ -154,7 +155,6 @@ function fork(modulePath, args = [], options) {
ArrayPrototypeSplice(execArgv, index - 1, 2); ArrayPrototypeSplice(execArgv, index - 1, 2);
} }
} }
@ -27,7 +27,7 @@ index bb27670112c1ea42c7ff00883fe4b684544d9cd4..4d4da798ce59ce42e42d1f05fccf0769
args = [...execArgv, modulePath, ...args]; args = [...execArgv, modulePath, ...args];
if (typeof options.stdio === 'string') { if (typeof options.stdio === 'string') {
@@ -609,6 +609,22 @@ function normalizeSpawnArguments(file, args, options) { @@ -610,6 +610,22 @@ function normalizeSpawnArguments(file, args, options) {
'options.windowsVerbatimArguments'); 'options.windowsVerbatimArguments');
} }
@ -50,7 +50,7 @@ index bb27670112c1ea42c7ff00883fe4b684544d9cd4..4d4da798ce59ce42e42d1f05fccf0769
if (options.shell) { if (options.shell) {
validateArgumentNullCheck(options.shell, 'options.shell'); validateArgumentNullCheck(options.shell, 'options.shell');
const command = ArrayPrototypeJoin([file, ...args], ' '); const command = ArrayPrototypeJoin([file, ...args], ' ');
@@ -642,7 +658,6 @@ function normalizeSpawnArguments(file, args, options) { @@ -643,7 +659,6 @@ function normalizeSpawnArguments(file, args, options) {
ArrayPrototypeUnshift(args, file); ArrayPrototypeUnshift(args, file);
} }

View file

@ -9,10 +9,10 @@ modules to sandboxed renderers.
TODO(codebytere): remove and replace with a public facing API. TODO(codebytere): remove and replace with a public facing API.
diff --git a/src/node_binding.cc b/src/node_binding.cc diff --git a/src/node_binding.cc b/src/node_binding.cc
index 6c337232149ccb8bdb1188e72d59a052b1cb79c1..44ad4a480a33a2c39494a7d961318270a25620d8 100644 index aa4213c3622eab077fa8d764775c1f95c6313e34..11f722d2d7c21079cbc65033429086231a786ca7 100644
--- a/src/node_binding.cc --- a/src/node_binding.cc
+++ b/src/node_binding.cc +++ b/src/node_binding.cc
@@ -653,6 +653,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) { @@ -652,6 +652,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(exports); args.GetReturnValue().Set(exports);
} }
@ -24,10 +24,10 @@ index 6c337232149ccb8bdb1188e72d59a052b1cb79c1..44ad4a480a33a2c39494a7d961318270
Environment* env = Environment::GetCurrent(args); Environment* env = Environment::GetCurrent(args);
diff --git a/src/node_binding.h b/src/node_binding.h diff --git a/src/node_binding.h b/src/node_binding.h
index eb1364cb01a2bea52bce768056e73b0f3a86ae35..d421a2773403e7b22fcca2fcf8275ef2d9654c55 100644 index 611f38ef5e21cc303127326d50c648fbb557b4da..3d95ad2733dc83d0b7d37d57c337732c8a0e83d7 100644
--- a/src/node_binding.h --- a/src/node_binding.h
+++ b/src/node_binding.h +++ b/src/node_binding.h
@@ -146,6 +146,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args); @@ -154,6 +154,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args); void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args); void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args);

View file

@ -23,10 +23,10 @@ index d1f41e1c9f44838410326df23b1b175fa16ba199..dcf69093469b611a6f9db2bb84530456
asynchronous file system operations. asynchronous file system operations.
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
index 9e450c5110fe57117b686bf683cc6631f37efaeb..f75a496071ac3396cbc6dec819eaab7294609deb 100644 index 938e998fdc54d17c8d0d4b1949087b968044829f..0295eeddbb4eb1cffd9dbcd02e037907fadc1b7e 100644
--- a/deps/uv/include/uv.h --- a/deps/uv/include/uv.h
+++ b/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h
@@ -261,6 +261,7 @@ typedef struct uv_metrics_s uv_metrics_t; @@ -263,6 +263,7 @@ typedef struct uv_metrics_s uv_metrics_t;
typedef enum { typedef enum {
UV_LOOP_BLOCK_SIGNAL = 0, UV_LOOP_BLOCK_SIGNAL = 0,
UV_METRICS_IDLE_TIME, UV_METRICS_IDLE_TIME,
@ -35,18 +35,27 @@ index 9e450c5110fe57117b686bf683cc6631f37efaeb..f75a496071ac3396cbc6dec819eaab72
#define UV_LOOP_USE_IO_URING_SQPOLL UV_LOOP_USE_IO_URING_SQPOLL #define UV_LOOP_USE_IO_URING_SQPOLL UV_LOOP_USE_IO_URING_SQPOLL
} uv_loop_option; } uv_loop_option;
diff --git a/deps/uv/src/unix/async.c b/deps/uv/src/unix/async.c diff --git a/deps/uv/src/unix/async.c b/deps/uv/src/unix/async.c
index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..117190ef26338944b78dbed7380c631de8057223 100644 index 538ae7876f2b2463716459b179d74843383295be..6ce53f12834c7a34241ea0865bda99af0541ea5f 100644
--- a/deps/uv/src/unix/async.c --- a/deps/uv/src/unix/async.c
+++ b/deps/uv/src/unix/async.c +++ b/deps/uv/src/unix/async.c
@@ -38,7 +38,6 @@ @@ -40,7 +40,7 @@
#include <sys/eventfd.h>
#if UV__KQUEUE_EVFILT_USER
static uv_once_t kqueue_runtime_detection_guard = UV_ONCE_INIT;
-static int kqueue_evfilt_user_support = 1;
+int kqueue_evfilt_user_support = 1;
static void uv__kqueue_runtime_detection(void) {
@@ -66,7 +66,6 @@ static void uv__kqueue_runtime_detection(void) {
}
#endif #endif
-static void uv__async_send(uv_loop_t* loop); -static void uv__async_send(uv_loop_t* loop);
static int uv__async_start(uv_loop_t* loop); static int uv__async_start(uv_loop_t* loop);
static void uv__cpu_relax(void); static void uv__cpu_relax(void);
@@ -78,7 +77,7 @@ int uv_async_send(uv_async_t* handle) { @@ -106,7 +105,7 @@ int uv_async_send(uv_async_t* handle) {
/* Wake up the other thread's event loop. */ /* Wake up the other thread's event loop. */
if (atomic_exchange(pending, 1) == 0) if (atomic_exchange(pending, 1) == 0)
@ -55,7 +64,7 @@ index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..117190ef26338944b78dbed7380c631d
/* Set the loop to not-busy. */ /* Set the loop to not-busy. */
atomic_fetch_add(busy, -1); atomic_fetch_add(busy, -1);
@@ -178,39 +177,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) { @@ -210,50 +209,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
} }
@ -76,6 +85,17 @@ index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..117190ef26338944b78dbed7380c631d
- len = sizeof(val); - len = sizeof(val);
- fd = loop->async_io_watcher.fd; /* eventfd */ - fd = loop->async_io_watcher.fd; /* eventfd */
- } - }
-#elif UV__KQUEUE_EVFILT_USER
- struct kevent ev;
-
- if (kqueue_evfilt_user_support) {
- fd = loop->async_io_watcher.fd; /* magic number for EVFILT_USER */
- EV_SET(&ev, fd, EVFILT_USER, 0, NOTE_TRIGGER, 0, 0);
- r = kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL);
- if (r == 0)
- return;
- abort();
- }
-#endif -#endif
- -
- do - do
@ -96,20 +116,20 @@ index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..117190ef26338944b78dbed7380c631d
static int uv__async_start(uv_loop_t* loop) { static int uv__async_start(uv_loop_t* loop) {
int pipefd[2]; int pipefd[2];
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
index 0c52ccf2ad7b2dcae77a7bc4b3af9d1a1346ce18..13cd33a7d3031c5e19c9418a18217d1e4158c82e 100644 index bd51b69b8120e878f3342c2812fb1f4c0fd35071..4c005360c8d83955b727bde3c0ff0bc3e32061a4 100644
--- a/deps/uv/src/unix/core.c --- a/deps/uv/src/unix/core.c
+++ b/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c
@@ -937,6 +937,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { @@ -944,6 +944,9 @@ int uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
loop->watchers[w->fd] = w;
loop->nfds++; loop->nfds++;
} }
+
+ if (uv__get_internal_fields(loop)->flags & UV_LOOP_INTERRUPT_ON_IO_CHANGE) + if (uv__get_internal_fields(loop)->flags & UV_LOOP_INTERRUPT_ON_IO_CHANGE)
+ uv__loop_interrupt(loop); + uv__loop_interrupt(loop);
+
return 0;
} }
@@ -993,6 +996,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
@@ -968,6 +971,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
} }
else if (uv__queue_empty(&w->watcher_queue)) else if (uv__queue_empty(&w->watcher_queue))
uv__queue_insert_tail(&loop->watcher_queue, &w->watcher_queue); uv__queue_insert_tail(&loop->watcher_queue, &w->watcher_queue);
@ -119,7 +139,7 @@ index 0c52ccf2ad7b2dcae77a7bc4b3af9d1a1346ce18..13cd33a7d3031c5e19c9418a18217d1e
} }
@@ -984,6 +990,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { @@ -1009,6 +1015,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
void uv__io_feed(uv_loop_t* loop, uv__io_t* w) { void uv__io_feed(uv_loop_t* loop, uv__io_t* w) {
if (uv__queue_empty(&w->pending_queue)) if (uv__queue_empty(&w->pending_queue))
uv__queue_insert_tail(&loop->pending_queue, &w->pending_queue); uv__queue_insert_tail(&loop->pending_queue, &w->pending_queue);
@ -129,11 +149,24 @@ index 0c52ccf2ad7b2dcae77a7bc4b3af9d1a1346ce18..13cd33a7d3031c5e19c9418a18217d1e
} }
diff --git a/deps/uv/src/unix/internal.h b/deps/uv/src/unix/internal.h
index a1d7d4366308acb6ba8d2b84b7a2be4b89abe2ce..a86505eba1243a8c89d77a1d036d16ac8313a785 100644
--- a/deps/uv/src/unix/internal.h
+++ b/deps/uv/src/unix/internal.h
@@ -523,6 +523,8 @@ int uv__get_constrained_cpu(long long* quota);
* people will be directed here if this number gets printed due to some
* kqueue error and they google for help. */
#define UV__KQUEUE_EVFILT_USER_IDENT 0x1e7e7711
+/* Global variable to cache kqueue EVFILT_USER support detection result */
+extern int kqueue_evfilt_user_support;
#else
#define UV__KQUEUE_EVFILT_USER 0
#endif
diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c
index 179ee999d8052e779dc692aeb5b673d210aaa997..03cca2c491015e5ef958f61a0167d29dfc56e247 100644 index 5d3f0c7a348b334e5651bf8682fe29b355ec0cb9..d0b8686783d009365e89731366afee1878a6757b 100644
--- a/deps/uv/src/unix/loop.c --- a/deps/uv/src/unix/loop.c
+++ b/deps/uv/src/unix/loop.c +++ b/deps/uv/src/unix/loop.c
@@ -224,6 +224,10 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { @@ -228,6 +228,10 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
} }
#endif #endif
@ -144,7 +177,7 @@ index 179ee999d8052e779dc692aeb5b673d210aaa997..03cca2c491015e5ef958f61a0167d29d
if (option != UV_LOOP_BLOCK_SIGNAL) if (option != UV_LOOP_BLOCK_SIGNAL)
return UV_ENOSYS; return UV_ENOSYS;
@@ -234,3 +238,40 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { @@ -238,3 +242,51 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
loop->flags |= UV_LOOP_BLOCK_SIGPROF; loop->flags |= UV_LOOP_BLOCK_SIGPROF;
return 0; return 0;
} }
@ -167,6 +200,17 @@ index 179ee999d8052e779dc692aeb5b673d210aaa997..03cca2c491015e5ef958f61a0167d29d
+ len = sizeof(val); + len = sizeof(val);
+ fd = loop->async_io_watcher.fd; /* eventfd */ + fd = loop->async_io_watcher.fd; /* eventfd */
+ } + }
+#elif UV__KQUEUE_EVFILT_USER
+ struct kevent ev;
+
+ if (kqueue_evfilt_user_support) {
+ fd = loop->async_io_watcher.fd; /* magic number for EVFILT_USER */
+ EV_SET(&ev, fd, EVFILT_USER, 0, NOTE_TRIGGER, 0, 0);
+ r = kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL);
+ if (r == 0)
+ return;
+ abort();
+ }
+#endif +#endif
+ +
+ do + do
@ -186,10 +230,10 @@ index 179ee999d8052e779dc692aeb5b673d210aaa997..03cca2c491015e5ef958f61a0167d29d
+ abort(); + abort();
+} +}
diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h
index 4baede2e506ee1787d554a0ec75bc9eb346fc8f2..385d4f420b50bfd2dc23f119d535c0442a3ce4e7 100644 index b9a8e976eefdd62cfad31f6d3ed9b6179776eaa4..985b8fa3f2594f729af1845334b4afade3e054ee 100644
--- a/deps/uv/src/uv-common.h --- a/deps/uv/src/uv-common.h
+++ b/deps/uv/src/uv-common.h +++ b/deps/uv/src/uv-common.h
@@ -144,6 +144,8 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap); @@ -149,6 +149,8 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
void uv__loop_close(uv_loop_t* loop); void uv__loop_close(uv_loop_t* loop);
@ -198,7 +242,7 @@ index 4baede2e506ee1787d554a0ec75bc9eb346fc8f2..385d4f420b50bfd2dc23f119d535c044
int uv__read_start(uv_stream_t* stream, int uv__read_start(uv_stream_t* stream,
uv_alloc_cb alloc_cb, uv_alloc_cb alloc_cb,
uv_read_cb read_cb); uv_read_cb read_cb);
@@ -280,6 +282,10 @@ void uv__threadpool_cleanup(void); @@ -291,6 +293,10 @@ void uv__threadpool_cleanup(void);
if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \ if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \
(h)->flags |= UV_HANDLE_ACTIVE; \ (h)->flags |= UV_HANDLE_ACTIVE; \
if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \ if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \
@ -210,7 +254,7 @@ index 4baede2e506ee1787d554a0ec75bc9eb346fc8f2..385d4f420b50bfd2dc23f119d535c044
while (0) while (0)
diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c
index e9885a0f1ff3890a8d957c8793e22b01cedc0e97..ae3d09878253fe7169ad7b74b3faea0223f89de5 100644 index 5f41c87ad5ed137c51b43e4941414c89ddff5216..73f26c68e5734d340fe210b4418f0161dc172182 100644
--- a/deps/uv/src/win/core.c --- a/deps/uv/src/win/core.c
+++ b/deps/uv/src/win/core.c +++ b/deps/uv/src/win/core.c
@@ -384,10 +384,20 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { @@ -384,10 +384,20 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
@ -459,10 +503,10 @@ index 6e9917239aa5626dd56fffd6eb2469d3e63224bf..b0da9d1cddc69428e9fb3379d1338cf8
MAKE_VALGRIND_HAPPY(loop); MAKE_VALGRIND_HAPPY(loop);
return 0; return 0;
diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h
index e07bd61ecf73c122a553d5d8232a7478980751a5..21cf8c09edac15ba5ea010d54d3e158e0d1b7e5b 100644 index 0dea544699d75fcf11d4a8b6a7f0d5f4242f892a..6f8c70bc8b6cb2d2ffc1f63fe60920f8fb8a1abe 100644
--- a/deps/uv/test/test-list.h --- a/deps/uv/test/test-list.h
+++ b/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h
@@ -279,6 +279,7 @@ TEST_DECLARE (process_priority) @@ -281,6 +281,7 @@ TEST_DECLARE (process_priority)
TEST_DECLARE (has_ref) TEST_DECLARE (has_ref)
TEST_DECLARE (active) TEST_DECLARE (active)
TEST_DECLARE (embed) TEST_DECLARE (embed)
@ -470,7 +514,7 @@ index e07bd61ecf73c122a553d5d8232a7478980751a5..21cf8c09edac15ba5ea010d54d3e158e
TEST_DECLARE (async) TEST_DECLARE (async)
TEST_DECLARE (async_null_cb) TEST_DECLARE (async_null_cb)
TEST_DECLARE (eintr_handling) TEST_DECLARE (eintr_handling)
@@ -919,6 +920,7 @@ TASK_LIST_START @@ -929,6 +930,7 @@ TASK_LIST_START
TEST_ENTRY (active) TEST_ENTRY (active)
TEST_ENTRY (embed) TEST_ENTRY (embed)

View file

@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 26 Jun 2025 12:46:41 +0000
Subject: fix: -Wmismatched-new-delete in debug_utils.cc
Fixes the following error:
Error: ../../third_party/electron_node/src/debug_utils.cc(491,11): error: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Werror,-Wmismatched-new-delete]
491 | delete str;
| ^
| []
../../third_party/electron_node/src/debug_utils.cc(487,23): note: allocated with 'new[]' here
487 | char* str = new char[size];
| ^
1 error generated.
Upstreamed in https://github.com/nodejs/node/pull/58844.
diff --git a/src/debug_utils.cc b/src/debug_utils.cc
index 97884b9a0f8d6d88e36da06b05642505c767338d..65283ef31da35d0f08fcff7a5e79bf960d861126 100644
--- a/src/debug_utils.cc
+++ b/src/debug_utils.cc
@@ -488,7 +488,7 @@ std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
WideCharToMultiByte(
CP_UTF8, 0, module_name, -1, str, size, nullptr, nullptr);
list.emplace_back(str);
- delete str;
+ delete[] str;
}
}
}

View file

@ -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. the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index 393fe32765794fbc5e92690e968e3c18f0d749fa..d9c0b721fe0a629a30efb3c4e04905176ca0a7f5 100644 index a73d4401f26d8493802d3ecec3e015a77717720a..bfe567e016cf102d2087f7647e64cc051116ab8d 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -90,6 +90,23 @@ @@ -91,6 +91,23 @@
##### end V8 defaults ##### ##### end V8 defaults #####

View file

@ -53,10 +53,10 @@ index 2879e5cf541fb4d226cfd7cc0fe367ca448fb926..03082f0ec4f91382933eec48e77331cd
const maybeMain = resolvedOption <= legacyMainResolveExtensionsIndexes.kResolvedByMainIndexNode ? const maybeMain = resolvedOption <= legacyMainResolveExtensionsIndexes.kResolvedByMainIndexNode ?
packageConfig.main || './' : ''; packageConfig.main || './' : '';
diff --git a/src/node_file.cc b/src/node_file.cc diff --git a/src/node_file.cc b/src/node_file.cc
index 49816349d8bab37fea1d84e5326ee5a11acad7a2..5aea65d6800494def62829432ee48f9c06e65d63 100644 index fe28c340c9b50384e79fe14263d8b3807f49e0b3..37172158d318d6569194fd3c5441d107e155e54c 100644
--- a/src/node_file.cc --- a/src/node_file.cc
+++ b/src/node_file.cc +++ b/src/node_file.cc
@@ -3237,13 +3237,25 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo<Value>& args) { @@ -3523,13 +3523,25 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
} }
BindingData::FilePathIsFileReturnType BindingData::FilePathIsFile( BindingData::FilePathIsFileReturnType BindingData::FilePathIsFile(
@ -83,7 +83,7 @@ index 49816349d8bab37fea1d84e5326ee5a11acad7a2..5aea65d6800494def62829432ee48f9c
uv_fs_t req; uv_fs_t req;
int rc = uv_fs_stat(env->event_loop(), &req, file_path.c_str(), nullptr); int rc = uv_fs_stat(env->event_loop(), &req, file_path.c_str(), nullptr);
@@ -3301,6 +3313,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) { @@ -3587,6 +3599,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
std::optional<std::string> initial_file_path; std::optional<std::string> initial_file_path;
std::string file_path; std::string file_path;
@ -95,7 +95,7 @@ index 49816349d8bab37fea1d84e5326ee5a11acad7a2..5aea65d6800494def62829432ee48f9c
if (args.Length() >= 2 && args[1]->IsString()) { if (args.Length() >= 2 && args[1]->IsString()) {
auto package_config_main = Utf8Value(isolate, args[1]).ToString(); auto package_config_main = Utf8Value(isolate, args[1]).ToString();
@@ -3321,7 +3338,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) { @@ -3607,7 +3624,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
BufferValue buff_file_path(isolate, local_file_path); BufferValue buff_file_path(isolate, local_file_path);
ToNamespacedPath(env, &buff_file_path); ToNamespacedPath(env, &buff_file_path);
@ -104,7 +104,7 @@ index 49816349d8bab37fea1d84e5326ee5a11acad7a2..5aea65d6800494def62829432ee48f9c
case BindingData::FilePathIsFileReturnType::kIsFile: case BindingData::FilePathIsFileReturnType::kIsFile:
return args.GetReturnValue().Set(i); return args.GetReturnValue().Set(i);
case BindingData::FilePathIsFileReturnType::kIsNotFile: case BindingData::FilePathIsFileReturnType::kIsNotFile:
@@ -3358,7 +3375,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) { @@ -3644,7 +3661,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
BufferValue buff_file_path(isolate, local_file_path); BufferValue buff_file_path(isolate, local_file_path);
ToNamespacedPath(env, &buff_file_path); ToNamespacedPath(env, &buff_file_path);

View file

@ -44,10 +44,10 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480
let filename = call.getFileName(); let filename = call.getFileName();
const line = call.getLineNumber() - 1; const line = call.getLineNumber() - 1;
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index 8be78889e8234eb3100f309829bf7470db544dcd..bb1e80ece4158dfed1b8bab7dc6d00dd56505aac 100644 index 14f7764c995e8de6582faf58c9b98a9cbe4fab73..d2e945b1d6ef6729709cc73c238cfae46d4e56b6 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -1557,14 +1557,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) { @@ -1560,14 +1560,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
} }
Isolate* isolate = args.GetIsolate(); Isolate* isolate = args.GetIsolate();

View file

@ -12,10 +12,10 @@ This can be removed/refactored once Node.js upgrades to a version of V8
containing the above CL. containing the above CL.
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index bc670a6c8b5027417cdc35e1cd94a60f63fd342d..49a9670de72c222d6b4a681be001efb4a2651ea3 100644 index 19d9fb77f1aaf003e43b7d7016f45e6c35df06b3..9fad3198757ce639eb491eb628c6264a17002bf2 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -1209,7 +1209,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, @@ -1208,7 +1208,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
result->platform_ = per_process::v8_platform.Platform(); result->platform_ = per_process::v8_platform.Platform();
} }

View file

@ -10,50 +10,15 @@ This should be upstreamed in some form, though it may need to be tweaked
before it's acceptable to upstream, as this patch comments out a couple before it's acceptable to upstream, as this patch comments out a couple
of tests that upstream probably cares about. of tests that upstream probably cares about.
diff --git a/test/common/index.js b/test/common/index.js
index 8f5af57a83dc6b426f1b11bd2e3a8c6c0f2d9a85..f6e00c9f3f3ac4b42662eed6c8d190586f92ab99 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -56,6 +56,8 @@ const hasCrypto = Boolean(process.versions.openssl) &&
const hasQuic = hasCrypto && !!process.config.variables.openssl_quic;
+const openSSLIsBoringSSL = process.versions.openssl === '0.0.0';
+
function parseTestFlags(filename = process.argv[1]) {
// The copyright notice is relatively big and the flags could come afterwards.
const bytesToRead = 1500;
@@ -901,6 +903,7 @@ const common = {
mustNotMutateObjectDeep,
mustSucceed,
nodeProcessAborted,
+ openSSLIsBoringSSL,
PIPE,
parseTestFlags,
platformTimeout,
diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js
index d033cd204b3200cdd736b581abe027d6e46e4ff3..73fec107a36c3db4af6f492137d0ca174f2d0547 100644
--- a/test/parallel/test-buffer-tostring-range.js
+++ b/test/parallel/test-buffer-tostring-range.js
@@ -102,7 +102,8 @@ assert.throws(() => {
// Must not throw when start and end are within kMaxLength
// Cannot test on 32bit machine as we are testing the case
// when start and end are above the threshold
-common.skipIf32Bits();
+if (!common.openSSLIsBoringSSL) {
const threshold = 0xFFFFFFFF;
const largeBuffer = Buffer.alloc(threshold + 20);
largeBuffer.toString('utf8', threshold, threshold + 20);
+}
diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js
index b35dd08e6c49796418cd9d10eb5cc9d02b39961e..a49fdde82ea4cbadd60307cdc99439be892ef5a6 100644 index b35dd08e6c49796418cd9d10eb5cc9d02b39961e..97bcd79b331db140d157e6b1faf92625597edc98 100644
--- a/test/parallel/test-crypto-async-sign-verify.js --- a/test/parallel/test-crypto-async-sign-verify.js
+++ b/test/parallel/test-crypto-async-sign-verify.js +++ b/test/parallel/test-crypto-async-sign-verify.js
@@ -89,6 +89,7 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false, @@ -89,6 +89,7 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false,
// ED25519 // ED25519
test('ed25519_public.pem', 'ed25519_private.pem', undefined, true); test('ed25519_public.pem', 'ed25519_private.pem', undefined, true);
// ED448 // ED448
+if (!common.openSSLIsBoringSSL) { +if (!process.features.openssl_is_boringssl) {
test('ed448_public.pem', 'ed448_private.pem', undefined, true); test('ed448_public.pem', 'ed448_private.pem', undefined, true);
// ECDSA w/ der signature encoding // ECDSA w/ der signature encoding
@ -72,7 +37,7 @@ index b35dd08e6c49796418cd9d10eb5cc9d02b39961e..a49fdde82ea4cbadd60307cdc99439be
- const expected = hasOpenSSL3 ? - const expected = hasOpenSSL3 ?
- /operation not supported for this keytype/ : /no default digest/; - /operation not supported for this keytype/ : /no default digest/;
+ let expected = /no default digest/; + let expected = /no default digest/;
+ if (hasOpenSSL3 || common.openSSLIsBoringSSL) { + if (hasOpenSSL3 || process.features.openssl_is_boringssl) {
+ expected = /operation[\s_]not[\s_]supported[\s_]for[\s_]this[\s_]keytype/i; + expected = /operation[\s_]not[\s_]supported[\s_]for[\s_]this[\s_]keytype/i;
+ } + }
@ -144,23 +109,29 @@ index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420f
const availableCurves = new Set(crypto.getCurves()); const availableCurves = new Set(crypto.getCurves());
diff --git a/test/parallel/test-crypto-dh-errors.js b/test/parallel/test-crypto-dh-errors.js diff --git a/test/parallel/test-crypto-dh-errors.js b/test/parallel/test-crypto-dh-errors.js
index 0af4db0310750cea9350ecff7fc44404c6df6c83..85ab03f6019989ad4fe93b779c3b4772ce1f5130 100644 index 0af4db0310750cea9350ecff7fc44404c6df6c83..b14b4bbf88b902b6de916b92e3d48335c01df911 100644
--- a/test/parallel/test-crypto-dh-errors.js --- a/test/parallel/test-crypto-dh-errors.js
+++ b/test/parallel/test-crypto-dh-errors.js +++ b/test/parallel/test-crypto-dh-errors.js
@@ -33,9 +33,9 @@ for (const bits of [-1, 0, 1]) { @@ -27,7 +27,7 @@ assert.throws(() => crypto.createDiffieHellman('abcdef', 13.37), {
}); for (const bits of [-1, 0, 1]) {
} else { if (hasOpenSSL3) {
assert.throws(() => crypto.createDiffieHellman(bits), { assert.throws(() => crypto.createDiffieHellman(bits), {
- code: 'ERR_OSSL_BN_BITS_TOO_SMALL', - code: 'ERR_OSSL_DH_MODULUS_TOO_SMALL',
+ code: /ERR_OSSL_BN_BITS_TOO_SMALL|ERR_OSSL_DH_MODULUS_TOO_LARGE/, + code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
name: 'Error',
message: /modulus too small/,
});
@@ -35,7 +35,7 @@ for (const bits of [-1, 0, 1]) {
assert.throws(() => crypto.createDiffieHellman(bits), {
code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
name: 'Error', name: 'Error',
- message: /bits too small/, - message: /bits too small/,
+ message: /bits too small|BITS_TOO_SMALL|MODULUS_TOO_LARGE/, + message: /bits[\s_]too[\s_]small/i,
}); });
} }
} }
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b712566395 100644 index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..b4e7002d862907d2af3b4f8e985700bd03300809 100644
--- a/test/parallel/test-crypto-dh.js --- a/test/parallel/test-crypto-dh.js
+++ b/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js
@@ -60,18 +60,17 @@ const { @@ -60,18 +60,17 @@ const {
@ -171,10 +142,10 @@ index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b7
- code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH', - code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
- library: 'Provider routines', - library: 'Provider routines',
- reason: 'wrong final block length' - reason: 'wrong final block length'
+ message: /error:1C80006B:Provider routines::wrong final block length|error:1e00007b:Cipher functions:OPENSSL_internal:WRONG_FINAL_BLOCK_LENGTH/, + message: /wrong[\s_]final[\s_]block[\s_]length/i,
+ code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/, + code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/,
+ library: /digital envelope routines|Cipher functions/, + library: /Provider routines|Cipher functions/,
+ reason: /wrong final block length|WRONG_FINAL_BLOCK_LENGTH/ + reason: /wrong[\s_]final[\s_]block[\s_]length/i,
}; };
} else { } else {
wrongBlockLength = { wrongBlockLength = {
@ -183,10 +154,10 @@ index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b7
- code: 'ERR_OSSL_EVP_WRONG_FINAL_BLOCK_LENGTH', - code: 'ERR_OSSL_EVP_WRONG_FINAL_BLOCK_LENGTH',
- library: 'digital envelope routines', - library: 'digital envelope routines',
- reason: 'wrong final block length' - reason: 'wrong final block length'
+ message: /error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length|error:1e00007b:Cipher functions:OPENSSL_internal:WRONG_FINAL_BLOCK_LENGTH/, + message: /wrong[\s_]final[\s_]block[\s_]length/i,
+ code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/, + code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/,
+ library: /digital envelope routines|Cipher functions/, + library: /digital envelope routines|Cipher functions/,
+ reason: /wrong final block length|WRONG_FINAL_BLOCK_LENGTH/ + reason: /wrong[\s_]final[\s_]block[\s_]length/i,
}; };
} }
@ -217,25 +188,6 @@ index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b7
+ name: 'Error' + name: 'Error'
+ }); + });
} }
diff --git a/test/parallel/test-crypto-getcipherinfo.js b/test/parallel/test-crypto-getcipherinfo.js
index 64b79fc36ccf4d38f763fcd8c1930473c82cefd7..1c6717ebd46497384b9b13174b65894ca89e7f2d 100644
--- a/test/parallel/test-crypto-getcipherinfo.js
+++ b/test/parallel/test-crypto-getcipherinfo.js
@@ -62,9 +62,13 @@ assert(getCipherInfo('aes-128-cbc', { ivLength: 16 }));
assert(!getCipherInfo('aes-128-ccm', { ivLength: 1 }));
assert(!getCipherInfo('aes-128-ccm', { ivLength: 14 }));
+if (!common.openSSLIsBoringSSL) {
for (let n = 7; n <= 13; n++)
assert(getCipherInfo('aes-128-ccm', { ivLength: n }));
+}
assert(!getCipherInfo('aes-128-ocb', { ivLength: 16 }));
+if (!common.openSSLIsBoringSSL) {
for (let n = 1; n < 16; n++)
assert(getCipherInfo('aes-128-ocb', { ivLength: n }));
+}
\ No newline at end of file
diff --git a/test/parallel/test-crypto-hash-stream-pipe.js b/test/parallel/test-crypto-hash-stream-pipe.js diff --git a/test/parallel/test-crypto-hash-stream-pipe.js b/test/parallel/test-crypto-hash-stream-pipe.js
index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf218791cd6868 100644 index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf218791cd6868 100644
--- a/test/parallel/test-crypto-hash-stream-pipe.js --- a/test/parallel/test-crypto-hash-stream-pipe.js
@ -258,7 +210,7 @@ index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf2187
s.pipe(h).on('data', common.mustCall(function(c) { s.pipe(h).on('data', common.mustCall(function(c) {
assert.strictEqual(c, expect); assert.strictEqual(c, expect);
diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js
index 61145aee0727fbe0b9781acdb3eeb641e7010729..fd7d4bd7d3f86caa30ffd03ea880eeac023bbcbb 100644 index 61145aee0727fbe0b9781acdb3eeb641e7010729..51693e637b310981f76f23c2f35d43e4d2d9c4ef 100644
--- a/test/parallel/test-crypto-hash.js --- a/test/parallel/test-crypto-hash.js
+++ b/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js
@@ -183,7 +183,7 @@ assert.throws( @@ -183,7 +183,7 @@ assert.throws(
@ -266,57 +218,57 @@ index 61145aee0727fbe0b9781acdb3eeb641e7010729..fd7d4bd7d3f86caa30ffd03ea880eeac
// Test XOF hash functions and the outputLength option. // Test XOF hash functions and the outputLength option.
-{ -{
+if (!common.openSSLIsBoringSSL) { +if (!process.features.openssl_is_boringssl) {
// Default outputLengths. Since OpenSSL 3.4 an outputLength is mandatory // Default outputLengths. Since OpenSSL 3.4 an outputLength is mandatory
if (!hasOpenSSL(3, 4)) { if (!hasOpenSSL(3, 4)) {
assert.strictEqual(crypto.createHash('shake128').digest('hex'), assert.strictEqual(crypto.createHash('shake128').digest('hex'),
diff --git a/test/parallel/test-crypto-hkdf.js b/test/parallel/test-crypto-hkdf.js
index 3f7e61e9b2ebc0ca7c367d7c229afe9ab87762b8..36bd78105d153b75b42e4736f11d80a257916607 100644
--- a/test/parallel/test-crypto-hkdf.js
+++ b/test/parallel/test-crypto-hkdf.js
@@ -125,7 +125,7 @@ const algorithms = [
['sha256', '', 'salt', '', 10],
['sha512', 'secret', 'salt', '', 15],
];
-if (!hasOpenSSL3)
+if (!hasOpenSSL3 && !common.openSSLIsBoringSSL)
algorithms.push(['whirlpool', 'secret', '', 'info', 20]);
algorithms.forEach(([ hash, secret, salt, info, length ]) => {
diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js
index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..a18aeb2bdffcc7a7e9ef12328b849994e39d6c27 100644 index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..d09e01712c617597833bb1320a32a967bcf1d318 100644
--- a/test/parallel/test-crypto-padding.js --- a/test/parallel/test-crypto-padding.js
+++ b/test/parallel/test-crypto-padding.js +++ b/test/parallel/test-crypto-padding.js
@@ -88,10 +88,9 @@ assert.throws(function() { @@ -84,14 +84,13 @@ assert.throws(function() {
code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH', // Input must have block length %.
reason: 'wrong final block length', enc(ODD_LENGTH_PLAIN, false);
}, hasOpenSSL3 ? {
- message: 'error:1C80006B:Provider routines::wrong final block length',
- code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
- reason: 'wrong final block length',
+ message: /wrong[\s_]final[\s_]block[\s_]length/i,
+ code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/,
+ message: /wrong[\s_]final[\s_]block[\s_]length/i,
} : { } : {
- message: 'error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:' + - message: 'error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:' +
- 'data not multiple of block length', - 'data not multiple of block length',
- code: 'ERR_OSSL_EVP_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH', - code: 'ERR_OSSL_EVP_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH',
- reason: 'data not multiple of block length', - reason: 'data not multiple of block length',
+ message: /error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:data not multiple of block length|error:1e00006a:Cipher functions:OPENSSL_internal:DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/, + message: /data[\s_]not[\s_]multiple[\s_]of[\s_]block[\s_]length/i,
+ code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/, + code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/,
+ reason: /data not multiple of block length|DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/, + reason: /data[\s_]not[\s_]multiple[\s_]of[\s_]block[\s_]length/i,
} }
); );
@@ -115,10 +114,9 @@ assert.throws(function() { @@ -110,15 +109,10 @@ assert.strictEqual(dec(EVEN_LENGTH_ENCRYPTED, false).length, 48);
reason: 'bad decrypt', assert.throws(function() {
code: 'ERR_OSSL_BAD_DECRYPT', // Must have at least 1 byte of padding (PKCS):
} : { assert.strictEqual(dec(EVEN_LENGTH_ENCRYPTED_NOPAD, true), EVEN_LENGTH_PLAIN);
-}, hasOpenSSL3 ? {
- message: 'error:1C800064:Provider routines::bad decrypt',
- reason: 'bad decrypt',
- code: 'ERR_OSSL_BAD_DECRYPT',
-} : {
- message: 'error:06065064:digital envelope routines:EVP_DecryptFinal_ex:' + - message: 'error:06065064:digital envelope routines:EVP_DecryptFinal_ex:' +
- 'bad decrypt', - 'bad decrypt',
- reason: 'bad decrypt', - reason: 'bad decrypt',
- code: 'ERR_OSSL_EVP_BAD_DECRYPT', - code: 'ERR_OSSL_EVP_BAD_DECRYPT',
+ message: /error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt|error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT/, +}, {
+ reason: /bad decrypt|BAD_DECRYPT/, + message: /bad[\s_]decrypt/i,
+ reason: /bad[\s_]decrypt/i,
+ code: /ERR_OSSL(_EVP)?_BAD_DECRYPT/, + code: /ERR_OSSL(_EVP)?_BAD_DECRYPT/,
}); });
// No-pad encrypted string should return the same: // No-pad encrypted string should return the same:
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js
index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d754b8d01 100644 index dcd5045daaf58c60e27c1e2f7941033302241339..b52ec0e2cd5d6b1c9a0fee3064f2f8ff3b6e4308 100644
--- a/test/parallel/test-crypto-rsa-dsa.js --- a/test/parallel/test-crypto-rsa-dsa.js
+++ b/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js
@@ -29,12 +29,11 @@ const dsaPkcs8KeyPem = fixtures.readKey('dsa_private_pkcs8.pem'); @@ -29,12 +29,11 @@ const dsaPkcs8KeyPem = fixtures.readKey('dsa_private_pkcs8.pem');
@ -342,7 +294,7 @@ index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d
- if (padding === constants.RSA_PKCS1_PADDING) { - if (padding === constants.RSA_PKCS1_PADDING) {
+ if (!common.openSSLIsBoringSSL) { + if (!process.features.openssl_is_boringssl) {
if (!process.config.variables.node_shared_openssl) { if (!process.config.variables.node_shared_openssl) {
assert.throws(() => { assert.throws(() => {
crypto.privateDecrypt({ crypto.privateDecrypt({
@ -351,7 +303,7 @@ index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d
// Test DSA signing and verification // Test DSA signing and verification
// //
-{ -{
+if (!common.openSSLIsBoringSSL) { +if (!process.features.openssl_is_boringssl) {
const input = 'I AM THE WALRUS'; const input = 'I AM THE WALRUS';
// DSA signatures vary across runs so there is no static string to verify // DSA signatures vary across runs so there is no static string to verify
@ -369,7 +321,7 @@ index 03a18c7522531c7317f12705550117dc389a0245..2f0f46f2c6ddc62de89877cfa0ca8094
}; };
assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}), 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 diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js
index 0589d60736e377f24dc8550f87a6b7624173fc44..547f22cdc130cf0c68d117f92068e3ac53a0efc2 100644 index 0589d60736e377f24dc8550f87a6b7624173fc44..113003826fc47a589cf2334f7345e33d3e189d0a 100644
--- a/test/parallel/test-crypto-sign-verify.js --- a/test/parallel/test-crypto-sign-verify.js
+++ b/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js
@@ -33,7 +33,7 @@ const keySize = 2048; @@ -33,7 +33,7 @@ const keySize = 2048;
@ -377,7 +329,7 @@ index 0589d60736e377f24dc8550f87a6b7624173fc44..547f22cdc130cf0c68d117f92068e3ac
// Test handling of exceptional conditions // Test handling of exceptional conditions
-{ -{
+if (!common.openSSLIsBoringSSL) { +if (!process.features.openssl_is_boringssl) {
const library = { const library = {
configurable: true, configurable: true,
set() { set() {
@ -426,77 +378,24 @@ index 0589d60736e377f24dc8550f87a6b7624173fc44..547f22cdc130cf0c68d117f92068e3ac
for (const [file, length] of keys) { for (const [file, length] of keys) {
const privKey = fixtures.readKey(file); const privKey = fixtures.readKey(file);
diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js
index 62be4eaf6edfb01ce275e7db3e56b51d09ac66ce..3fb6cd833d959d1c3c8522ebacc8f18352672628 100644 index 747af780469c22eb8e4c6c35424043e868f75c3d..ed0916b036a9af23d805007ebd609973ee954473 100644
--- a/test/parallel/test-crypto-stream.js --- a/test/parallel/test-crypto-stream.js
+++ b/test/parallel/test-crypto-stream.js +++ b/test/parallel/test-crypto-stream.js
@@ -78,10 +78,10 @@ cipher.pipe(decipher) @@ -73,9 +73,9 @@ const cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
library: 'Provider routines', const decipher = crypto.createDecipheriv('aes-128-cbc', badkey, iv);
reason: 'bad decrypt',
cipher.pipe(decipher)
- .on('error', common.expectsError(hasOpenSSL3 ? {
- message: /bad[\s_]decrypt/,
- library: 'Provider routines',
+ .on('error', common.expectsError((hasOpenSSL3 || process.features.openssl_is_boringssl) ? {
+ message: /bad[\s_]decrypt/i,
+ library: /Provider routines|Cipher functions/,
reason: /bad[\s_]decrypt/i,
} : { } : {
- message: /bad decrypt/, message: /bad[\s_]decrypt/i,
- function: 'EVP_DecryptFinal_ex',
- library: 'digital envelope routines',
- reason: 'bad decrypt',
+ message: /bad decrypt|BAD_DECRYPT/,
+ function: /EVP_DecryptFinal_ex|OPENSSL_internal/,
+ library: /digital envelope routines|Cipher functions/,
+ reason: /bad decrypt|BAD_DECRYPT/,
}));
cipher.end('Papaya!'); // Should not cause an unhandled exception.
diff --git a/test/parallel/test-crypto-x509.js b/test/parallel/test-crypto-x509.js
index f75e1d63470bfb7ce7fb354118b87a1a6fe5e4cc..5c0852e83a466ab4b255e8c9c9a33aca1beb9b94 100644
--- a/test/parallel/test-crypto-x509.js
+++ b/test/parallel/test-crypto-x509.js
@@ -97,8 +97,10 @@ const der = Buffer.from(
assert.strictEqual(x509.infoAccess, infoAccessCheck);
assert.strictEqual(x509.validFrom, 'Sep 3 21:40:37 2022 GMT');
assert.strictEqual(x509.validTo, 'Jun 17 21:40:37 2296 GMT');
+ if (!common.openSSLIsBoringSSL) {
assert.deepStrictEqual(x509.validFromDate, new Date('2022-09-03T21:40:37Z'));
assert.deepStrictEqual(x509.validToDate, new Date('2296-06-17T21:40:37Z'));
+ }
assert.strictEqual(
x509.fingerprint,
'8B:89:16:C4:99:87:D2:13:1A:64:94:36:38:A5:32:01:F0:95:3B:53');
@@ -326,6 +328,7 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
legacyObjectCheck.serialNumberPattern);
}
+if (!common.openSSLIsBoringSSL) {
{
// This X.509 Certificate can be parsed by OpenSSL because it contains a
// structurally sound TBSCertificate structure. However, the SPKI field of the
@@ -364,6 +367,7 @@ UcXd/5qu2GhokrKU2cPttU+XAN2Om6a0
assert.strictEqual(cert.checkIssued(cert), false);
}
+}
{
// Test date parsing of `validFromDate` and `validToDate` fields, according to RFC 5280.
@@ -401,8 +405,10 @@ UidvpWWipVLZgK+oDks+bKTobcoXGW9oXobiIYqslXPy
-----END CERTIFICATE-----`.trim();
const c1 = new X509Certificate(certPemUTCTime);
+ if (!common.openSSLIsBoringSSL) {
assert.deepStrictEqual(c1.validFromDate, new Date('1949-12-25T23:59:58Z'));
assert.deepStrictEqual(c1.validToDate, new Date('1950-01-01T23:59:58Z'));
+ }
// The GeneralizedTime format is used for dates in 2050 or later.
const certPemGeneralizedTime = `-----BEGIN CERTIFICATE-----
@@ -436,6 +442,8 @@ CWwQO8JZjJqFtqtuzy2n+gLCvqePgG/gmSqHOPm2ZbLW
-----END CERTIFICATE-----`.trim();
const c2 = new X509Certificate(certPemGeneralizedTime);
+ if (!common.openSSLIsBoringSSL) {
assert.deepStrictEqual(c2.validFromDate, new Date('2049-12-26T00:00:01Z'));
assert.deepStrictEqual(c2.validToDate, new Date('2050-01-02T00:00:01Z'));
+ }
}
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
index 93644e016de447d2aadc519123f18cd72b7a5750..8b16c83cd47bd8969654242296c987ecc97ccaeb 100644 index 84111740cd9ef6425b747e24e984e66e46b0b2ef..b1621d310536fae3fdec91a6a9d275ec8fc99a98 100644
--- a/test/parallel/test-crypto.js --- a/test/parallel/test-crypto.js
+++ b/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js
@@ -62,7 +62,7 @@ assert.throws(() => { @@ -62,7 +62,7 @@ assert.throws(() => {
@ -539,25 +438,10 @@ index 93644e016de447d2aadc519123f18cd72b7a5750..8b16c83cd47bd8969654242296c987ec
} }
); );
+if (!common.openSSLIsBoringSSL) { +if (!process.features.openssl_is_boringssl) {
assert.throws(() => { assert.throws(() => {
const priv = [ const priv = [
'-----BEGIN RSA PRIVATE KEY-----', '-----BEGIN RSA PRIVATE KEY-----',
@@ -217,10 +216,10 @@ assert.throws(() => {
library: 'rsa routines',
} : {
name: 'Error',
- message: /routines:RSA_sign:digest too big for rsa key$/,
- library: 'rsa routines',
- function: 'RSA_sign',
- reason: 'digest too big for rsa key',
+ message: /routines:RSA_sign:digest too big for rsa key$|routines:OPENSSL_internal:DIGEST_TOO_BIG_FOR_RSA_KEY$/,
+ library: /rsa routines|RSA routines/,
+ function: /RSA_sign|OPENSSL_internal/,
+ reason: /digest too big for rsa key|DIGEST_TOO_BIG_FOR_RSA_KEY/,
code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY'
});
return true;
@@ -253,7 +252,7 @@ if (!hasOpenSSL3) { @@ -253,7 +252,7 @@ if (!hasOpenSSL3) {
return true; return true;
}); });
@ -567,162 +451,29 @@ index 93644e016de447d2aadc519123f18cd72b7a5750..8b16c83cd47bd8969654242296c987ec
// Make sure memory isn't released before being returned // Make sure memory isn't released before being returned
console.log(crypto.randomBytes(16)); console.log(crypto.randomBytes(16));
diff --git a/test/parallel/test-https-agent-additional-options.js b/test/parallel/test-https-agent-additional-options.js
index 543ee176fb6af38874fee9f14be76f3fdda11060..fef9f1bc2f9fc6c220cf47847e86e03882b51b1d 100644
--- a/test/parallel/test-https-agent-additional-options.js
+++ b/test/parallel/test-https-agent-additional-options.js
@@ -13,7 +13,7 @@ const options = {
cert: fixtures.readKey('agent1-cert.pem'),
ca: fixtures.readKey('ca1-cert.pem'),
minVersion: 'TLSv1.1',
- ciphers: 'ALL@SECLEVEL=0'
+ // ciphers: 'ALL@SECLEVEL=0'
};
const server = https.Server(options, (req, res) => {
@@ -28,7 +28,7 @@ function getBaseOptions(port) {
ca: options.ca,
rejectUnauthorized: true,
servername: 'agent1',
- ciphers: 'ALL@SECLEVEL=0'
+ // ciphers: 'ALL@SECLEVEL=0'
};
}
diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js
index 6f88e81e9ff29defe73800fc038b0d96d1ebd846..c0b92e2bdf86d3d2638c973f8be3110d5ae31f78 100644
--- a/test/parallel/test-https-agent-session-eviction.js
+++ b/test/parallel/test-https-agent-session-eviction.js
@@ -17,7 +17,7 @@ const options = {
key: readKey('agent1-key.pem'),
cert: readKey('agent1-cert.pem'),
secureOptions: SSL_OP_NO_TICKET,
- ciphers: 'RSA@SECLEVEL=0'
+ // ciphers: 'RSA@SECLEVEL=0'
};
// Create TLS1.2 server
diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js
index cba5bebaa29b6f8ac4fd0fcedaadb2f7bb3eb321..019d95df499892b14ab088f99013ee32c432779c 100644 index 7bd42bbe721c4c9442410d524c5ca740078fc72c..de49dbdc2b75517f497af353a6b24b1beb11ed69 100644
--- a/test/parallel/test-tls-alert-handling.js --- a/test/parallel/test-tls-alert-handling.js
+++ b/test/parallel/test-tls-alert-handling.js +++ b/test/parallel/test-tls-alert-handling.js
@@ -35,7 +35,7 @@ let iter = 0; @@ -43,7 +43,8 @@ const errorHandler = common.mustCall((err) => {
const errorHandler = common.mustCall((err) => {
let expectedErrorCode = 'ERR_SSL_WRONG_VERSION_NUMBER';
- let expectedErrorReason = 'wrong version number';
+ let expectedErrorReason = /wrong[\s_]version[\s_]number/i;
if (hasOpenSSL(3, 2)) {
expectedErrorCode = 'ERR_SSL_PACKET_LENGTH_TOO_LONG';
expectedErrorReason = 'packet length too long';
@@ -43,8 +43,8 @@ const errorHandler = common.mustCall((err) => {
assert.strictEqual(err.code, expectedErrorCode); assert.strictEqual(err.code, expectedErrorCode);
assert.strictEqual(err.library, 'SSL routines'); assert.strictEqual(err.library, 'SSL routines');
- if (!hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record'); - if (!hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record');
- assert.strictEqual(err.reason, expectedErrorReason); + if (!hasOpenSSL3 && !process.features.openssl_is_boringssl)
+ if (!hasOpenSSL3 && !common.openSSLIsBoringSSL) assert.strictEqual(err.function, 'ssl3_get_record'); + assert.strictEqual(err.function, 'ssl3_get_record');
+ assert.match(err.reason, expectedErrorReason); assert.match(err.reason, expectedErrorReason);
errorReceived = true; errorReceived = true;
if (canCloseServer()) if (canCloseServer())
server.close(); @@ -105,7 +106,7 @@ function sendBADTLSRecord() {
@@ -98,15 +98,15 @@ function sendBADTLSRecord() {
}));
client.on('error', common.mustCall((err) => {
let expectedErrorCode = 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION';
- let expectedErrorReason = 'tlsv1 alert protocol version';
+ let expectedErrorReason = /tlsv1[\s_]alert[\s_]protocol[\s_]version/i;
if (hasOpenSSL(3, 2)) {
expectedErrorCode = 'ERR_SSL_TLSV1_ALERT_RECORD_OVERFLOW';
expectedErrorReason = 'tlsv1 alert record overflow';
} }
assert.strictEqual(err.code, expectedErrorCode); assert.strictEqual(err.code, expectedErrorCode);
assert.strictEqual(err.library, 'SSL routines'); assert.strictEqual(err.library, 'SSL routines');
- if (!hasOpenSSL3) - if (!hasOpenSSL3)
+ if (!hasOpenSSL3 && !common.openSSLIsBoringSSL) + if (!hasOpenSSL3 && !process.features.openssl_is_boringssl)
assert.strictEqual(err.function, 'ssl3_read_bytes'); assert.strictEqual(err.function, 'ssl3_read_bytes');
- assert.strictEqual(err.reason, expectedErrorReason); assert.match(err.reason, expectedErrorReason);
+ assert.match(err.reason, expectedErrorReason);
})); }));
}
diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js
index b1eab88fd6517e3698934dea17752ef2bb8d8d54..3ad6db20316baa8490e3787dd55903b58a54ad06 100644
--- a/test/parallel/test-tls-getprotocol.js
+++ b/test/parallel/test-tls-getprotocol.js
@@ -29,7 +29,7 @@ const clientConfigs = [
const serverConfig = {
secureProtocol: 'TLS_method',
- ciphers: 'RSA@SECLEVEL=0',
+ // ciphers: 'RSA@SECLEVEL=0',
key: fixtures.readKey('agent2-key.pem'),
cert: fixtures.readKey('agent2-cert.pem')
};
diff --git a/test/parallel/test-tls-write-error.js b/test/parallel/test-tls-write-error.js
index b06f2fa2c53ea72f9a66f0d002dd9281d0259a0f..864fffeebfad75d95416fd47efdea7f222c507a2 100644
--- a/test/parallel/test-tls-write-error.js
+++ b/test/parallel/test-tls-write-error.js
@@ -17,7 +17,7 @@ const server_cert = fixtures.readKey('agent1-cert.pem');
const opts = {
key: server_key,
cert: server_cert,
- ciphers: 'ALL@SECLEVEL=0'
+ // ciphers: 'ALL@SECLEVEL=0'
};
const server = https.createServer(opts, (req, res) => {
diff --git a/test/parallel/test-webcrypto-derivebits.js b/test/parallel/test-webcrypto-derivebits.js
index eb09bc24f0cb8244b05987e3a7c1d203360d3a38..8c251ff2371fb59bf679160574e1c5dc1b4b2665 100644
--- a/test/parallel/test-webcrypto-derivebits.js
+++ b/test/parallel/test-webcrypto-derivebits.js
@@ -101,8 +101,9 @@ const { subtle } = globalThis.crypto;
tests.then(common.mustCall());
}
+
// Test X25519 and X448 bit derivation
-{
+if (!common.openSSLIsBoringSSL) {
async function test(name) {
const [alice, bob] = await Promise.all([
subtle.generateKey({ name }, true, ['deriveBits']),
diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js
index 558d37d90d5796b30101d1b512c9df3e7661d0db..f42bf8f4be0b439dd7e7c8d0f6f8a41e01588870 100644
--- a/test/parallel/test-webcrypto-derivekey.js
+++ b/test/parallel/test-webcrypto-derivekey.js
@@ -176,7 +176,7 @@ const { KeyObject } = require('crypto');
}
// Test X25519 and X448 key derivation
-{
+if (!common.openSSLIsBoringSSL) {
async function test(name) {
const [alice, bob] = await Promise.all([
subtle.generateKey({ name }, true, ['deriveKey']),
diff --git a/test/parallel/test-webcrypto-sign-verify.js b/test/parallel/test-webcrypto-sign-verify.js
index de736102bdcb71a5560c95f7041537f25026aed4..12d7fa39446c196bdf1479dbe74c9ee8ab02f949 100644
--- a/test/parallel/test-webcrypto-sign-verify.js
+++ b/test/parallel/test-webcrypto-sign-verify.js
@@ -105,8 +105,9 @@ const { subtle } = globalThis.crypto;
test('hello world').then(common.mustCall());
}
+
// Test Sign/Verify Ed25519
-{
+if (!common.openSSLIsBoringSSL) {
async function test(data) {
const ec = new TextEncoder();
const { publicKey, privateKey } = await subtle.generateKey({
@@ -126,7 +127,7 @@ const { subtle } = globalThis.crypto;
}
// Test Sign/Verify Ed448
-{
+if (!common.openSSLIsBoringSSL) {
async function test(data) {
const ec = new TextEncoder();
const { publicKey, privateKey } = await subtle.generateKey({
diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js
index d1ca571af4be713082d32093bfb8a65f2aef9800..57b8df2ce18df58ff54b2d828af67e3c2e082fe0 100644 index d1ca571af4be713082d32093bfb8a65f2aef9800..57b8df2ce18df58ff54b2d828af67e3c2e082fe0 100644
--- a/test/parallel/test-webcrypto-wrap-unwrap.js --- a/test/parallel/test-webcrypto-wrap-unwrap.js

View file

@ -6,7 +6,7 @@ Subject: fix: do not resolve electron entrypoints
This wastes fs cycles and can result in strange behavior if this path actually exists on disk This wastes fs cycles and can result in strange behavior if this path actually exists on disk
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 49aacb6262502ced54e817f99dd596db85b9659c..f9f065bb743275e9b2ce71375e6a9f06e00c0f36 100644 index bbd3085cfbf14aefd611954fa836f6c96d7e402c..9e71d2d0b79656e212fb21efdb3efcf988529f5e 100644
--- a/lib/internal/modules/esm/translators.js --- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js
@@ -291,6 +291,9 @@ function cjsPreparseModuleExports(filename, source, isMain, format) { @@ -291,6 +291,9 @@ function cjsPreparseModuleExports(filename, source, isMain, format) {

View file

@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules`
binding. binding.
diff --git a/src/env_properties.h b/src/env_properties.h diff --git a/src/env_properties.h b/src/env_properties.h
index cbb7eab2df0416087cd3e6fb80eef2079143d9c8..7e9f5e977506149d69c6015e85d031770325e1da 100644 index 3df4e303e05105b43a542456546cbc050d0445fa..4f7aee6cb64b4c1d25e98b43d13e747c4546adaa 100644
--- a/src/env_properties.h --- a/src/env_properties.h
+++ b/src/env_properties.h +++ b/src/env_properties.h
@@ -501,6 +501,7 @@ @@ -502,6 +502,7 @@
V(maybe_cache_generated_source_map, v8::Function) \ V(maybe_cache_generated_source_map, v8::Function) \
V(messaging_deserialize_create_object, v8::Function) \ V(messaging_deserialize_create_object, v8::Function) \
V(message_port, v8::Object) \ V(message_port, v8::Object) \

View file

@ -64,7 +64,7 @@ index 5ba13096b98047ff33e4d44167c2a069ccc5e69d..09a332c0999086b30fd952d9456f7889
} }
} }
diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js
index aff686577df3c366f06f90666e23a03fc376cf53..e8857a151428acd6f8ece74d92774a18accc1e13 100644 index 5a817ed0434b8bc08f9b9bd260c978bbe5ddc664..f9dba42cddb08f69e02834f76d6d80c5e47a637d 100644
--- a/lib/internal/modules/esm/loader.js --- a/lib/internal/modules/esm/loader.js
+++ b/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js
@@ -492,7 +492,7 @@ class ModuleLoader { @@ -492,7 +492,7 @@ class ModuleLoader {
@ -101,7 +101,7 @@ index bfd9bd3d127404de1cbb6f30c43ab0342590759d..9e7d8ef0adef3b68a3ec186e4b218f59
const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true }); const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true });
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 7dcd7afe8ce3c25ceb314cdf15c330f3d66eb84f..4445bcc4c4c6c6f87ac45e693012a18a93739f9b 100644 index 0695b47a8a8f78451c20c025a3d9dac7cadab686..1db58d31dad24cd2da6bdc5e45e9dd4f0b899a23 100644
--- a/lib/internal/modules/esm/translators.js --- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js
@@ -186,7 +186,7 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul @@ -186,7 +186,7 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul

View file

@ -172,7 +172,7 @@ index e5bf2b529bf23914677e25d7468aad58a4684557..9a3c6029ff3319cce58c79782a7bd5d1
}; };
// Check to see if the given public key is suitable for this DH instance. // Check to see if the given public key is suitable for this DH instance.
diff --git a/node.gni b/node.gni diff --git a/node.gni b/node.gni
index 245a43920c7baf000ba63192a84a4c3fd219be7d..56a554175b805c1703f13d62041f8c80d6e94dd9 100644 index b4450e3dd17994d1eaf59eb5cff5912545e89793..203b4abbc44df9e58083c819f61f9025104abdc6 100644
--- a/node.gni --- a/node.gni
+++ b/node.gni +++ b/node.gni
@@ -11,7 +11,7 @@ declare_args() { @@ -11,7 +11,7 @@ declare_args() {
@ -183,7 +183,7 @@ index 245a43920c7baf000ba63192a84a4c3fd219be7d..56a554175b805c1703f13d62041f8c80
+ node_openssl_path = "//third_party/boringssl" + node_openssl_path = "//third_party/boringssl"
# The location of simdutf - use the one from node's deps by default. # The location of simdutf - use the one from node's deps by default.
node_simdutf_path = "$node_path/deps/simdutf" node_simdutf_path = "//third_party/simdutf"
diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc
index 2176fb6982484e2c42538478eeb4dd81c9d50ee1..c00d3616e08b00b1e0a3a29b2dbb5278e1e14fcc 100644 index 2176fb6982484e2c42538478eeb4dd81c9d50ee1..c00d3616e08b00b1e0a3a29b2dbb5278e1e14fcc 100644
--- a/src/crypto/crypto_cipher.cc --- a/src/crypto/crypto_cipher.cc
@ -520,7 +520,7 @@ index 7c548d32b40365343f0e208c3aa856a1c847f4c3..6346f8f7199cf7b7d3736c59571606ff
} // namespace } // namespace
diff --git a/src/env.h b/src/env.h diff --git a/src/env.h b/src/env.h
index b6bdff9b8580d2588a39f00b594c4c480157d78a..cfe917c797a6e4bb0f0284ec56be82637f840129 100644 index c42493ad958508f650917bf5ca92088714a5056c..07accfbcca491966c6c8ad9c20e146dbd22347f0 100644
--- a/src/env.h --- a/src/env.h
+++ b/src/env.h +++ b/src/env.h
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
@ -532,7 +532,7 @@ index b6bdff9b8580d2588a39f00b594c4c480157d78a..cfe917c797a6e4bb0f0284ec56be8263
#include <openssl/evp.h> #include <openssl/evp.h>
#endif #endif
@@ -1073,7 +1073,7 @@ class Environment final : public MemoryRetainer { @@ -1076,7 +1076,7 @@ class Environment final : public MemoryRetainer {
kExitInfoFieldCount kExitInfoFieldCount
}; };
@ -541,8 +541,23 @@ index b6bdff9b8580d2588a39f00b594c4c480157d78a..cfe917c797a6e4bb0f0284ec56be8263
#if OPENSSL_VERSION_MAJOR >= 3 #if OPENSSL_VERSION_MAJOR >= 3
// We declare another alias here to avoid having to include crypto_util.h // We declare another alias here to avoid having to include crypto_util.h
using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>; using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>;
diff --git a/src/node_config.cc b/src/node_config.cc
index 6032bbd10f41da7bae44828a8e908c1bec0ea0b6..2013de54f0f6a036e8378deefbff8d7cb5f7cfb2 100644
--- a/src/node_config.cc
+++ b/src/node_config.cc
@@ -7,6 +7,10 @@
#include "node_options.h"
#include "util-inl.h"
+#if HAVE_OPENSSL
+#include <openssl/base.h>
+#endif
+
namespace node {
using v8::Context;
diff --git a/src/node_metadata.h b/src/node_metadata.h diff --git a/src/node_metadata.h b/src/node_metadata.h
index 6f8cb433ff8059c63d5cf16c8783139ae92fbf61..603ac3dde7d1a1109afbc451b69c8d0935b81641 100644 index 7b2072ad39c3f1a7c73101b25b69beb781141e26..d23536d88d21255d348175425a59e2424332cd19 100644
--- a/src/node_metadata.h --- a/src/node_metadata.h
+++ b/src/node_metadata.h +++ b/src/node_metadata.h
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
@ -555,7 +570,7 @@ index 6f8cb433ff8059c63d5cf16c8783139ae92fbf61..603ac3dde7d1a1109afbc451b69c8d09
#if NODE_OPENSSL_HAS_QUIC #if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h> #include <openssl/quic.h>
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index 3fc8194475ec0e8a9047c1f3da5d120f25d66190..8be78889e8234eb3100f309829bf7470db544dcd 100644 index da39abf79c53fcc3d83d3431deda9dbdf3b0621e..14f7764c995e8de6582faf58c9b98a9cbe4fab73 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
@ -568,7 +583,7 @@ index 3fc8194475ec0e8a9047c1f3da5d120f25d66190..8be78889e8234eb3100f309829bf7470
#endif #endif
diff --git a/src/node_options.h b/src/node_options.h diff --git a/src/node_options.h b/src/node_options.h
index 7d14f06370d936a3866f0d988123de9fe614ce09..60068b008b2e2a034c3f0c58b947a8d04d55e3b2 100644 index 165950c207ca752ec942ef27a671af66cbd2b938..eb18fdd617fd19e5b97cd67f351e70c28fee3e75 100644
--- a/src/node_options.h --- a/src/node_options.h
+++ b/src/node_options.h +++ b/src/node_options.h
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@

View file

@ -60,7 +60,7 @@ index 9e7d8ef0adef3b68a3ec186e4b218f591aa69266..2879e5cf541fb4d226cfd7cc0fe367ca
}); });
const { search, hash } = resolved; const { search, hash } = resolved;
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 4445bcc4c4c6c6f87ac45e693012a18a93739f9b..49aacb6262502ced54e817f99dd596db85b9659c 100644 index 1db58d31dad24cd2da6bdc5e45e9dd4f0b899a23..bbd3085cfbf14aefd611954fa836f6c96d7e402c 100644
--- a/lib/internal/modules/esm/translators.js --- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js
@@ -24,7 +24,7 @@ const { @@ -24,7 +24,7 @@ const {

View file

@ -10,19 +10,19 @@ This change removes the usage of these constants to fix a compilation failure du
See: https://github.com/llvm/llvm-project/pull/80542 See: https://github.com/llvm/llvm-project/pull/80542
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
index f75a496071ac3396cbc6dec819eaab7294609deb..30f9a05f2f508b55a7d7ae036612660068c8400e 100644 index 0295eeddbb4eb1cffd9dbcd02e037907fadc1b7e..7c2f9d2a8b13584ff6b33cd3ff4745e9fb3c4170 100644
--- a/deps/uv/include/uv.h --- a/deps/uv/include/uv.h
+++ b/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h
@@ -155,7 +155,6 @@ struct uv__queue { @@ -156,7 +156,6 @@ struct uv__queue {
XX(EFTYPE, "inappropriate file type or format") \ XX(EFTYPE, "inappropriate file type or format") \
XX(EILSEQ, "illegal byte sequence") \ XX(EILSEQ, "illegal byte sequence") \
XX(ESOCKTNOSUPPORT, "socket type not supported") \ XX(ESOCKTNOSUPPORT, "socket type not supported") \
- XX(ENODATA, "no data available") \ - XX(ENODATA, "no data available") \
XX(EUNATCH, "protocol driver not attached") \ XX(EUNATCH, "protocol driver not attached") \
XX(ENOEXEC, "exec format error") \
#define UV_HANDLE_TYPE_MAP(XX) \
diff --git a/deps/uv/include/uv/errno.h b/deps/uv/include/uv/errno.h diff --git a/deps/uv/include/uv/errno.h b/deps/uv/include/uv/errno.h
index 127278ef916161a96e23e645927d16bedfdaca5b..b36da3daa5744e6f994e32d9d82aaef689008a5f 100644 index ac00778cfc59fb55e361b24fc81a965a5e8f97e7..f0c4d6dfc9f03bee59e656b2da9ac325bced7b69 100644
--- a/deps/uv/include/uv/errno.h --- a/deps/uv/include/uv/errno.h
+++ b/deps/uv/include/uv/errno.h +++ b/deps/uv/include/uv/errno.h
@@ -456,18 +456,6 @@ @@ -456,18 +456,6 @@
@ -45,7 +45,7 @@ index 127278ef916161a96e23e645927d16bedfdaca5b..b36da3daa5744e6f994e32d9d82aaef6
# define UV__EUNATCH UV__ERR(EUNATCH) # define UV__EUNATCH UV__ERR(EUNATCH)
#else #else
diff --git a/src/node_constants.cc b/src/node_constants.cc diff --git a/src/node_constants.cc b/src/node_constants.cc
index 13263149c111beede83b7063fa54f56655aea54c..99068098e1867af4846e18a5d039a25689722a4a 100644 index 8c44e32381a44675792ca0922e47df1adda48e41..d193725ea9a3270ed9affea12d11467fb14efdf8 100644
--- a/src/node_constants.cc --- a/src/node_constants.cc
+++ b/src/node_constants.cc +++ b/src/node_constants.cc
@@ -241,10 +241,6 @@ void DefineErrnoConstants(Local<Object> target) { @@ -241,10 +241,6 @@ void DefineErrnoConstants(Local<Object> target) {

View file

@ -48,7 +48,7 @@ index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18
static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual)); static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual));
diff --git a/src/node_buffer.cc b/src/node_buffer.cc diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index 5bdffc0a4d7f8f643343593a543f2064b670c1b9..6931404b75dbe17bf3c7b561430b8d7c0921d085 100644 index b8021c079ca6b141ea99a4abbc828430da9d3093..98ade40ec7a6bc805acb579c8a51dcd5468c2893 100644
--- a/src/node_buffer.cc --- a/src/node_buffer.cc
+++ b/src/node_buffer.cc +++ b/src/node_buffer.cc
@@ -44,6 +44,14 @@ @@ -44,6 +44,14 @@
@ -194,7 +194,7 @@ index 5bdffc0a4d7f8f643343593a543f2064b670c1b9..6931404b75dbe17bf3c7b561430b8d7c
static const v8::CFunction fast_write_string_ascii( static const v8::CFunction fast_write_string_ascii(
diff --git a/src/node_external_reference.h b/src/node_external_reference.h diff --git a/src/node_external_reference.h b/src/node_external_reference.h
index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d46afdce75 100644 index 3bc7b2cab5a12e281058b79a7d0f734eb527986c..4218eaf365c739a4c04ca94e29d6d2a33a637d44 100644
--- a/src/node_external_reference.h --- a/src/node_external_reference.h
+++ b/src/node_external_reference.h +++ b/src/node_external_reference.h
@@ -43,16 +43,16 @@ using CFunctionCallbackWithStrings = @@ -43,16 +43,16 @@ using CFunctionCallbackWithStrings =
@ -219,7 +219,7 @@ index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d4
uint32_t, uint32_t,
int64_t, int64_t,
bool); bool);
@@ -71,18 +71,20 @@ using CFunctionWithBool = void (*)(v8::Local<v8::Value>, @@ -73,18 +73,20 @@ using CFunctionWithBool = void (*)(v8::Local<v8::Value>,
using CFunctionWriteString = using CFunctionWriteString =
uint32_t (*)(v8::Local<v8::Value> receiver, uint32_t (*)(v8::Local<v8::Value> receiver,
@ -246,7 +246,7 @@ index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d4
// This class manages the external references from the V8 heap // This class manages the external references from the V8 heap
// to the C++ addresses in Node.js. // to the C++ addresses in Node.js.
diff --git a/src/util.h b/src/util.h diff --git a/src/util.h b/src/util.h
index a77332f583402af956cc886fd5b9771390cc4827..f0d7571caa458a3f9a9c252a95f72eb5fbddd06d 100644 index 6376cf4f81113cdb2e3c179b800f1c79b51ab762..cc7ad99f981f564fba0395159d9d8b39901050ff 100644
--- a/src/util.h --- a/src/util.h
+++ b/src/util.h +++ b/src/util.h
@@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@

View file

@ -11,10 +11,10 @@ This patch can be removed when we upgrade to a V8 version that
contains the above CL. contains the above CL.
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 0fbcd55d674b1d0cae88f04fe337cfcca702255f..092b1c525c7d4d50a09f99dc088d0698afcaf8a6 100644 index c0d0b734edfa729c91a8112189c480e3f2382988..a43d36c731693b9d2ed1ba13f6b4bb33bf6c4ca4 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -814,7 +814,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args, @@ -816,7 +816,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
} }
// TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default // TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default
// anymore. // anymore.

View file

@ -1,51 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Tue, 28 Jan 2025 09:27:58 +0100
Subject: linux: try preadv64/pwritev64 before preadv/pwritev (#4683)
Fixes: https://github.com/libuv/libuv/issues/4678
Refs: https://github.com/libuv/libuv/issues/4532
diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c
index 239ecda16a7eb9b40453502cf0362ae66366cf72..1631d9340bc10c2ac4c3d53a63ed9bc10f3e1c7c 100644
--- a/deps/uv/src/unix/fs.c
+++ b/deps/uv/src/unix/fs.c
@@ -461,12 +461,7 @@ static ssize_t uv__pwritev_emul(int fd,
/* The function pointer cache is an uintptr_t because _Atomic void*
* doesn't work on macos/ios/etc...
- * Disable optimization on armv7 to work around the bug described in
- * https://github.com/libuv/libuv/issues/4532
*/
-#if defined(__arm__) && (__ARM_ARCH == 7)
-__attribute__((optimize("O0")))
-#endif
static ssize_t uv__preadv_or_pwritev(int fd,
const struct iovec* bufs,
size_t nbufs,
@@ -479,7 +474,12 @@ static ssize_t uv__preadv_or_pwritev(int fd,
p = (void*) atomic_load_explicit(cache, memory_order_relaxed);
if (p == NULL) {
#ifdef RTLD_DEFAULT
- p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
+ /* Try _LARGEFILE_SOURCE version of preadv/pwritev first,
+ * then fall back to the plain version, for libcs like musl.
+ */
+ p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64");
+ if (p == NULL)
+ p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
dlerror(); /* Clear errors. */
#endif /* RTLD_DEFAULT */
if (p == NULL)
@@ -487,10 +487,7 @@ static ssize_t uv__preadv_or_pwritev(int fd,
atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed);
}
- /* Use memcpy instead of `f = p` to work around a compiler bug,
- * see https://github.com/libuv/libuv/issues/4532
- */
- memcpy(&f, &p, sizeof(p));
+ f = p;
return f(fd, bufs, nbufs, off);
}

View file

@ -6,7 +6,7 @@ Subject: Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62) (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index ccd2b4ced3134d81ddd37b8b5b90218457633421..a19fc5e52109bf2ad63fbe554c02a458c3096081 100644 index d90476addb3f7cc2d0b8d8686386873894e75c25..e647bdda4624317615490cedd8d4edbcebbca8bc 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -200,6 +200,13 @@ const { @@ -200,6 +200,13 @@ const {

View file

@ -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. a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 4fd535f730e6382672b853bf2098b3fefc1f83b4..bd6724de52ee1f01fa42084c7652c71054f0a9c6 100644 index dd9e3e58d72fb9ada1528212f80e0e911292a266..5758c74f6139dbe4fbeeae9d1e9b078688261257 100644
--- a/lib/internal/bootstrap/node.js --- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js
@@ -132,6 +132,10 @@ process.domain = null; @@ -132,6 +132,10 @@ process.domain = null;

View file

@ -47,7 +47,7 @@ index 5b7f6e0609c8414c686d2d5ca603ea5c8bc484d0..6c9c81ff3c08fc28dc35578229a78552
event_loop, event_loop,
platform, platform,
diff --git a/src/env.cc b/src/env.cc diff --git a/src/env.cc b/src/env.cc
index ddf82c8a18c29c355641e33974c1e5e67867379d..ae43803d8c2de90fb191a8e10605f6f3b18816ed 100644 index 400ff494f4e153408a2fce343d7b156d7ccefc7b..cac2d97323d131451eab4ca68ce771cb936447e4 100644
--- a/src/env.cc --- a/src/env.cc
+++ b/src/env.cc +++ b/src/env.cc
@@ -577,14 +577,6 @@ IsolateData::IsolateData(Isolate* isolate, @@ -577,14 +577,6 @@ IsolateData::IsolateData(Isolate* isolate,
@ -82,7 +82,7 @@ index ddf82c8a18c29c355641e33974c1e5e67867379d..ae43803d8c2de90fb191a8e10605f6f3
void SetCppgcReference(Isolate* isolate, void SetCppgcReference(Isolate* isolate,
Local<Object> object, Local<Object> object,
diff --git a/src/env.h b/src/env.h diff --git a/src/env.h b/src/env.h
index 9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f..c429eecd937d1df32a2ff90bc0a22a2e58df3a3d 100644 index 1079e3beb02e5f5d71a15fd2db65cb93ebd175d6..a7be609c3ab9093cec5145367b95ae6859936a24 100644
--- a/src/env.h --- a/src/env.h
+++ b/src/env.h +++ b/src/env.h
@@ -155,7 +155,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer { @@ -155,7 +155,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
@ -102,10 +102,10 @@ index 9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f..c429eecd937d1df32a2ff90bc0a22a2e
worker::Worker* worker_context_ = nullptr; worker::Worker* worker_context_ = nullptr;
PerIsolateWrapperData* wrapper_data_; PerIsolateWrapperData* wrapper_data_;
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 092b1c525c7d4d50a09f99dc088d0698afcaf8a6..6f8f6386d0db8aef1e2e0126cc9064101cbe6112 100644 index a43d36c731693b9d2ed1ba13f6b4bb33bf6c4ca4..0c2a4d344c991c2ca0d9d90934cf7921abf2a629 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -1258,6 +1258,14 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, @@ -1257,6 +1257,14 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
result->platform_ = per_process::v8_platform.Platform(); result->platform_ = per_process::v8_platform.Platform();
} }
@ -120,7 +120,7 @@ index 092b1c525c7d4d50a09f99dc088d0698afcaf8a6..6f8f6386d0db8aef1e2e0126cc906410
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) { if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
V8::Initialize(); V8::Initialize();
@@ -1267,14 +1275,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, @@ -1266,14 +1274,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore); absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
} }

View file

@ -16,7 +16,7 @@ patch:
(cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326) (cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326)
diff --git a/src/env-inl.h b/src/env-inl.h diff --git a/src/env-inl.h b/src/env-inl.h
index d4b211dfb2f77a65f311701d95365e66d92f8875..4c1a5f2b92d7fdddb8c2e7bbfd6788fdff3645b9 100644 index 0d32d9f5a55da257a5e5a895a2ff002b780f96fe..9567d9499c62ea44cca651e87ab912ad55e2d90b 100644
--- a/src/env-inl.h --- a/src/env-inl.h
+++ b/src/env-inl.h +++ b/src/env-inl.h
@@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const { @@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const {
@ -52,7 +52,7 @@ index d4b211dfb2f77a65f311701d95365e66d92f8875..4c1a5f2b92d7fdddb8c2e7bbfd6788fd
return &(wrapper_data_->cppgc_id); return &(wrapper_data_->cppgc_id);
} }
diff --git a/src/env.cc b/src/env.cc diff --git a/src/env.cc b/src/env.cc
index f8c24e422756d5101a258175a2f28a96648bea47..ddf82c8a18c29c355641e33974c1e5e67867379d 100644 index 99bd3e37853f99ecb2e45df373f17c10b3bd1561..400ff494f4e153408a2fce343d7b156d7ccefc7b 100644
--- a/src/env.cc --- a/src/env.cc
+++ b/src/env.cc +++ b/src/env.cc
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
@ -146,7 +146,7 @@ index f8c24e422756d5101a258175a2f28a96648bea47..ddf82c8a18c29c355641e33974c1e5e6
void IsolateData::MemoryInfo(MemoryTracker* tracker) const { void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
diff --git a/src/env.h b/src/env.h diff --git a/src/env.h b/src/env.h
index cfe917c797a6e4bb0f0284ec56be82637f840129..9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f 100644 index 07accfbcca491966c6c8ad9c20e146dbd22347f0..1079e3beb02e5f5d71a15fd2db65cb93ebd175d6 100644
--- a/src/env.h --- a/src/env.h
+++ b/src/env.h +++ b/src/env.h
@@ -175,10 +175,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer { @@ -175,10 +175,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {

View file

@ -40,10 +40,10 @@ index 5641990e0bac455c33ddf7b9a865deba871516e7..bd757f42e02391abbeec007d9c4cea60
} }
HistogramBase* histogram; HistogramBase* histogram;
diff --git a/src/node_file.cc b/src/node_file.cc diff --git a/src/node_file.cc b/src/node_file.cc
index 5aea65d6800494def62829432ee48f9c06e65d63..80cf6648ed99241eea8c176c5c958d76fe33aa14 100644 index 37172158d318d6569194fd3c5441d107e155e54c..41498615a37945111348e22b18214c3bcc9533a0 100644
--- a/src/node_file.cc --- a/src/node_file.cc
+++ b/src/node_file.cc +++ b/src/node_file.cc
@@ -1071,13 +1071,8 @@ static int32_t FastInternalModuleStat( @@ -1074,13 +1074,8 @@ static int32_t FastInternalModuleStat(
// NOLINTNEXTLINE(runtime/references) This is V8 api. // NOLINTNEXTLINE(runtime/references) This is V8 api.
FastApiCallbackOptions& options) { FastApiCallbackOptions& options) {
// This needs a HandleScope which needs an isolate. // This needs a HandleScope which needs an isolate.

View file

@ -189,7 +189,7 @@ index f616223cfb0f6e10f7cf57ada9704316bde2797e..eb6dad44a49d997097c8fb5009eeb60a
Local<Value> ret; Local<Value> ret;
if (!Buffer::New(env, ab, 0, ab->ByteLength()).ToLocal(&ret)) return {}; if (!Buffer::New(env, ab, 0, ab->ByteLength()).ToLocal(&ret)) return {};
diff --git a/src/node_i18n.cc b/src/node_i18n.cc diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index ea7810e41e2667713a896250dc1b904b0a7cf198..865b3128c1edfe7074769f25a0b87878ca094f31 100644 index 61b6ecd240c9500f21f683065a2f920af3afb502..ad2b1c76325cb5c8f18a618c5a85ae87b6a7bbe7 100644
--- a/src/node_i18n.cc --- a/src/node_i18n.cc
+++ b/src/node_i18n.cc +++ b/src/node_i18n.cc
@@ -104,7 +104,7 @@ namespace { @@ -104,7 +104,7 @@ namespace {
@ -384,18 +384,3 @@ index 9787b14352753c5e0f8dc2b90093680e7cd10f1a..31af9e62396368af1b81f8841a705fd3
auto ab = ArrayBuffer::New(isolate, std::move(bs)); auto ab = ArrayBuffer::New(isolate, std::move(bs));
v8::Local<Uint8Array> u8 = v8::Uint8Array::New(ab, 0, 1); v8::Local<Uint8Array> u8 = v8::Uint8Array::New(ab, 0, 1);
diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js
index 73fec107a36c3db4af6f492137d0ca174f2d0547..a1153ec381f7b12a1640b611073f6997e1ec5696 100644
--- a/test/parallel/test-buffer-tostring-range.js
+++ b/test/parallel/test-buffer-tostring-range.js
@@ -102,8 +102,8 @@ assert.throws(() => {
// Must not throw when start and end are within kMaxLength
// Cannot test on 32bit machine as we are testing the case
// when start and end are above the threshold
-if (!common.openSSLIsBoringSSL) {
+/*
const threshold = 0xFFFFFFFF;
const largeBuffer = Buffer.alloc(threshold + 20);
largeBuffer.toString('utf8', threshold, threshold + 20);
-}
+*/

View file

@ -1,38 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 5 May 2025 13:04:14 +0000
Subject: test: force slow JSON.stringify path for overflow
Refs https://chromium-review.googlesource.com/c/v8/v8/+/6011806
The V8 team just enabled the JSON.stringify fast path by default,
which is iterative and won't throw. Pre-emptively preserve test
functionality by forcing the slow path. See above linked PR for
approach this is borrowed from.
Upstreamed in https://github.com/nodejs/node/pull/58181.
diff --git a/test/fixtures/console/stack_overflow.js b/test/fixtures/console/stack_overflow.js
index 565692b6d6e4ba4c439a38250407004c5aa21df9..14bceef878b5cf27609b29c8cc7852cab4dd63ff 100644
--- a/test/fixtures/console/stack_overflow.js
+++ b/test/fixtures/console/stack_overflow.js
@@ -26,11 +26,15 @@ Error.stackTraceLimit = 0;
console.error('before');
+// Invalidate elements protector to force slow-path.
+// The fast-path of JSON.stringify is iterative and won't throw.
+Array.prototype[2] = 'foo';
+
// Trigger stack overflow by stringifying a deeply nested array.
-let array = [];
-for (let i = 0; i < 100000; i++) {
- array = [ array ];
-}
+// eslint-disable-next-line no-sparse-arrays
+let array = [,];
+for (let i = 0; i < 10000; i++)
+ array = [array];
JSON.stringify(array);

View file

@ -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. but don't cause CI failures on flakes.
diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status
index cc99efd7a743d683d5210ad83e258560c28cbd16..b2f0f7fb49665f0dc924cdd3e344c2579d617fbf 100644 index 8b9a4e80a08031085dde8a6952224e6ca3ca052e..2e83f166a34930083e697aaf06271e79cefe3f23 100644
--- a/test/parallel/parallel.status --- a/test/parallel/parallel.status
+++ b/test/parallel/parallel.status +++ b/test/parallel/parallel.status
@@ -5,6 +5,16 @@ prefix parallel @@ -5,6 +5,16 @@ prefix parallel