Skip to content

Commit 653d0f0

Browse files
electron-roller[bot]codebyterepatchup[bot]
authored
chore: bump node to v20.13.1 (main) (#42088)
* chore: bump node in DEPS to v20.13.0 * crypto: enable NODE_EXTRA_CA_CERTS with BoringSSL nodejs/node#52217 * test: skip test for dynamically linked OpenSSL nodejs/node#52542 * lib, url: add a `windows` option to path parsing nodejs/node#52509 * src: use dedicated routine to compile function for builtin CJS loader nodejs/node#52016 * test: mark test as flaky nodejs/node#52671 * build,tools: add test-ubsan ci nodejs/node#46297 * src: preload function for Environment nodejs/node#51539 * chore: fixup patch indices * deps: update c-ares to 1.28.1 nodejs/node#52285 * chore: handle updated filenames - nodejs/node#51999 - nodejs/node#51927 * chore: bump node in DEPS to v20.13.1 * events: extract addAbortListener for safe internal use nodejs/node#52081 * module: print location of unsettled top-level await in entry points nodejs/node#51999 * fs: add stacktrace to fs/promises nodejs/node#49849 * chore: update patches --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
1 parent 10fd0ba commit 653d0f0

File tree

36 files changed

+139
-447
lines changed

36 files changed

+139
-447
lines changed

DEPS

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

lib/browser/init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ delete process.appCodeLoaded;
200200
if (packagePath) {
201201
// Finally load app's main.js and transfer control to C++.
202202
if ((packageJson.type === 'module' && !mainStartupScript.endsWith('.cjs')) || mainStartupScript.endsWith('.mjs')) {
203-
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
203+
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
204204
const main = (require('url') as typeof url).pathToFileURL(path.join(packagePath, mainStartupScript));
205-
loadESM(async (esmLoader: any) => {
205+
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
206206
try {
207-
await esmLoader.import(main.toString(), undefined, Object.create(null));
207+
await cascadedLoader.import(main.toString(), undefined, Object.create(null));
208208
appCodeLoaded!();
209209
} catch (err) {
210210
appCodeLoaded!();

lib/node/asar-fs-wrapper.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
494494
};
495495

496496
const { access } = fs;
497-
fs.access = function (pathArgument: string, mode: any, callback: any) {
497+
fs.access = function (pathArgument: string, mode: number, callback: any) {
498498
const pathInfo = splitPath(pathArgument);
499499
if (!pathInfo.isAsar) return access.apply(this, arguments);
500500
const { asarPath, filePath } = pathInfo;
@@ -539,7 +539,16 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
539539
nextTick(callback);
540540
};
541541

542-
fs.promises.access = util.promisify(fs.access);
542+
const { access: accessPromise } = fs.promises;
543+
fs.promises.access = function (pathArgument: string, mode: number) {
544+
const pathInfo = splitPath(pathArgument);
545+
if (!pathInfo.isAsar) {
546+
return accessPromise.apply(this, arguments);
547+
}
548+
549+
const p = util.promisify(fs.access);
550+
return p(pathArgument, mode);
551+
};
543552

544553
const { accessSync } = fs;
545554
fs.accessSync = function (pathArgument: string, mode: any) {

lib/renderer/init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ if (cjsPreloads.length) {
150150
}
151151
}
152152
if (esmPreloads.length) {
153-
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
153+
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
154154

155-
loadESM(async (esmLoader: any) => {
155+
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
156156
// Load the preload scripts.
157157
for (const preloadScript of esmPreloads) {
158-
await esmLoader.import(pathToFileURL(preloadScript).toString(), undefined, Object.create(null)).catch((err: Error) => {
158+
await cascadedLoader.import(pathToFileURL(preloadScript).toString(), undefined, Object.create(null)).catch((err: Error) => {
159159
console.error(`Unable to load preload script: ${preloadScript}`);
160160
console.error(err);
161161

lib/utility/init.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ parentPort.on('removeListener', (name: string) => {
3636
});
3737

3838
// Finally load entry script.
39-
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
39+
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
4040
const mainEntry = pathToFileURL(entryScript);
41-
loadESM(async (esmLoader: any) => {
41+
42+
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
4243
try {
43-
await esmLoader.import(mainEntry.toString(), undefined, Object.create(null));
44+
await cascadedLoader.import(mainEntry.toString(), undefined, Object.create(null));
4445
} catch (err) {
4546
// @ts-ignore internalBinding is a secret internal global that we shouldn't
4647
// really be using, so we ignore the type error instead of declaring it in types

patches/node/.patches

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ test_make_test-node-output-v8-warning_generic.patch
4242
test_match_wpt_streams_transferable_transform-stream-members_any_js.patch
4343
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
4444
fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch
45-
src_preload_function_for_environment.patch
4645
deprecate_vector_v8_local_in_v8.patch
4746
fix_remove_deprecated_errno_constants.patch
4847
build_enable_perfetto.patch

patches/node/build_add_gn_build_files.patch

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,10 @@ index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c7
537537
cflags_c = [
538538
"-mavx512vl",
539539
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
540-
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..1717143998ae15e65e9af12650b796226508a137 100644
540+
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..3f253daee0f9b1faa50857f61d76de001bd8947e 100644
541541
--- a/deps/cares/BUILD.gn
542542
+++ b/deps/cares/BUILD.gn
543-
@@ -1,14 +1,165 @@
543+
@@ -1,14 +1,163 @@
544544
-##############################################################################
545545
-# #
546546
-# DO NOT EDIT THIS FILE! #
@@ -587,7 +587,6 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..1717143998ae15e65e9af12650b79622
587587
+ "src/lib/ares__llist.c",
588588
+ "src/lib/ares__llist.h",
589589
+ "src/lib/ares__parse_into_addrinfo.c",
590-
+ "src/lib/ares__read_line.c",
591590
+ "src/lib/ares__slist.c",
592591
+ "src/lib/ares__slist.h",
593592
+ "src/lib/ares__socket.c",
@@ -635,7 +634,6 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..1717143998ae15e65e9af12650b79622
635634
+ "src/lib/ares_library_init.c",
636635
+ "src/lib/ares_ipv6.h",
637636
+ "src/lib/ares_math.c",
638-
+ "src/lib/ares_mkquery.c",
639637
+ "src/lib/ares_options.c",
640638
+ "src/lib/ares_parse_a_reply.c",
641639
+ "src/lib/ares_parse_aaaa_reply.c",
@@ -1258,7 +1256,7 @@ index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1
12581256
+}
12591257
diff --git a/filenames.json b/filenames.json
12601258
new file mode 100644
1261-
index 0000000000000000000000000000000000000000..424b6f4f9d89c43a2c0404d1a5cb03828f29d906
1259+
index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e112101ec
12621260
--- /dev/null
12631261
+++ b/filenames.json
12641262
@@ -0,0 +1,739 @@
@@ -1532,6 +1530,7 @@ index 0000000000000000000000000000000000000000..424b6f4f9d89c43a2c0404d1a5cb0382
15321530
+ "lib/internal/error_serdes.js",
15331531
+ "lib/internal/errors.js",
15341532
+ "lib/internal/event_target.js",
1533+
+ "lib/internal/events/abort_listener.js",
15351534
+ "lib/internal/events/symbols.js",
15361535
+ "lib/internal/file.js",
15371536
+ "lib/internal/fixed_queue.js",
@@ -1568,7 +1567,6 @@ index 0000000000000000000000000000000000000000..424b6f4f9d89c43a2c0404d1a5cb0382
15681567
+ "lib/internal/modules/esm/fetch_module.js",
15691568
+ "lib/internal/modules/esm/formats.js",
15701569
+ "lib/internal/modules/esm/get_format.js",
1571-
+ "lib/internal/modules/esm/handle_process_exit.js",
15721570
+ "lib/internal/modules/esm/hooks.js",
15731571
+ "lib/internal/modules/esm/initialize_import_meta.js",
15741572
+ "lib/internal/modules/esm/load.js",
@@ -1603,7 +1601,6 @@ index 0000000000000000000000000000000000000000..424b6f4f9d89c43a2c0404d1a5cb0382
16031601
+ "lib/internal/policy/manifest.js",
16041602
+ "lib/internal/policy/sri.js",
16051603
+ "lib/internal/priority_queue.js",
1606-
+ "lib/internal/process/esm_loader.js",
16071604
+ "lib/internal/process/execution.js",
16081605
+ "lib/internal/process/per_thread.js",
16091606
+ "lib/internal/process/permission.js",
@@ -1781,6 +1778,7 @@ index 0000000000000000000000000000000000000000..424b6f4f9d89c43a2c0404d1a5cb0382
17811778
+ "src/handle_wrap.cc",
17821779
+ "src/heap_utils.cc",
17831780
+ "src/histogram.cc",
1781+
+ "src/internal_only_v8.cc",
17841782
+ "src/js_native_api.h",
17851783
+ "src/js_native_api_types.h",
17861784
+ "src/js_native_api_v8.cc",
@@ -2365,7 +2363,7 @@ index 0000000000000000000000000000000000000000..9be3ac447f9a4dde23fefc26e0b922b4
23652363
+ transformed_f.write(transformed_contents)
23662364
+
23672365
diff --git a/tools/install.py b/tools/install.py
2368-
index 17b0947aaca4cd63ce6b57ffc4835eae7f74e76e..c6fa8a931f6a1357592a8447b1abbfe0c894aefd 100755
2366+
index b132c7bf26c02886a7ab341a1973bf449744ba0f..171b383a4b6c2528d11dd5f89a6837fd071bcf4b 100755
23692367
--- a/tools/install.py
23702368
+++ b/tools/install.py
23712369
@@ -284,6 +284,7 @@ def headers(options, action):
@@ -2388,7 +2386,7 @@ index 17b0947aaca4cd63ce6b57ffc4835eae7f74e76e..c6fa8a931f6a1357592a8447b1abbfe0
23882386
diff --git a/tools/js2c.cc b/tools/js2c.cc
23892387
old mode 100644
23902388
new mode 100755
2391-
index 0fa9c5954d24a555a1e7c50fdb4b43c17cb1452d..9a77af51630aec5437a09aae1d7296e2e1238809
2389+
index e0f3d8844718ab8a6478c40ff713c1fd6bcff95a..c73a5b666dbaf555c749d836c20a7ae19a840847
23922390
--- a/tools/js2c.cc
23932391
+++ b/tools/js2c.cc
23942392
@@ -30,6 +30,7 @@ namespace js2c {

patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

Lines changed: 7 additions & 7 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 292cd621dd6d2a6bfcbf959c5910563446492fd9..722b4c3d376ce6eaa683397b693f9bad8f2aa584 100644
10+
index 096cb79db88ce65c3cc57111feb673f37cfd3bb1..a2b0c2a12160b1f59379c552b30b91c3ee65cc12 100644
1111
--- a/common.gypi
1212
+++ b/common.gypi
13-
@@ -86,6 +86,8 @@
13+
@@ -87,6 +87,8 @@
1414
'v8_use_perfetto': 0,
1515
'tsan%': 0,
1616

@@ -19,15 +19,15 @@ index 292cd621dd6d2a6bfcbf959c5910563446492fd9..722b4c3d376ce6eaa683397b693f9bad
1919
##### end V8 defaults #####
2020

2121
# When building native modules using 'npm install' with the system npm,
22-
@@ -285,6 +287,7 @@
22+
@@ -286,6 +288,7 @@
2323
# Defines these mostly for node-gyp to pickup.
2424
'defines': [
2525
'_GLIBCXX_USE_CXX11_ABI=1',
2626
+ 'ELECTRON_ENSURE_CONFIG_GYPI',
2727
],
2828

2929
# Forcibly disable -Werror. We support a wide range of compilers, it's
30-
@@ -391,6 +394,11 @@
30+
@@ -415,6 +418,11 @@
3131
}],
3232
],
3333
}],
@@ -40,10 +40,10 @@ index 292cd621dd6d2a6bfcbf959c5910563446492fd9..722b4c3d376ce6eaa683397b693f9bad
4040
# list in v8/BUILD.gn.
4141
['v8_enable_v8_checks == 1', {
4242
diff --git a/configure.py b/configure.py
43-
index 00c8513d6820ec862bffb06063e9b1ae27d6043d..8169c674d672b7206b3765bcbf68cde04ba2d915 100755
43+
index 11c0df455451d4ab4bea066a8361246cbf10bf1d..c30052f02f97df78e0d9294784cb3efb3fd2d1a7 100755
4444
--- a/configure.py
4545
+++ b/configure.py
46-
@@ -1496,6 +1496,7 @@ def configure_library(lib, output, pkgname=None):
46+
@@ -1501,6 +1501,7 @@ def configure_library(lib, output, pkgname=None):
4747

4848

4949
def configure_v8(o):
@@ -52,7 +52,7 @@ index 00c8513d6820ec862bffb06063e9b1ae27d6043d..8169c674d672b7206b3765bcbf68cde0
5252
o['variables']['v8_enable_javascript_promise_hooks'] = 1
5353
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
5454
diff --git a/src/node.h b/src/node.h
55-
index 13e29b98d0c91badee41b53c37b4763f73e02e87..16c3ad349e942b83764c7772178baa5057cd64f3 100644
55+
index c267ed1eeaa2d8b6ecd5a1563a4e9440bf0cca00..e55256996f2c85b0ae3854cbd1b83ca88a3e22cb 100644
5656
--- a/src/node.h
5757
+++ b/src/node.h
5858
@@ -22,6 +22,12 @@

patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ in.
1010
This should be upstreamed.
1111

1212
diff --git a/common.gypi b/common.gypi
13-
index 722b4c3d376ce6eaa683397b693f9bad8f2aa584..b003ddf5763a0f5c3289a7ff39d71f3d828b73db 100644
13+
index a2b0c2a12160b1f59379c552b30b91c3ee65cc12..0c0ac7920f00ed1a1561f17fa7cfe9a127f02820 100644
1414
--- a/common.gypi
1515
+++ b/common.gypi
16-
@@ -133,6 +133,7 @@
16+
@@ -134,6 +134,7 @@
1717
['target_arch in "arm ia32 mips mipsel ppc"', {
1818
'v8_enable_pointer_compression': 0,
1919
'v8_enable_31bit_smis_on_64bit_arch': 0,
@@ -22,10 +22,10 @@ index 722b4c3d376ce6eaa683397b693f9bad8f2aa584..b003ddf5763a0f5c3289a7ff39d71f3d
2222
['target_arch in "ppc64 s390x"', {
2323
'v8_enable_backtrace': 1,
2424
diff --git a/configure.py b/configure.py
25-
index 8169c674d672b7206b3765bcbf68cde04ba2d915..ac5990cf48703ae2e10ad86915aacdad25206f0e 100755
25+
index c30052f02f97df78e0d9294784cb3efb3fd2d1a7..5fb89e56fde52d01b3806ec4e8549cbeb5ffca66 100755
2626
--- a/configure.py
2727
+++ b/configure.py
28-
@@ -1510,6 +1510,7 @@ def configure_v8(o):
28+
@@ -1515,6 +1515,7 @@ def configure_v8(o):
2929
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
3030
o['variables']['v8_enable_maglev'] = 1 if options.v8_enable_maglev else 0
3131
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0

patches/node/build_only_create_cppgc_heap_on_non-32_bit_platforms.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ index 2ce1e8a7dcca2ba153d387d11970c72b5f43c167..590303d1b78e2c28d7c3338196b12fcf
3333
node_platform = "win32"
3434
} else if (target_os == "mac") {
3535
diff --git a/src/env.cc b/src/env.cc
36-
index 9f83720fefc77342dd45cdf1eebfac613262ad63..309b39fb2b1116824c0c1c2ae86d8e1113e31c3d 100644
36+
index 5c75e5b99d9415163640ab90f5891c0fee067a88..5f8bb37d117d82123b81f5f4b32735150184fa74 100644
3737
--- a/src/env.cc
3838
+++ b/src/env.cc
3939
@@ -557,7 +557,8 @@ IsolateData::IsolateData(Isolate* isolate,

0 commit comments

Comments
 (0)