Skip to content

Commit

Permalink
chore: bump node to v20.17.0 (main) (#43428)
Browse files Browse the repository at this point in the history
* chore: bump node in DEPS to v20.17.0

* module: disallow CJS <-> ESM edges in a cycle from require(esm)

nodejs/node#52264

* src: expose LookupAndCompile with parameters

nodejs/node#53886

* src: fix -Wshadow warning

nodejs/node#53885

* lib: convert WeakMaps in cjs loader with symbol properties

nodejs/node#52095

* src: reduce unnecessary serialization of CLI options in C++

nodejs/node#52451

* build: ensure v8_pointer_compression_sandbox is enabled on 64bit

nodejs/node#53884

* lib: improve error message when index not found on cjs

nodejs/node#53859

* src,lib: expose getCategoryEnabledBuffer to use on node.http

nodejs/node#53602

* deps: update c-ares to v1.32.2

nodejs/node#53865

* chore: fixup patch indices

* deps: update V8 to 12.2

nodejs/node#51362

* stream: Expose DuplexPair API

nodejs/node#34111

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
  • Loading branch information
electron-roller[bot] and codebytere authored Aug 26, 2024
1 parent 7cea992 commit 38512ef
Show file tree
Hide file tree
Showing 36 changed files with 270 additions and 363 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'130.0.6672.0',
'node_version':
'v20.16.0',
'v20.17.0',
'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version':
Expand Down
10 changes: 5 additions & 5 deletions patches/chromium/can_create_window.patch
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ index c576ace24e81cc877aa2595d40e0a13a7af9f6a2..210fb97d44c19c29af424cc7b9cb3169

} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 96d7ba915e3d4248ad801237b0b43ff0b55be1a2..24cf1a2aa6f821c4d5597d98f3bf98a10bd30555 100644
index 96d7ba915e3d4248ad801237b0b43ff0b55be1a2..8da4acbde65e933740a53de1dc45e7c779a688fb 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2245,6 +2245,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,

@@ -2246,6 +2246,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);
+
+ window_features.raw_features = features;

