Skip to content

Commit 0da55c0

Browse files
electron-roller[bot]codebytere
authored andcommitted
chore: bump node to v22.17.0 (main) (electron#47557)
* chore: bump node in DEPS to v22.17.0 * build: use //third_party/simdutf by default in GN nodejs/node#58115 * chore: adjust crypto specs: - nodejs/node#58117 - nodejs/node#58387 * deps: update libuv to 1.51.0 nodejs/node#58124 * test: fix test-buffer-tostring-range on allocation failure nodejs/node#58416 * build: use FILE_OFFSET_BITS=64 esp. on 32-bit arch nodejs/node#58090 * build: use //third_party/simdutf by default in GN nodejs/node#58115 * inspector: add protocol method Network.dataReceived nodejs/node#58001 * test: force slow JSON.stringify path for overflow nodejs/node#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 nodejs/node#57738 * crypto: expose process.features.openssl_is_boringssl nodejs/node#58387 * util: add internal assignFunctionName() function nodejs/node#57916 * build: fix pointer compression builds nodejs/node#58171 * chore: put back config options * fixup! deps: update libuv to 1.51.0 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
1 parent dece552 commit 0da55c0

43 files changed

Lines changed: 359 additions & 620 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars = {
44
'chromium_version':
55
'139.0.7256.0',
66
'node_version':
7-
'v22.16.0',
7+
'v22.17.0',
88
'nan_version':
99
'e14bdcd1f72d62bca1d541b66da43130384ec213',
1010
'squirrel.mac_version':

lib/node/asar-fs-wrapper.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ const {
5454
getDirent
5555
} = __non_webpack_require__('internal/fs/utils');
5656

57+
const {
58+
assignFunctionName
59+
} = __non_webpack_require__('internal/util');
60+
5761
const {
5862
validateBoolean,
5963
validateFunction
@@ -235,7 +239,10 @@ const overrideAPI = function (module: Record<string, any>, name: string, pathArg
235239
};
236240

237241
if (old[util.promisify.custom]) {
238-
module[name][util.promisify.custom] = makePromiseFunction(old[util.promisify.custom], pathArgumentIndex);
242+
module[name][util.promisify.custom] = assignFunctionName(
243+
name,
244+
makePromiseFunction(old[util.promisify.custom], pathArgumentIndex)
245+
);
239246
}
240247

241248
if (module.promises && module.promises[name]) {
@@ -1238,7 +1245,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
12381245
// command as a single path to an archive.
12391246
const { exec, execSync } = childProcess;
12401247
childProcess.exec = invokeWithNoAsar(exec);
1241-
childProcess.exec[util.promisify.custom] = invokeWithNoAsar(exec[util.promisify.custom]);
1248+
childProcess.exec[util.promisify.custom] = assignFunctionName('exec', invokeWithNoAsar(exec[util.promisify.custom]));
12421249
childProcess.execSync = invokeWithNoAsar(execSync);
12431250

12441251
overrideAPI(childProcess, 'execFile');

patches/node/.patches

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ fix_remove_harmony-import-assertions_from_node_cc.patch
3434
chore_disable_deprecation_ftbfs_in_simdjson_header.patch
3535
build_allow_unbundling_of_node_js_dependencies.patch
3636
test_use_static_method_names_in_call_stacks.patch
37-
build_use_third_party_simdutf.patch
3837
fix_remove_fastapitypedarray_usage.patch
3938
test_handle_explicit_resource_management_globals.patch
40-
linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch
4139
build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch
4240
build_option_to_use_custom_inspector_protocol_path.patch
4341
fix_adjust_wpt_and_webidl_tests_for_enabled_float16array.patch
@@ -48,4 +46,5 @@ cli_move_--trace-atomics-wait_to_eol.patch
4846
fix_cppgc_initializing_twice.patch
4947
fix_task_starvation_in_inspector_context_test.patch
5048
fix_expose_readfilesync_override_for_modules.patch
51-
test_force_slow_json_stringify_path_for_overflow.patch
49+
chore_remove_protocol_maybe_from_node_string.patch
50+
fix_-wmismatched-new-delete_in_debug_utils_cc.patch

patches/node/build_add_gn_build_files.patch

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,21 @@ however those files were cherry-picked from main branch and do not
1010
really in 20/21. We have to wait until 22 is released to be able to
1111
build with upstream GN files.
1212

13+
diff --git a/configure.py b/configure.py
14+
index 4560bac7b8e3c707ecea5a425f642efb9de9ed36..e9c2a4391f4058a21a259cacaac4fde5d199288e 100755
15+
--- a/configure.py
16+
+++ b/configure.py
17+
@@ -1722,7 +1722,7 @@ def configure_v8(o, configs):
18+
# Until we manage to get rid of all those, v8_enable_sandbox cannot be used.
19+
# Note that enabling pointer compression without enabling sandbox is unsupported by V8,
20+
# so this can be broken at any time.
21+
- o['variables']['v8_enable_sandbox'] = 0
22+
+ o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0
23+
o['variables']['v8_enable_pointer_compression_shared_cage'] = 1 if options.enable_pointer_compression else 0
24+
o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0
25+
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
1326
diff --git a/node.gni b/node.gni
14-
index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3fd219be7d 100644
27+
index 35ccd0487f20cece033d58827ecb7ed016908ee4..b4450e3dd17994d1eaf59eb5cff5912545e89793 100644
1528
--- a/node.gni
1629
+++ b/node.gni
1730
@@ -5,10 +5,10 @@
@@ -55,10 +68,10 @@ index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3f
5568

5669
assert(!node_enable_inspector || node_use_openssl,
5770
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
58-
index defb657a62a0316224a02b68505ac1142fd89d03..d637faac88875bfa110e2b8d1f53962061d98279 100644
71+
index 092341dbfbabe15b15ed43057d399f754505f6fd..f14b45850e42585f5686b7201e2b8281ed8c24e1 100644
5972
--- a/src/node_builtins.cc
6073
+++ b/src/node_builtins.cc
61-
@@ -785,6 +785,7 @@ void BuiltinLoader::RegisterExternalReferences(
74+
@@ -788,6 +788,7 @@ void BuiltinLoader::RegisterExternalReferences(
6275
registry->Register(GetNatives);
6376

6477
RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@@ -80,18 +93,18 @@ index f9426599f2d5dc6ad061407f0c4eb2c9203a4433..302030f610965f07dd6998d282275c1b
8093
// Handles compilation and caching of built-in JavaScript modules and
8194
// bootstrap scripts, whose source are bundled into the binary as static data.
8295
diff --git a/tools/install.py b/tools/install.py
83-
index 17515720ba9c85d533465365188021074a8d30f4..92f83a83be67aafc9ead6923b868dbb0de39db34 100755
96+
index 8797b59e59c85a8877b977fa3281e50165e6f6b2..0af01e075616195f38fb242626dcab770ec1eb57 100755
8497
--- a/tools/install.py
8598
+++ b/tools/install.py
86-
@@ -212,6 +212,7 @@ def headers(options, action):
99+
@@ -222,6 +222,7 @@ def headers(options, action):
87100
'include/cppgc/internal/caged-heap-local-data.h',
88101
'include/cppgc/internal/caged-heap.h',
89102
'include/cppgc/internal/compiler-specific.h',
90103
+ 'include/cppgc/internal/conditional-stack-allocated.h',
91104
'include/cppgc/internal/finalizer-trait.h',
92105
'include/cppgc/internal/gc-info.h',
93106
'include/cppgc/internal/logging.h',
94-
@@ -291,6 +292,7 @@ def headers(options, action):
107+
@@ -301,6 +302,7 @@ def headers(options, action):
95108
'include/v8-promise.h',
96109
'include/v8-proxy.h',
97110
'include/v8-regexp.h',

patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Shelley Vohr <shelley.vohr@gmail.com>
3-
Date: Wed, 12 Feb 2025 15:31:07 +0100
3+
Date: Thu, 26 Jun 2025 09:25:24 +0000
44
Subject: build: change crdtp::ProtocolTypeTraits signatures to avoid conflict
55

66
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,
1414
Some distinguishing change should be upstreamed to Node.js.
1515

1616
diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc
17-
index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb314eb33666 100644
17+
index 8521730bd03cdfce47e9b5d0f5d68a568bc3de8c..28f4598aa7ea0e93350f79566c06d0f08313be9f 100644
1818
--- a/src/inspector/node_string.cc
1919
+++ b/src/inspector/node_string.cc
2020
@@ -7,7 +7,8 @@
@@ -27,7 +27,7 @@ index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb31
2727
if (state->tokenizer()->TokenTag() == cbor::CBORTokenTag::STRING8) {
2828
span<uint8_t> cbor_span = state->tokenizer()->GetString8();
2929
value->assign(reinterpret_cast<const char*>(cbor_span.data()),
30-
@@ -24,12 +25,13 @@ bool ProtocolTypeTraits<std::string>::Deserialize(DeserializerState* state,
30+
@@ -24,7 +25,8 @@ bool ProtocolTypeTraits<std::string>::Deserialize(DeserializerState* state,
3131
}
3232

3333
void ProtocolTypeTraits<std::string>::Serialize(const std::string& value,
@@ -36,18 +36,12 @@ index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb31
3636
+ void* extra) {
3737
cbor::EncodeString8(SpanFrom(value), bytes);
3838
}
39-
-
40-
} // namespace crdtp
4139

42-
+
43-
namespace node {
44-
namespace inspector {
45-
namespace protocol {
4640
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
47-
index 38cf96e874dcc49cde87137b2737c35a84f418d0..b2f67c224acc7b3a3b867867e251a7c62833f46e 100644
41+
index 94ec9b2301998c4c5aad9ca3dae72ecf323fa0bb..a0d19a592d7bf9b00d6b98ef1ae931626ebb945c 100644
4842
--- a/src/inspector/node_string.h
4943
+++ b/src/inspector/node_string.h
50-
@@ -15,8 +15,8 @@ namespace crdtp {
44+
@@ -19,8 +19,8 @@ namespace crdtp {
5145

5246
template <>
5347
struct ProtocolTypeTraits<std::string> {
@@ -57,4 +51,4 @@ index 38cf96e874dcc49cde87137b2737c35a84f418d0..b2f67c224acc7b3a3b867867e251a7c6
5751
+ static void Serialize(const std::string& value, std::vector<uint8_t>* bytes, void* extra = nullptr);
5852
};
5953

60-
} // namespace crdtp
54+
template <>

patches/node/build_compile_with_c_20_support.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8
1010
This can be removed when Electron upgrades to a version of Node.js containing the required V8 version.
1111

1212
diff --git a/common.gypi b/common.gypi
13-
index f3476a91e4c3cda7cecf49e07bb594a167ac46ef..de73f6c18131f43e6fe3107c866599aa3398cf10 100644
13+
index 03fefab4b0a9727925411b95310831ffdc33e8d9..f9b5e47f1d67807435529c99d12f419d0fd4269f 100644
1414
--- a/common.gypi
1515
+++ b/common.gypi
16-
@@ -530,7 +530,7 @@
16+
@@ -538,7 +538,7 @@
1717
'-fno-rtti',
1818
'-fno-exceptions',
1919
'-fno-strict-aliasing',
@@ -22,7 +22,7 @@ index f3476a91e4c3cda7cecf49e07bb594a167ac46ef..de73f6c18131f43e6fe3107c866599aa
2222
],
2323
'defines': [ '__STDC_FORMAT_MACROS' ],
2424
'ldflags': [ '-rdynamic' ],
25-
@@ -700,7 +700,7 @@
25+
@@ -708,7 +708,7 @@
2626
['clang==1', {
2727
'xcode_settings': {
2828
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',

patches/node/build_enable_perfetto.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
6464

6565
module.exports = {
6666
diff --git a/node.gyp b/node.gyp
67-
index ad010a8d99cf08013b7202eddce66e5b3885652d..d735b887d05ddfadec8e56dd8eae09646890aa84 100644
67+
index 0434887c363a586cbfa0438765fc8800d4237057..20fbf03cee24e66f9ad0d394dbcfa3ad03348890 100644
6868
--- a/node.gyp
6969
+++ b/node.gyp
70-
@@ -176,7 +176,6 @@
70+
@@ -175,7 +175,6 @@
7171
'src/timers.cc',
7272
'src/timer_wrap.cc',
7373
'src/tracing/agent.cc',
7474
- 'src/tracing/node_trace_buffer.cc',
7575
'src/tracing/node_trace_writer.cc',
7676
'src/tracing/trace_event.cc',
7777
'src/tracing/traced_value.cc',
78-
@@ -305,7 +304,6 @@
78+
@@ -302,7 +301,6 @@
7979
'src/tcp_wrap.h',
8080
'src/timers.h',
8181
'src/tracing/agent.h',

patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Subject: build: ensure native module compilation fails if not using a new
77
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
88

99
diff --git a/common.gypi b/common.gypi
10-
index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a167ac46ef 100644
10+
index bfe567e016cf102d2087f7647e64cc051116ab8d..03fefab4b0a9727925411b95310831ffdc33e8d9 100644
1111
--- a/common.gypi
1212
+++ b/common.gypi
13-
@@ -88,6 +88,8 @@
13+
@@ -89,6 +89,8 @@
1414
'v8_use_perfetto': 0,
1515
'tsan%': 0,
1616

@@ -19,15 +19,17 @@ index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a1
1919
##### end V8 defaults #####
2020

2121
# When building native modules using 'npm install' with the system npm,
22-
@@ -293,6 +295,7 @@
23-
# Defines these mostly for node-gyp to pickup.
24-
'defines': [
22+
@@ -297,7 +299,8 @@
2523
'_GLIBCXX_USE_CXX11_ABI=1',
24+
# This help forks when building Node.js on a 32-bit arch as
25+
# libuv is always compiled with _FILE_OFFSET_BITS=64
26+
- '_FILE_OFFSET_BITS=64'
27+
+ '_FILE_OFFSET_BITS=64',
2628
+ 'ELECTRON_ENSURE_CONFIG_GYPI',
2729
],
2830

2931
# Forcibly disable -Werror. We support a wide range of compilers, it's
30-
@@ -449,6 +452,11 @@
32+
@@ -454,6 +457,11 @@
3133
}],
3234
],
3335
}],
@@ -40,10 +42,10 @@ index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a1
4042
# list in v8/BUILD.gn.
4143
['v8_enable_v8_checks == 1', {
4244
diff --git a/configure.py b/configure.py
43-
index 932484674e5b15b765b8bfe307bdf99b49b5039f..befaa85527b9ebebad226e603586e23d04ec1e51 100755
45+
index e9c2a4391f4058a21a259cacaac4fde5d199288e..7821a0d3a7179a9e7fa9e48a062c2b0e7705ca6f 100755
4446
--- a/configure.py
4547
+++ b/configure.py
46-
@@ -1698,6 +1698,7 @@ def configure_library(lib, output, pkgname=None):
48+
@@ -1704,6 +1704,7 @@ def configure_library(lib, output, pkgname=None):
4749
def configure_v8(o, configs):
4850
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)
4951

patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ index 411eab8136d5957ae8a491bc38ffbdc88e59f5da..63c93b5be09692d0d4b6bfbb214b173b
3434
let kResistStopPropagation;
3535

3636
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
37-
index d637faac88875bfa110e2b8d1f53962061d98279..e0b58c4d0ac5640a677c22d710f88f1b318378d7 100644
37+
index f14b45850e42585f5686b7201e2b8281ed8c24e1..915b8cba6d512096e6090272ab3fbc63d5c61ce8 100644
3838
--- a/src/node_builtins.cc
3939
+++ b/src/node_builtins.cc
4040
@@ -35,6 +35,7 @@ using v8::Value;

patches/node/build_option_to_use_custom_inspector_protocol_path.patch

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,6 @@ index 203b4abbc44df9e58083c819f61f9025104abdc6..73bf3839866a2652ca660f1117e8f249
2525
# The NODE_MODULE_VERSION defined in node_version.h.
2626
node_module_version = exec_script("$node_path/tools/getmoduleversion.py", [], "value")
2727

28-
diff --git a/src/inspector/node_json.cc b/src/inspector/node_json.cc
29-
index d8aacbdf1a8fc858c792ad3ce17ca2f46baebe7e..4625008c048532c2c3340130670647d2877430bd 100644
30-
--- a/src/inspector/node_json.cc
31-
+++ b/src/inspector/node_json.cc
32-
@@ -72,7 +72,7 @@ class ValueParserHandler : public ParserHandler {
33-
34-
void HandleBinary(span<uint8_t> bytes) override {
35-
AddValueToParent(
36-
- BinaryValue::create(Binary::fromSpan(bytes.data(), bytes.size())));
37-
+ BinaryValue::create(Binary::fromSpan(bytes)));
38-
}
39-
40-
void HandleDouble(double value) override {
41-
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
42-
index b2f67c224acc7b3a3b867867e251a7c62833f46e..33e93ce5bf7dda7e30b7b1b198ff3b53ccfac22a 100644
43-
--- a/src/inspector/node_string.h
44-
+++ b/src/inspector/node_string.h
45-
@@ -66,7 +66,7 @@ class Binary {
46-
static Binary fromBase64(const std::string_view base64, bool* success) {
47-
UNREACHABLE();
48-
}
49-
- static Binary fromSpan(const uint8_t* data, size_t size) { UNREACHABLE(); }
50-
+ static Binary fromSpan(crdtp::span<const uint8_t> data) { UNREACHABLE(); }
51-
};
52-
53-
} // namespace protocol
5428
diff --git a/src/inspector/unofficial.gni b/src/inspector/unofficial.gni
5529
index 3d7aa148678b2646b88fa7c32abec91791b02b82..4810d93eb971b253f7dadff7011a632f6dbe6a2b 100644
5630
--- a/src/inspector/unofficial.gni

0 commit comments

Comments
 (0)