Skip to content

Commit ad3a1e4

Browse files
chore: bump node to v22.18.0 (main) (#47937)
* chore: bump node in DEPS to v22.18.0 * crypto: fix inclusion of OPENSSL_IS_BORINGSSL define nodejs/node#58845 * crypto: fix SHAKE128/256 breaking change introduced with OpenSSL 3.4 nodejs/node#58960 * permission: propagate permission model flags on spawn nodejs/node#58853 * esm: syncify default path of ModuleLoader\.load nodejs/node#57419 * src: remove fast API for InternalModuleStat nodejs/node#58489 * src: simplify adding fast APIs to ExternalReferenceRegistry nodejs/node#58896 * chore: fixup patch indices * src: fix internalModuleStat v8 fast path nodejs/node#58054 * test: add tests to ensure that node.1 is kept in sync with cli.md nodejs/node#58878 * crypto: fix SHAKE128/256 breaking change introduced with OpenSSL 3.4 nodejs/node#58942 --------- 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 d305989 commit ad3a1e4

37 files changed

Lines changed: 182 additions & 364 deletions

File tree

DEPS

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

lib/node/asar-fs-wrapper.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
742742
}
743743

744744
const dirent = getDirent(currentPath, result[0][i], type);
745-
const stat = internalBinding('fs').internalModuleStat(binding, resultPath);
745+
const stat = internalBinding('fs').internalModuleStat(resultPath);
746746