+ window_features.raw_features = features;
+
if (window_features.is_partitioned_popin &&
!IsFeatureEnabled(
mojom::blink::PermissionsPolicyFeature::kPartitionedPopins,
7 changes: 2 additions & 5 deletions patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
support_v8_sandboxed_pointers.patch
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
fix_expose_lookupandcompile_with_parameters.patch
enable_crashpad_linux_node_processes.patch
fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch
chore_expose_importmoduledynamically_and.patch
test_formally_mark_some_tests_as_flaky.patch
fix_adapt_debugger_tests_for_upstream_v8_changes.patch
chore_remove_--no-harmony-atomics_related_code.patch
fix_account_for_createexternalizablestring_v8_global.patch
fix_-wshadow_warning.patch
fix_do_not_resolve_electron_entrypoints.patch
ci_ensure_node_tests_set_electron_run_as_node.patch
fix_assert_module_in_the_renderer_process.patch
Expand All @@ -37,7 +35,6 @@ fix_capture_embedder_exceptions_before_entering_v8.patch
spec_add_iterator_to_global_intrinsics.patch
test_make_test-node-output-v8-warning_generic.patch
test_match_wpt_streams_transferable_transform-stream-members_any_js.patch
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch
deprecate_vector_v8_local_in_v8.patch
fix_remove_deprecated_errno_constants.patch
Expand All @@ -52,6 +49,6 @@ chore_remove_calls_to_v8_functioncallbackinfo_holder.patch
src_do_not_use_soon-to-be-deprecated_v8_api.patch
fix_add_property_query_interceptors.patch
src_account_for_openssl_unexpected_version.patch
windows_32bit_config_change_callback_needs_to_be_stdcall.patch
fix_building_with_unicode.patch
src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch
src_use_supported_api_to_get_stalled_tla_messages.patch
build_don_t_redefine_win32_lean_and_mean.patch
21 changes: 12 additions & 9 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c7
cflags_c = [
"-mavx512vl",
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04b8802321 100644
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..d083aea4cb895d8425041879f1b22a6ee43a0b60 100644
--- a/deps/cares/BUILD.gn
+++ b/deps/cares/BUILD.gn
@@ -1,14 +1,170 @@
@@ -1,14 +1,172 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
Expand All @@ -566,7 +566,6 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04
+ "include/ares_dns.h",
+ "include/ares_dns_record.h",
+ "include/ares_nameser.h",
+ "include/ares_rules.h",
+ "include/ares_version.h",
+ "src/lib/ares__addrinfo2hostent.c",
+ "src/lib/ares__addrinfo_localhost.c",
Expand Down Expand Up @@ -604,6 +603,8 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04
+ "src/lib/ares_data.h",
+ "src/lib/ares_destroy.c",
+ "src/lib/ares_dns_mapping.c",
+ "src/lib/ares_dns_multistring.c",
+ "src/lib/ares_dns_multistring.h",
+ "src/lib/ares_dns_name.c",
+ "src/lib/ares_dns_parse.c",
+ "src/lib/ares_dns_record.c",
Expand Down Expand Up @@ -637,6 +638,7 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04
+ "src/lib/ares_library_init.c",
+ "src/lib/ares_ipv6.h",
+ "src/lib/ares_math.c",
+ "src/lib/ares_metrics.c",
+ "src/lib/ares_options.c",
+ "src/lib/ares_parse_a_reply.c",
+ "src/lib/ares_parse_aaaa_reply.c",
Expand Down Expand Up @@ -673,7 +675,6 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04
+ "src/lib/ares_version.c",
+ "src/lib/inet_net_pton.c",
+ "src/lib/inet_ntop.c",
+ "src/lib/setup_once.h",
+ "src/tools/ares_getopt.c",
+ "src/tools/ares_getopt.h",
+ ]
Expand All @@ -694,6 +695,7 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..087e27424f3997575e4e089a57955d04
+ defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
+ include_dirs += [ "config/win32" ]
+ sources += [
+ "src/lib/ares_sysconfig_win.c",
+ "src/lib/config-win32.h",
+ "src/lib/windows_port.c",
+ ]
Expand Down Expand Up @@ -1263,10 +1265,10 @@ index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..679329d847fbfe303792cab5881287890c9961f4
index 0000000000000000000000000000000000000000..646df853a2b985f14fd66cae6af854977c074706
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,736 @@
@@ -0,0 +1,737 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
Expand Down Expand Up @@ -1636,6 +1638,7 @@ index 0000000000000000000000000000000000000000..679329d847fbfe303792cab588128789
+ "lib/internal/streams/destroy.js",
+ "lib/internal/streams/duplex.js",
+ "lib/internal/streams/duplexify.js",
+ "lib/internal/streams/duplexpair.js",
+ "lib/internal/streams/end-of-stream.js",
+ "lib/internal/streams/from.js",
+ "lib/internal/streams/lazy_transform.js",
Expand Down Expand Up @@ -2221,10 +2224,10 @@ index 909fd14345fcd988c381e640280f4b33f2e0c351..800431e6659f95f0495cb90b8fa2cccb
+ args = rebase_path(inputs + outputs, root_build_dir)
}
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index bbb63df7899d4b9bf80e13eee78453352dd5c75b..804296db12f7864f72648f5f36834a924503e4a6 100644
index 706ea4f5cb90525c8ea56f794320a733c45a193f..c7ae7759595bfc7fdc31dab174a7514ddd8345e7 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -765,6 +765,7 @@ void BuiltinLoader::RegisterExternalReferences(
@@ -773,6 +773,7 @@ void BuiltinLoader::RegisterExternalReferences(
registry->Register(GetNatives);

RegisterExternalReferencesForInternalizedBuiltinCode(registry);
Expand All @@ -2233,7 +2236,7 @@ index bbb63df7899d4b9bf80e13eee78453352dd5c75b..804296db12f7864f72648f5f36834a92

} // namespace builtins
diff --git a/src/node_builtins.h b/src/node_builtins.h
index 75a7f3dd89e096d13ad7d70ed29d301cd56315b5..9a20a275fbe5df9f384b7b1d1d26806e7cd05384 100644
index 1cb85b9058d06555382e565dc32192a9fa48ed9f..cec9be01abd107e8612f70daf19b4834e118ffcf 100644
--- a/src/node_builtins.h
+++ b/src/node_builtins.h
@@ -74,6 +74,8 @@ using BuiltinCodeCacheMap =
Expand Down
36 changes: 36 additions & 0 deletions patches/node/build_don_t_redefine_win32_lean_and_mean.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <[email protected]>
Date: Fri, 23 Aug 2024 16:50:19 +0200
Subject: build: don't redefine WIN32_LEAN_AND_MEAN

https://github.com/nodejs/node/pull/53722 added a new define for WIN32_LEAN_AND_MEAN
without first checking to see if it was defined - other areas in c-ares do this so
we should here as well. Compilation errors occur otherwise:

../../third_party/electron_node/deps/cares/include\ares_build.h(168,11): error: 'WIN32_LEAN_AND_MEAN' macro redefined [-Werror,-Wmacro-redefined]
168 | # define WIN32_LEAN_AND_MEAN
| ^
<command line>(25,9): note: previous definition is here
25 | #define WIN32_LEAN_AND_MEAN 1
| ^
1 error generated.
[287 processes, 49437/51449 @ 48.5/s : 1018.562s] CC obj/third_party/electron_node/deps/cares/cares/ares__socket.obj
FAILED: obj/third_party/electron_node/deps/cares/cares/ares__socket.obj

This should be upstreamed.

diff --git a/deps/cares/include/ares_build.h b/deps/cares/include/ares_build.h
index 18a92606a817145302c73b5081b4c989799bc620..bafd26d9210d2347fec41f028e9e65088b83c48c 100644
--- a/deps/cares/include/ares_build.h
+++ b/deps/cares/include/ares_build.h
@@ -165,7 +165,9 @@
# define CARES_TYPEOF_ARES_SOCKLEN_T int

#elif defined(_WIN32)
-# define WIN32_LEAN_AND_MEAN
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# define CARES_TYPEOF_ARES_SOCKLEN_T int
# define CARES_HAVE_WINDOWS_H 1
# define CARES_HAVE_SYS_TYPES_H 1
6 changes: 3 additions & 3 deletions patches/node/build_enable_perfetto.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ index 8d7204f6cb48f783adc4d1c1eb2de0c83b7fffe2..a154559a56bf383d3c26af523c9bb07b

// Non-alphabetic chars.
diff --git a/lib/internal/http.js b/lib/internal/http.js
index b20b3cd229efcd9701791309361b7d106f315900..6b2820c9dcce5e658b694f53e75d93707c4320d7 100644
index c26c322aafc64ed9ca2a7c1fd703555a251db9de..f94bc5824d6c83fd1feca31c572dcfd3ac130bda 100644
--- a/lib/internal/http.js
+++ b/lib/internal/http.js
@@ -10,8 +10,8 @@ const {
const { setUnrefTimeout } = require('internal/timers');
const { trace, isTraceCategoryEnabled } = internalBinding('trace_events');
const { getCategoryEnabledBuffer, trace } = internalBinding('trace_events');
const {
- CHAR_LOWERCASE_B,
- CHAR_LOWERCASE_E,
Expand All @@ -47,7 +47,7 @@ index b20b3cd229efcd9701791309361b7d106f315900..6b2820c9dcce5e658b694f53e75d9370
} = require('internal/constants');

let utcCache;
@@ -44,11 +44,13 @@ function isTraceHTTPEnabled() {
@@ -46,11 +46,13 @@ function isTraceHTTPEnabled() {
const traceEventCategory = 'node,node.http';

function traceBegin(...args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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.

diff --git a/common.gypi b/common.gypi
index 9a27610992612b59eadcc8e481683cf1e6a5dbb6..1fad20645d059ad5f3efaa9279f582f99cb1006b 100644
index 689e7fb2339253d0f2be3ccf33ecd76660ccf176..8736ad12eec294070a5160a64248044cd16347c9 100644
--- a/common.gypi
+++ b/common.gypi
@@ -87,6 +87,8 @@
Expand All @@ -19,15 +19,15 @@ index 9a27610992612b59eadcc8e481683cf1e6a5dbb6..1fad20645d059ad5f3efaa9279f582f9
##### end V8 defaults #####

# When building native modules using 'npm install' with the system npm,
@@ -286,6 +288,7 @@
@@ -287,6 +289,7 @@
# Defines these mostly for node-gyp to pickup.
'defines': [
'_GLIBCXX_USE_CXX11_ABI=1',
+ 'ELECTRON_ENSURE_CONFIG_GYPI',
],

# Forcibly disable -Werror. We support a wide range of compilers, it's
@@ -415,6 +418,11 @@
@@ -416,6 +419,11 @@
}],
],
}],
Expand All @@ -40,7 +40,7 @@ index 9a27610992612b59eadcc8e481683cf1e6a5dbb6..1fad20645d059ad5f3efaa9279f582f9
# list in v8/BUILD.gn.
['v8_enable_v8_checks == 1', {
diff --git a/configure.py b/configure.py
index f189ba2bf09fc248b3c1ce3c3535b939a4160ad2..2c24db93618f88f5f07e95a3edf63fb7942ac009 100755
index 3084cc964cbe6d02f98d08cd6f847ea7f4a3d0db..5b6a3b62082985debf6ebc4bc09a7d056f58514a 100755
--- a/configure.py
+++ b/configure.py
@@ -1559,6 +1559,7 @@ def configure_library(lib, output, pkgname=None):
Expand All @@ -52,7 +52,7 @@ index f189ba2bf09fc248b3c1ce3c3535b939a4160ad2..2c24db93618f88f5f07e95a3edf63fb7
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
diff --git a/src/node.h b/src/node.h
index c267ed1eeaa2d8b6ecd5a1563a4e9440bf0cca00..e55256996f2c85b0ae3854cbd1b83ca88a3e22cb 100644
index 4f2eb9d0aab88b70c86339e750799080e980d7da..df3fb3372d6357b5d77b4f683e309b8483998128 100644
--- a/src/node.h
+++ b/src/node.h
@@ -22,6 +22,12 @@
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ index f5ecc15159f457cd0b8069c0427b7c758c916c4e..c9ce67391f321989b0af48159b4da3ab
let kResistStopPropagation;

diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 804296db12f7864f72648f5f36834a924503e4a6..2cac503e92640a4683a4be6969f1ed40e42785a0 100644
index c7ae7759595bfc7fdc31dab174a7514ddd8345e7..4bf80aa6cc6385dc376fd0a3538efc27fe5bd0a2 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -35,6 +35,7 @@ using v8::Value;
Expand All @@ -46,10 +46,10 @@ index 804296db12f7864f72648f5f36834a924503e4a6..2cac503e92640a4683a4be6969f1ed40
AddExternalizedBuiltin(
"internal/deps/cjs-module-lexer/lexer",
diff --git a/src/node_builtins.h b/src/node_builtins.h
index 9a20a275fbe5df9f384b7b1d1d26806e7cd05384..a1a9fe7d592f0d57b70dcee8c865b99d71248bf2 100644
index cec9be01abd107e8612f70daf19b4834e118ffcf..3d9c6b962423555257bad4ebaad9ebd821d00042 100644
--- a/src/node_builtins.h
+++ b/src/node_builtins.h
@@ -132,6 +132,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
@@ -138,6 +138,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {

// Generated by tools/js2c.py as node_javascript.cc
void LoadJavaScriptSource(); // Loads data into source_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ This patch is expected to be deleted once we catch up with a Node.js
upgrade that includes the original Node.js commit above.

diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 9ad67e0993da4c3e3f8a14681edbf941cf14e2e6..29ed378d32d452518dc929e60e6038ba4ca38a5c 100644
index ff658ec88e5161cd66536ee6e95dba675b16eccc..9bbb8ab908d8d992abb43254860d51f57f56387b 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -186,8 +186,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
@@ -202,8 +202,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
}

Local<String> source_text = args[2].As<String>();
Expand All @@ -28,7 +28,7 @@ index 9ad67e0993da4c3e3f8a14681edbf941cf14e2e6..29ed378d32d452518dc929e60e6038ba
line_offset,
column_offset,
true, // is cross origin
@@ -394,7 +393,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
@@ -464,7 +463,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {

ShouldNotAbortOnUncaughtScope no_abort_scope(realm->env());
TryCatchScope try_catch(realm->env());
Expand All @@ -37,7 +37,7 @@ index 9ad67e0993da4c3e3f8a14681edbf941cf14e2e6..29ed378d32d452518dc929e60e6038ba
bool timed_out = false;
bool received_signal = false;
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index f9a090f5c3e04403602ba383032e7f3230669a92..3f82db324d406e342abee23ab0d7f7c9807ff652 100644
index 4bf80aa6cc6385dc376fd0a3538efc27fe5bd0a2..3e37aa8b0c9696cceb3f3cfab9721f38c74a2fba 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -267,7 +267,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
of this.

diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 155485dbab0d46bb225fa40e99f555d805659c4f..8183cffe9d7060571c08f696abb7c090e6df3be8 100644
index 364469160af5e348f8890417de16a63c0d1dca67..75d5f58fe02fa8cfa7716ffaf761d567ab403a2c 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1331,6 +1331,13 @@ Module.prototype._compile = function(content, filename) {
@@ -1441,6 +1441,13 @@ Module.prototype._compile = function(content, filename, loadAsESM = false) {
if (getOptionValue('--inspect-brk') && process._eval == null) {
if (!resolvedArgv) {
// We enter the repl if we're not given a filename argument.
Expand All @@ -26,10 +26,10 @@ index 155485dbab0d46bb225fa40e99f555d805659c4f..8183cffe9d7060571c08f696abb7c090
try {
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
index 8fad2fe617e4f8d2364b8c9d3cfb27c265f08b5b..710af646aaf97f88ac2ee003d8f83388ccf9a84f 100644
index 59308ab817fb864a7b84ecf349c9e08d1c710342..8398657065b28a4451b8fe3996e63838a1645314 100644
--- a/lib/internal/process/pre_execution.js
+++ b/lib/internal/process/pre_execution.js
@@ -244,12 +244,14 @@ function patchProcessObject(expandArgv1) {
@@ -245,12 +245,14 @@ function patchProcessObject(expandArgv1) {
if (expandArgv1 && process.argv[1] &&
!StringPrototypeStartsWith(process.argv[1], '-')) {
// Expand process.argv[1] into a full path.
Expand Down
Loading

0 comments on commit 38512ef

Please sign in to comment.