747747
context.readdirResults.push(dirent);
748748
if (dirent.isDirectory() || stat === 1) {
@@ -755,7 +755,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
755755
for (let i = 0; i < result.length; i++) {
756756
const resultPath = path.join(currentPath, result[i]);
757757
const relativeResultPath = path.relative(context.basePath, resultPath);
758-
const stat = internalBinding('fs').internalModuleStat(binding, resultPath);
758+
const stat = internalBinding('fs').internalModuleStat(resultPath);
759759
context.readdirResults.push(relativeResultPath);
760760

761761
if (stat === 1) {
@@ -825,7 +825,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
825825
if (context.withFileTypes) {
826826
readdirResult = [
827827
[...readdirResult], readdirResult.map((p: string) => {
828-
return internalBinding('fs').internalModuleStat(binding, path.join(pathArg, p));
828+
return internalBinding('fs').internalModuleStat(path.join(pathArg, p));
829829
})
830830
];
831831
}
@@ -1010,9 +1010,9 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
10101010
});
10111011

10121012
const { internalModuleStat } = binding;
1013-
internalBinding('fs').internalModuleStat = (receiver: unknown, pathArgument: string) => {
1013+
internalBinding('fs').internalModuleStat = (pathArgument: string) => {
10141014
const pathInfo = splitPath(pathArgument);
1015-
if (!pathInfo.isAsar) return internalModuleStat(receiver, pathArgument);
1015+
if (!pathInfo.isAsar) return internalModuleStat(pathArgument);
10161016
const { asarPath, filePath } = pathInfo;
10171017

10181018
// -ENOENT
@@ -1047,7 +1047,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
10471047
if (withFileTypes) {
10481048
initialItem = [
10491049
[...initialItem], initialItem.map((p: string) => {
1050-
return internalBinding('fs').internalModuleStat(binding, path.join(originalPath, p));
1050+
return internalBinding('fs').internalModuleStat(path.join(originalPath, p));
10511051
})
10521052
];
10531053
}
@@ -1080,7 +1080,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
10801080

10811081
readdirResult = [
10821082
[...files], files.map((p: string) => {
1083-
return internalBinding('fs').internalModuleStat(binding, path.join(direntPath, p));
1083+
return internalBinding('fs').internalModuleStat(path.join(direntPath, p));
10841084
})
10851085
];
10861086
} else {
@@ -1101,7 +1101,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
11011101
const { 0: pathArg, 1: readDir } = queue.pop();
11021102
for (const ent of readDir) {
11031103
const direntPath = path.join(pathArg, ent);
1104-
const stat = internalBinding('fs').internalModuleStat(binding, direntPath);
1104+
const stat = internalBinding('fs').internalModuleStat(direntPath);
11051105
result.push(path.relative(originalPath, direntPath));
11061106

11071107
if (stat === 1) {
@@ -1155,7 +1155,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
11551155
if (context.withFileTypes) {
11561156
readdirResult = [
11571157
[...readdirResult], readdirResult.map((p: string) => {
1158-
return internalBinding('fs').internalModuleStat(binding, path.join(pathArg, p));
1158+
return internalBinding('fs').internalModuleStat(path.join(pathArg, p));
11591159
})
11601160
];
11611161
}

patches/node/.patches

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ test_use_static_method_names_in_call_stacks.patch
3737
fix_remove_fastapitypedarray_usage.patch
3838
test_handle_explicit_resource_management_globals.patch
3939
build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch
40-
build_option_to_use_custom_inspector_protocol_path.patch
4140
fix_adjust_wpt_and_webidl_tests_for_enabled_float16array.patch
4241
chore_add_createexternalizabletwobytestring_to_globals.patch
4342
refactor_attach_cppgc_heap_on_v8_isolate_creation.patch
@@ -46,7 +45,5 @@ cli_move_--trace-atomics-wait_to_eol.patch
4645
fix_cppgc_initializing_twice.patch
4746
fix_task_starvation_in_inspector_context_test.patch
4847
fix_expose_readfilesync_override_for_modules.patch
49-
chore_remove_protocol_maybe_from_node_string.patch
50-
fix_-wmismatched-new-delete_in_debug_utils_cc.patch
5148
fix_array_out-of-bounds_read_in_boyer-moore_search.patch
5249
chore_add_missing_include_of_iterator.patch

patches/node/build_add_gn_build_files.patch

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ really in 20/21. We have to wait until 22 is released to be able to
1111
build with upstream GN files.
1212

1313
diff --git a/configure.py b/configure.py
14-
index 4560bac7b8e3c707ecea5a425f642efb9de9ed36..e9c2a4391f4058a21a259cacaac4fde5d199288e 100755
14+
index 2415940835036226799a7ea14c6687cc0d56c523..0feb07afbccad97a92cee00954443407eb20ac67 100755
1515
--- a/configure.py
1616
+++ b/configure.py
1717
@@ -1722,7 +1722,7 @@ def configure_v8(o, configs):
@@ -24,7 +24,7 @@ index 4560bac7b8e3c707ecea5a425f642efb9de9ed36..e9c2a4391f4058a21a259cacaac4fde5
2424
o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0
2525
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
2626
diff --git a/node.gni b/node.gni
27-
index 35ccd0487f20cece033d58827ecb7ed016908ee4..62cd49c6a87074912a1cb6792576c8d4f239b669 100644
27+
index b049f0692980c3e26771c3209c3bdd2e9a4d637b..e2407027ab05e59b2f0f1c213b98ea469db7a91b 100644
2828
--- a/node.gni
2929
+++ b/node.gni
3030
@@ -5,10 +5,10 @@
@@ -40,7 +40,7 @@ index 35ccd0487f20cece033d58827ecb7ed016908ee4..62cd49c6a87074912a1cb6792576c8d4
4040

4141
# The location of OpenSSL - use the one from node's deps by default.
4242
node_openssl_path = "$node_path/deps/openssl"
43-
@@ -39,12 +39,15 @@ declare_args() {
43+
@@ -42,12 +42,15 @@ declare_args() {
4444
# The variable is called "openssl" for parity with node's GYP build.
4545
node_use_openssl = true
4646

@@ -57,7 +57,7 @@ index 35ccd0487f20cece033d58827ecb7ed016908ee4..62cd49c6a87074912a1cb6792576c8d4
5757

5858
# Custom build tag.
5959
node_tag = ""
60-
@@ -64,10 +67,16 @@ declare_args() {
60+
@@ -67,10 +70,16 @@ declare_args() {
6161
# TODO(zcbenz): There are few broken things for now:
6262
# 1. cross-os compilation is not supported.
6363
# 2. node_mksnapshot crashes when cross-compiling for x64 from arm64.
@@ -76,10 +76,10 @@ index 35ccd0487f20cece033d58827ecb7ed016908ee4..62cd49c6a87074912a1cb6792576c8d4
7676

7777
assert(!node_enable_inspector || node_use_openssl,
7878
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
79-
index 092341dbfbabe15b15ed43057d399f754505f6fd..f14b45850e42585f5686b7201e2b8281ed8c24e1 100644
79+
index abf1583cdac9f139056cf4809f14e28e62f6d24c..8b104e175ccf8de90c138337f83f8f6ce1348ac7 100644
8080
--- a/src/node_builtins.cc
8181
+++ b/src/node_builtins.cc
82-
@@ -788,6 +788,7 @@ void BuiltinLoader::RegisterExternalReferences(
82+
@@ -789,6 +789,7 @@ void BuiltinLoader::RegisterExternalReferences(
8383
registry->Register(GetNatives);
8484

8585
RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@@ -279,7 +279,7 @@ index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd1
279279
if sys.platform == 'win32':
280280
files = [ x.replace('\\', '/') for x in files ]
281281
diff --git a/unofficial.gni b/unofficial.gni
282-
index 44641b92678ab2f28e6f5de75a92878f9f3d322d..a6cfd45b109c7b38fcf1529468ff64d3c1c8bd1b 100644
282+
index da565473f1ae96b4d009935f7733e6ab15ea9de2..26ebc811272ef2990f8d090c54e7f5294aab9d37 100644
283283
--- a/unofficial.gni
284284
+++ b/unofficial.gni
285285
@@ -22,6 +22,11 @@ template("node_gn_build") {
@@ -354,8 +354,8 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..a6cfd45b109c7b38fcf1529468ff64d3
354354
+ }
355355
if (node_enable_inspector) {
356356
deps += [
357-
"src/inspector:crdtp",
358-
@@ -214,6 +232,10 @@ template("node_gn_build") {
357+
"$node_inspector_protocol_path:crdtp",
358+
@@ -215,6 +233,10 @@ template("node_gn_build") {
359359
}
360360
}
361361

@@ -366,15 +366,15 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..a6cfd45b109c7b38fcf1529468ff64d3
366366
executable(target_name) {
367367
forward_variables_from(invoker, "*")
368368

369-
@@ -288,6 +310,7 @@ template("node_gn_build") {
369+
@@ -289,6 +311,7 @@ template("node_gn_build") {
370370
}
371371

372372
executable("node_js2c") {
373373
+ defines = []
374374
deps = [
375375
"deps/uv",
376376
"$node_simdutf_path",
377-
@@ -298,26 +321,75 @@ template("node_gn_build") {
377+
@@ -299,26 +322,75 @@ template("node_gn_build") {
378378
"src/embedded_data.cc",
379379
"src/embedded_data.h",
380380
]
@@ -460,7 +460,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..a6cfd45b109c7b38fcf1529468ff64d3
460460
outputs = [ "$target_gen_dir/node_javascript.cc" ]
461461

462462
# Get the path to node_js2c executable of the host toolchain.
463-
@@ -331,11 +403,11 @@ template("node_gn_build") {
463+
@@ -332,11 +404,11 @@ template("node_gn_build") {
464464
get_label_info(":node_js2c($host_toolchain)", "name") +
465465
host_executable_suffix
466466

patches/node/build_allow_unbundling_of_node_js_dependencies.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ We don't need to do this for zlib, as the existing gn workflow uses the same
1414
Upstreamed at https://github.com/nodejs/node/pull/55903
1515

1616
diff --git a/unofficial.gni b/unofficial.gni
17-
index a6cfd45b109c7b38fcf1529468ff64d3c1c8bd1b..332c9ee7262108ae9616e9bc8bd950a4940a858c 100644
17+
index 26ebc811272ef2990f8d090c54e7f5294aab9d37..8886f2a79ae77614789d6ae0defd4f18fc756456 100644
1818
--- a/unofficial.gni
1919
+++ b/unofficial.gni
2020
@@ -160,7 +160,6 @@ template("node_gn_build") {
@@ -44,7 +44,7 @@ index a6cfd45b109c7b38fcf1529468ff64d3c1c8bd1b..332c9ee7262108ae9616e9bc8bd950a4
4444
if (v8_enable_i18n_support) {
4545
deps += [ "//third_party/icu" ]
4646
}
47-
@@ -230,6 +239,19 @@ template("node_gn_build") {
47+
@@ -231,6 +240,19 @@ template("node_gn_build") {
4848
sources += node_inspector.node_inspector_sources +
4949
node_inspector.node_inspector_generated_sources
5050
}

patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ index 8521730bd03cdfce47e9b5d0f5d68a568bc3de8c..28f4598aa7ea0e93350f79566c06d0f0
3838
}
3939

4040
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
41-
index 94ec9b2301998c4c5aad9ca3dae72ecf323fa0bb..a0d19a592d7bf9b00d6b98ef1ae931626ebb945c 100644
41+
index bcdedaa2ae4ab1d3267d7a1347f15e0405261277..ddedca4a5b9b35258050f8b4cb446ceeba956896 100644
4242
--- a/src/inspector/node_string.h
4343
+++ b/src/inspector/node_string.h
44-
@@ -19,8 +19,8 @@ namespace crdtp {
44+
@@ -18,8 +18,8 @@ namespace crdtp {
4545

4646
template <>
4747
struct ProtocolTypeTraits<std::string> {

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 acfc02510ee1ce34a3f410a7a4ce53adb42abd35..b9264bfb1170928431848bb2b99e4f0dfbe8f95a 100644
13+
index 679633dc6b4ce2a1f5f88e93d1a1c1feb4bbadb4..2caa183213d5632be81b763e894e37c09384391f 100644
1414
--- a/common.gypi
1515
+++ b/common.gypi
16-
@@ -538,7 +538,7 @@
16+
@@ -539,7 +539,7 @@
1717
'-fno-rtti',
1818
'-fno-exceptions',
1919
'-fno-strict-aliasing',
@@ -22,7 +22,7 @@ index acfc02510ee1ce34a3f410a7a4ce53adb42abd35..b9264bfb1170928431848bb2b99e4f0d
2222
],
2323
'defines': [ '__STDC_FORMAT_MACROS' ],
2424
'ldflags': [ '-rdynamic' ],
25-
@@ -708,7 +708,7 @@
25+
@@ -709,7 +709,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 0434887c363a586cbfa0438765fc8800d4237057..20fbf03cee24e66f9ad0d394dbcfa3ad03348890 100644
67+
index 442c1e7a6ddafbb7a7ec7a42a97ec04b28ea4d93..3a66c11d39dd2fd129c8f54098a9607e080ecca0 100644
6868
--- a/node.gyp
6969
+++ b/node.gyp
70-
@@ -175,7 +175,6 @@
70+
@@ -176,7 +176,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-
@@ -302,7 +301,6 @@
78+
@@ -304,7 +303,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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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 cf643bcd0bc9080b80bf12afeebc69f2db74bb54..acfc02510ee1ce34a3f410a7a4ce53adb42abd35 100644
10+
index 33af43cd768c24b26d523f3db66eb8b9eb26859a..679633dc6b4ce2a1f5f88e93d1a1c1feb4bbadb4 100644
1111
--- a/common.gypi
1212
+++ b/common.gypi
1313
@@ -89,6 +89,8 @@
@@ -19,7 +19,7 @@ index cf643bcd0bc9080b80bf12afeebc69f2db74bb54..acfc02510ee1ce34a3f410a7a4ce53ad
1919
##### end V8 defaults #####
2020

2121
# When building native modules using 'npm install' with the system npm,
22-
@@ -297,7 +299,8 @@
22+
@@ -298,7 +300,8 @@
2323
'_GLIBCXX_USE_CXX11_ABI=1',
2424
# This help forks when building Node.js on a 32-bit arch as
2525
# libuv is always compiled with _FILE_OFFSET_BITS=64
@@ -29,7 +29,7 @@ index cf643bcd0bc9080b80bf12afeebc69f2db74bb54..acfc02510ee1ce34a3f410a7a4ce53ad
2929
],
3030

3131
# Forcibly disable -Werror. We support a wide range of compilers, it's
32-
@@ -454,6 +457,11 @@
32+
@@ -455,6 +458,11 @@
3333
}],
3434
],
3535
}],
@@ -42,7 +42,7 @@ index cf643bcd0bc9080b80bf12afeebc69f2db74bb54..acfc02510ee1ce34a3f410a7a4ce53ad
4242
# list in v8/BUILD.gn.
4343
['v8_enable_v8_checks == 1', {
4444
diff --git a/configure.py b/configure.py
45-
index e9c2a4391f4058a21a259cacaac4fde5d199288e..7821a0d3a7179a9e7fa9e48a062c2b0e7705ca6f 100755
45+
index 0feb07afbccad97a92cee00954443407eb20ac67..5eccced7cf0212f229db68c76cc824a37e4a29bc 100755
4646
--- a/configure.py
4747
+++ b/configure.py
4848
@@ -1704,6 +1704,7 @@ def configure_library(lib, output, pkgname=None):

patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ JS errors and ensures embedder JS is loaded via LoadEmbedderJavaScriptSource.
1010
That method is generated by our modifications to js2c.cc in the BUILD.gn patch
1111

1212
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
13-
index 411eab8136d5957ae8a491bc38ffbdc88e59f5da..63c93b5be09692d0d4b6bfbb214b173b50ccca43 100644
13+
index 0244a214b187e67e0cb89f26cd019855963ec93a..b65a3be6bcb0e28f7f43367d0fa9da533db9d0d1 100644
1414
--- a/lib/internal/fs/watchers.js
1515
+++ b/lib/internal/fs/watchers.js
16-
@@ -292,12 +292,13 @@ function emitCloseNT(self) {
16+
@@ -299,12 +299,13 @@ function emitCloseNT(self) {
1717
}
1818

1919
// Legacy alias on the C++ wrapper object. This is not public API, so we may
@@ -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 f14b45850e42585f5686b7201e2b8281ed8c24e1..915b8cba6d512096e6090272ab3fbc63d5c61ce8 100644
37+
index 8b104e175ccf8de90c138337f83f8f6ce1348ac7..35cf42a5e533cb799bf129df0c8370bfe8310233 100644
3838
--- a/src/node_builtins.cc
3939
+++ b/src/node_builtins.cc
4040
@@ -35,6 +35,7 @@ using v8::Value;

0 commit comments

Comments
 (0)