chore: bump node to v22.15.0 (35-x-y) (#46740)

* chore: bump node in DEPS to v22.15.0

* inspector: fix GN build

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

* test: search cctest files

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

* crypto: fix missing OPENSSL_NO_ENGINE guard

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

* test,crypto: make tests work for BoringSSL

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

* module: use synchronous hooks for preparsing in import(cjs)

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

* deps: update simdjson to 3.12.0

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

* build: remove explicit linker call to libm on macOS

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

* test: make eval snapshot comparison more flexible

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

* src: allow embedder customization of OOMErrorHandler

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

* src: do not pass nullptr to std::string ctor

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

* build: fix GN build failure

* build: fix patch indices

* crypto: expose security levels

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

* zlib: add zstd support

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

* test: move crypto related common utilities in common/crypto

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

* test: disable test-https-client-renegotiation-limit

BoringSSL doesn't support caller-initiated renegotiation - see
https://source.chromium.org/chromium/chromium/src/+/main:third_party/boringssl/src/ssl/ssl_lib.cc;l=1627-1631

* chore: fixup indices

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
electron-roller[bot]
2025-05-13 21:56:52 +09:00
committed by GitHub
parent b8712a35db
commit a2fc9689d2
39 changed files with 231 additions and 477 deletions

2
DEPS
View File

@@ -4,7 +4,7 @@ vars = {
'chromium_version':
'134.0.6998.205',
'node_version':
'v22.14.0',
'v22.15.0',
'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version':

View File

@@ -6,10 +6,10 @@ Subject: build: allow electron to use exec_script
This is similar to the //build usecase so we're OK adding ourselves here
diff --git a/.gn b/.gn
index 3f6571828197301361ebde2e19e8e3138597c276..9effa81a564c3d2afae3eb2bb7438635e45f124a 100644
index 3f6571828197301361ebde2e19e8e3138597c276..a33cf302ce24385ce8c92a094a36a39346919793 100644
--- a/.gn
+++ b/.gn
@@ -172,4 +172,26 @@ exec_script_allowlist =
@@ -172,4 +172,27 @@ exec_script_allowlist =
"//tools/grit/grit_rule.gni",
"//tools/gritsettings/BUILD.gn",
@@ -34,5 +34,6 @@ index 3f6571828197301361ebde2e19e8e3138597c276..9effa81a564c3d2afae3eb2bb7438635
+ "//third_party/electron_node/deps/sqlite/unofficial.gni",
+ "//third_party/electron_node/deps/uv/unofficial.gni",
+ "//third_party/electron_node/deps/uvwasi/unofficial.gni",
+ "//third_party/electron_node/deps/zstd/unofficial.gni",
+ "//third_party/electron_node/src/inspector/unofficial.gni",
]

View File

@@ -39,12 +39,9 @@ test_use_static_method_names_in_call_stacks.patch
build_use_third_party_simdutf.patch
fix_remove_fastapitypedarray_usage.patch
test_handle_explicit_resource_management_globals.patch
build_remove_explicit_linker_call_to_libm_on_macos.patch
linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch
build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch
test_make_eval_snapshot_tests_more_flexible.patch
build_option_to_use_custom_inspector_protocol_path.patch
feat_add_oom_error_callback_in_node_isolatesettings.patch
fix_ensure_traverseparent_bails_on_resource_path_exit.patch
zlib_fix_pointer_alignment.patch
fix_expose_readfilesync_override_for_modules.patch

View File

@@ -54,71 +54,11 @@ index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3f
}
assert(!node_enable_inspector || node_use_openssl,
diff --git a/src/inspector/unofficial.gni b/src/inspector/unofficial.gni
index 5d87f3c901ab509e534598ed1eb0796a96355b5e..3d7aa148678b2646b88fa7c32abec91791b02b82 100644
--- a/src/inspector/unofficial.gni
+++ b/src/inspector/unofficial.gni
@@ -13,7 +13,7 @@ template("inspector_gn_build") {
}
node_gen_dir = get_label_info("../..", "target_gen_dir")
- protocol_tool_path = "../../tools/inspector_protocol"
+ protocol_tool_path = "../../deps/inspector_protocol"
gypi_values = exec_script(
"../../tools/gypi_to_gn.py",
@@ -35,6 +35,8 @@ template("inspector_gn_build") {
]
args = [
+ "--inspector_protocol_dir",
+ rebase_path(protocol_tool_path, root_build_dir),
"--jinja_dir",
# jinja is in third_party.
rebase_path("//third_party/", root_build_dir),
@@ -72,4 +74,37 @@ template("inspector_gn_build") {
outputs = [ "$node_gen_dir/src/{{source_name_part}}.json" ]
args = [ "{{source}}" ] + rebase_path(outputs, root_build_dir)
}
+
+ config("crdtp_config") {
+ include_dirs = [ protocol_tool_path ]
+ }
+
+ static_library("crdtp") {
+ public_configs = [ ":crdtp_config" ]
+ sources = [
+ "$protocol_tool_path/crdtp/cbor.cc",
+ "$protocol_tool_path/crdtp/cbor.h",
+ "$protocol_tool_path/crdtp/dispatch.cc",
+ "$protocol_tool_path/crdtp/dispatch.h",
+ "$protocol_tool_path/crdtp/error_support.cc",
+ "$protocol_tool_path/crdtp/error_support.h",
+ "$protocol_tool_path/crdtp/export.h",
+ "$protocol_tool_path/crdtp/find_by_first.h",
+ "$protocol_tool_path/crdtp/frontend_channel.h",
+ "$protocol_tool_path/crdtp/glue.h",
+ "$protocol_tool_path/crdtp/json.cc",
+ "$protocol_tool_path/crdtp/json.h",
+ "$protocol_tool_path/crdtp/parser_handler.h",
+ "$protocol_tool_path/crdtp/protocol_core.cc",
+ "$protocol_tool_path/crdtp/protocol_core.h",
+ "$protocol_tool_path/crdtp/serializable.cc",
+ "$protocol_tool_path/crdtp/serializable.h",
+ "$protocol_tool_path/crdtp/span.cc",
+ "$protocol_tool_path/crdtp/span.h",
+ "$protocol_tool_path/crdtp/status.cc",
+ "$protocol_tool_path/crdtp/status.h",
+ "$protocol_tool_path/crdtp/json_platform.cc",
+ "$protocol_tool_path/crdtp/json_platform.h",
+ ]
+ }
}
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 894fd515202cc3a1f933c2bbc618dd09869ad904..4f1ed661e9c432f3b50f2e7e348ad9794ff773d0 100644
index e85860de93dd5753dd4542ecee9f0888af93898a..04eab49c368c8f86837ed2c1384bf3c63e4bde24 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -781,6 +781,7 @@ void BuiltinLoader::RegisterExternalReferences(
@@ -783,6 +783,7 @@ void BuiltinLoader::RegisterExternalReferences(
registry->Register(GetNatives);
RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@@ -298,7 +238,7 @@ index 21992cbe894a880e3223c379326b62db22f2f12d..1296a5457422099035ba34f2b02624f2
} // namespace js2c
} // namespace node
diff --git a/tools/search_files.py b/tools/search_files.py
index 65d0e1be42f0a85418491ebb548278cf431aa6a0..d4a31342f1c6107b029394c6e1d00a1d1e877e03 100755
index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd17a16c20b 100755
--- a/tools/search_files.py
+++ b/tools/search_files.py
@@ -14,6 +14,7 @@ if __name__ == '__main__':
@@ -306,14 +246,19 @@ index 65d0e1be42f0a85418491ebb548278cf431aa6a0..d4a31342f1c6107b029394c6e1d00a1d
files = SearchFiles(*sys.argv[2:])
files = [ os.path.relpath(x, sys.argv[1]) for x in files ]
+ files = [os.path.normpath(x).replace(os.sep, '/') for x in files]
print('\n'.join(files))
except Exception as e:
print(str(e))
# Apply the same transform in SearchFiles after relpath
if sys.platform == 'win32':
files = [ x.replace('\\', '/') for x in files ]
diff --git a/unofficial.gni b/unofficial.gni
index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5aeab1340d 100644
index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50ae50a3d8 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -145,6 +145,7 @@ template("node_gn_build") {
@@ -142,32 +142,39 @@ template("node_gn_build") {
public_configs = [
":node_external_config",
"deps/googletest:googletest_config",
+ ":zstd_include_config"
]
public_deps = [
"deps/ada",
"deps/uv",
@@ -321,7 +266,11 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a
"deps/simdjson",
"$node_v8_path",
]
@@ -156,7 +157,6 @@ template("node_gn_build") {
deps = [
":run_node_js2c",
- "deps/brotli",
"deps/cares",
"deps/histogram",
"deps/llhttp",
"deps/nbytes",
"deps/nghttp2",
@@ -329,7 +278,13 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a
"deps/postject",
"deps/sqlite",
"deps/uvwasi",
@@ -165,7 +165,11 @@ template("node_gn_build") {
- "deps/zstd",
"//third_party/zlib",
+ "//third_party/brotli:dec",
+ "//third_party/brotli:enc",
+ "//third_party/zstd:decompress",
+ "//third_party/zstd:headers",
"$node_simdutf_path",
"$node_v8_path:v8_libplatform",
]
@@ -341,7 +296,7 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a
"$target_gen_dir/node_javascript.cc",
] + gypi_values.node_sources
@@ -185,11 +189,12 @@ template("node_gn_build") {
@@ -190,7 +197,7 @@ template("node_gn_build") {
}
if (node_use_openssl) {
deps += [ "deps/ncrypto" ]
@@ -350,12 +305,18 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a
sources += gypi_values.node_crypto_sources
}
if (node_enable_inspector) {
deps += [
+ "src/inspector:crdtp",
"src/inspector:node_protocol_generated_sources",
"src/inspector:v8_inspector_compress_protocol_json",
]
@@ -282,6 +287,7 @@ template("node_gn_build") {
@@ -214,6 +221,10 @@ template("node_gn_build") {
}
}
+ config("zstd_include_config") {
+ include_dirs = [ "//third_party/zstd/src/lib" ]
+ }
+
executable(target_name) {
forward_variables_from(invoker, "*")
@@ -288,6 +299,7 @@ template("node_gn_build") {
}
executable("node_js2c") {
@@ -363,7 +324,7 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a
deps = [
"deps/uv",
"$node_simdutf_path",
@@ -292,26 +298,75 @@ template("node_gn_build") {
@@ -298,26 +310,75 @@ template("node_gn_build") {
"src/embedded_data.cc",
"src/embedded_data.h",
]
@@ -449,7 +410,7 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a
outputs = [ "$target_gen_dir/node_javascript.cc" ]
# Get the path to node_js2c executable of the host toolchain.
@@ -325,11 +380,11 @@ template("node_gn_build") {
@@ -331,11 +392,11 @@ template("node_gn_build") {
get_label_info(":node_js2c($host_toolchain)", "name") +
host_executable_suffix

View File

@@ -14,10 +14,10 @@ We don't need to do this for zlib, as the existing gn workflow uses the same
Upstreamed at https://github.com/nodejs/node/pull/55903
diff --git a/unofficial.gni b/unofficial.gni
index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d26c4db206 100644
index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f756b2e34a 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -153,7 +153,6 @@ template("node_gn_build") {
@@ -155,7 +155,6 @@ template("node_gn_build") {
":run_node_js2c",
"deps/cares",
"deps/histogram",
@@ -25,7 +25,7 @@ index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d2
"deps/nbytes",
"deps/nghttp2",
"deps/postject",
@@ -184,7 +183,17 @@ template("node_gn_build") {
@@ -191,7 +190,17 @@ template("node_gn_build") {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
@@ -44,7 +44,7 @@ index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d2
if (v8_enable_i18n_support) {
deps += [ "//third_party/icu" ]
}
@@ -212,6 +221,19 @@ template("node_gn_build") {
@@ -219,6 +228,19 @@ template("node_gn_build") {
sources += node_inspector.node_inspector_sources +
node_inspector.node_inspector_generated_sources
}
@@ -63,4 +63,4 @@ index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d2
+ }
}
executable(target_name) {
config("zstd_include_config") {

View File

@@ -14,7 +14,7 @@ error: duplicate symbol: crdtp::ProtocolTypeTraits<std::__Cr::basic_string<char,
Some distinguishing change should be upstreamed to Node.js.
diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc
index d83c53c81ca7745a31b200d5af3656af59f4f530..b2f6d412415e2988ead3c1e25b9557e1f0c91de3 100644
index 6db4bee1072bfe911a4179c3edb2bbaf18f1a182..c603f95f1f93438bd55bce3ff7f5bb314eb33666 100644
--- a/src/inspector/node_string.cc
+++ b/src/inspector/node_string.cc
@@ -7,7 +7,8 @@
@@ -44,7 +44,7 @@ index d83c53c81ca7745a31b200d5af3656af59f4f530..b2f6d412415e2988ead3c1e25b9557e1
namespace inspector {
namespace protocol {
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
index d529d1337be0e2292202920446e841701d16b0b7..08e00f9b94918e3385aed18de80eec5c7ad81095 100644
index 38cf96e874dcc49cde87137b2737c35a84f418d0..b2f67c224acc7b3a3b867867e251a7c62833f46e 100644
--- a/src/inspector/node_string.h
+++ b/src/inspector/node_string.h
@@ -15,8 +15,8 @@ namespace crdtp {

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.
diff --git a/common.gypi b/common.gypi
index 755bd203173a69564be203ad58c33eb50680b204..a7a0ffde7209de51ffcbf0db0ed7efcf09ad606d 100644
index 53016fc79c3d914982abeb61bf0a76181024e2bf..99b147482b636706b1372b89298f35b60ca2bb31 100644
--- a/common.gypi
+++ b/common.gypi
@@ -518,7 +518,7 @@
@@ -530,7 +530,7 @@
'-fno-rtti',
'-fno-exceptions',
'-fno-strict-aliasing',
@@ -22,7 +22,7 @@ index 755bd203173a69564be203ad58c33eb50680b204..a7a0ffde7209de51ffcbf0db0ed7efcf
],
'defines': [ '__STDC_FORMAT_MACROS' ],
'ldflags': [ '-rdynamic' ],
@@ -688,7 +688,7 @@
@@ -700,7 +700,7 @@
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',

View File

@@ -64,10 +64,10 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
module.exports = {
diff --git a/node.gyp b/node.gyp
index d97004c8e148be6b63634dad5306756d503fb1f8..271fb4f76bc1e69baad0b1fafca128b3bca4a360 100644
index ec1f90b73f7d119b2c0e0207a5e36f3cec7295e9..66244b6638e34536aed397f56c6a4570a73e9b90 100644
--- a/node.gyp
+++ b/node.gyp
@@ -174,7 +174,6 @@
@@ -175,7 +175,6 @@
'src/timers.cc',
'src/timer_wrap.cc',
'src/tracing/agent.cc',
@@ -75,7 +75,7 @@ index d97004c8e148be6b63634dad5306756d503fb1f8..271fb4f76bc1e69baad0b1fafca128b3
'src/tracing/node_trace_writer.cc',
'src/tracing/trace_event.cc',
'src/tracing/traced_value.cc',
@@ -302,7 +301,6 @@
@@ -303,7 +302,6 @@
'src/tcp_wrap.h',
'src/timers.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.
diff --git a/common.gypi b/common.gypi
index 5d74876ab28f8c10bb9543f7652478514414d8d2..755bd203173a69564be203ad58c33eb50680b204 100644
index f2a45f0f0bbfce93e61d3696a18425af4d022a00..53016fc79c3d914982abeb61bf0a76181024e2bf 100644
--- a/common.gypi
+++ b/common.gypi
@@ -86,6 +86,8 @@
@@ -88,6 +88,8 @@
'v8_use_perfetto': 0,
'tsan%': 0,
@@ -19,7 +19,7 @@ index 5d74876ab28f8c10bb9543f7652478514414d8d2..755bd203173a69564be203ad58c33eb5
##### end V8 defaults #####
# When building native modules using 'npm install' with the system npm,
@@ -291,6 +293,7 @@
@@ -293,6 +295,7 @@
# Defines these mostly for node-gyp to pickup.
'defines': [
'_GLIBCXX_USE_CXX11_ABI=1',
@@ -27,7 +27,7 @@ index 5d74876ab28f8c10bb9543f7652478514414d8d2..755bd203173a69564be203ad58c33eb5
],
# Forcibly disable -Werror. We support a wide range of compilers, it's
@@ -437,6 +440,11 @@
@@ -449,6 +452,11 @@
}],
],
}],
@@ -40,10 +40,10 @@ index 5d74876ab28f8c10bb9543f7652478514414d8d2..755bd203173a69564be203ad58c33eb5
# list in v8/BUILD.gn.
['v8_enable_v8_checks == 1', {
diff --git a/configure.py b/configure.py
index 712ed40f77e54d52d5b3c52bb68e2b7d48879812..6bcb7450975636b5dbc689470663ee37903874d5 100755
index 95faeeef3867cbf3ca4b1857d893aa127d550a2f..b36f63a5482074f79a20709b8c4774cb6dadec52 100755
--- a/configure.py
+++ b/configure.py
@@ -1644,6 +1644,7 @@ def configure_library(lib, output, pkgname=None):
@@ -1698,6 +1698,7 @@ def configure_library(lib, output, pkgname=None):
def configure_v8(o, configs):
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)
@@ -52,7 +52,7 @@ index 712ed40f77e54d52d5b3c52bb68e2b7d48879812..6bcb7450975636b5dbc689470663ee37
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 7726d3de1e82689655e8fceb4135eec303498572..120e3a1042e29590cbbf4be258a1cd2d3d4f0043 100644
index 8b77f7cb4d53105f42ba76d99a76a98b7a73789f..bdc77f8eb7abffa9e6c98cd254daedad3e44b981 100644
--- a/src/node.h
+++ b/src/node.h
@@ -22,6 +22,12 @@

View File

@@ -34,7 +34,7 @@ index 411eab8136d5957ae8a491bc38ffbdc88e59f5da..63c93b5be09692d0d4b6bfbb214b173b
let kResistStopPropagation;
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 4f1ed661e9c432f3b50f2e7e348ad9794ff773d0..16c95348ee254061d5c48f405968c1b0ee33bf82 100644
index 04eab49c368c8f86837ed2c1384bf3c63e4bde24..c3d2b3c90c206dd81a3d8aa6c14fdf4678a1cddd 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -34,6 +34,7 @@ using v8::Value;

View File

@@ -39,10 +39,10 @@ index d8aacbdf1a8fc858c792ad3ce17ca2f46baebe7e..4625008c048532c2c3340130670647d2
void HandleDouble(double value) override {
diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h
index 08e00f9b94918e3385aed18de80eec5c7ad81095..e84281c0e06f1d09889c5e1f2b2c5144f1b77564 100644
index b2f67c224acc7b3a3b867867e251a7c62833f46e..a17b12a17518259e243cb176e1fbdc11ce63c78d 100644
--- a/src/inspector/node_string.h
+++ b/src/inspector/node_string.h
@@ -63,7 +63,7 @@ class Binary {
@@ -66,7 +66,7 @@ class Binary {
static Binary fromBase64(const std::string_view base64, bool* success) {
UNREACHABLE();
}
@@ -65,10 +65,10 @@ index 3d7aa148678b2646b88fa7c32abec91791b02b82..4810d93eb971b253f7dadff7011a632f
gypi_values = exec_script(
"../../tools/gypi_to_gn.py",
diff --git a/unofficial.gni b/unofficial.gni
index cd0eae52ca9bf244e43643a2034fa9d26c4db206..d61a9bd5f4f0c92682f10b449976735859ecbc55 100644
index a8ce18acfe333350f91b3e5f235db5f756b2e34a..6bcc40b282543fc40f80c5c6659de658209844b8 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -204,13 +204,14 @@ template("node_gn_build") {
@@ -211,13 +211,14 @@ template("node_gn_build") {
}
if (node_enable_inspector) {
deps += [

View File

@@ -1,59 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Mon, 3 Feb 2025 21:44:36 +0900
Subject: build: remove explicit linker call to libm on macOS
/usr/lib/libm.tbd is available via libSystem.*.dylib and
reexports sanitizer symbols. When building for asan
this becomes an issue as the linker will resolve the symbols
from the system library rather from libclang_rt.*
For V8 that rely on specific version of these symbols
that get bundled as part of clang, for ex:
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/cppgc/platform.cc;l=93-97
accepting nullptr for shadow_offset in `asan_get_shadow_mapping`,
linking to system version that doesn't support this will lead to
a crash.
Clang driver eventually links with `-lSystem`
https://github.com/llvm/llvm-project/blob/e82f93890daefeb38fe2a22ee3db87a89948ec57/clang/lib/Driver/ToolChains/Darwin.cpp#L1628-L1631,
this is done after linking the sanitizer libraries which
ensures right order of resolution for the symbols.
PR-URL: https://github.com/nodejs/node/pull/56901
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
diff --git a/deps/brotli/unofficial.gni b/deps/brotli/unofficial.gni
index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb7512e34863e 100644
--- a/deps/brotli/unofficial.gni
+++ b/deps/brotli/unofficial.gni
@@ -25,7 +25,7 @@ template("brotli_gn_build") {
} else if (target_os == "freebsd") {
defines = [ "OS_FREEBSD" ]
}
- if (!is_win) {
+ if (is_linux) {
libs = [ "m" ]
}
if (is_clang || !is_win) {
diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni
index 348d2f0703e47ca7c5326a4b4c1d6ae31157eeb5..0944d6ddd241b113970ab6aa5804f9534fde882a 100644
--- a/deps/uv/unofficial.gni
+++ b/deps/uv/unofficial.gni
@@ -87,11 +87,11 @@ template("uv_gn_build") {
]
}
if (is_posix) {
- libs = [ "m" ]
ldflags = [ "-pthread" ]
}
if (is_linux) {
- libs += [
+ libs = [
+ "m",
"dl",
"rt",
]

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.
diff --git a/common.gypi b/common.gypi
index a7a0ffde7209de51ffcbf0db0ed7efcf09ad606d..20fd68eeb878b51f361d72070d87338db3d9a8d4 100644
index 99b147482b636706b1372b89298f35b60ca2bb31..5024e5fb0aee210f4986572638a523db6d26b4cc 100644
--- a/common.gypi
+++ b/common.gypi
@@ -125,6 +125,7 @@
@@ -127,6 +127,7 @@
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
}],
['OS=="mac"', {

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.
diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h
index f21cd9381eef59ec43502c796fcaddb1b96525f5..e691fd24aa24d225f8c00fa5638be07265bfeeab 100644
index c1535ee81300b9cb93eb9ee6e769246793f936c3..3350287401e181e1d4ee432b8bd16081d0d7a73e 100644
--- a/deps/simdjson/simdjson.h
+++ b/deps/simdjson/simdjson.h
@@ -3654,12 +3654,17 @@ inline std::ostream& operator<<(std::ostream& out, simdjson_result<padded_string
@@ -3837,12 +3837,17 @@ inline std::ostream& operator<<(std::ostream& out, simdjson_result<padded_string
} // namespace simdjson
@@ -22,9 +22,9 @@ index f21cd9381eef59ec43502c796fcaddb1b96525f5..e691fd24aa24d225f8c00fa5638be072
+#pragma clang diagnostic ignored "-Wdeprecated-literal-operator"
+
// This is deliberately outside of simdjson so that people get it without having to use the namespace
inline simdjson::padded_string operator "" _padded(const char *str, size_t len);
inline simdjson::padded_string operator ""_padded(const char *str, size_t len);
#ifdef __cpp_char8_t
inline simdjson::padded_string operator "" _padded(const char8_t *str, size_t len);
inline simdjson::padded_string operator ""_padded(const char8_t *str, size_t len);
#endif
+#pragma clang diagnostic pop
@@ -32,17 +32,17 @@ index f21cd9381eef59ec43502c796fcaddb1b96525f5..e691fd24aa24d225f8c00fa5638be072
namespace simdjson {
namespace internal {
@@ -4037,6 +4042,9 @@ inline simdjson_result<padded_string> padded_string::load(std::string_view filen
@@ -4242,6 +4247,9 @@ inline simdjson_result<padded_string> padded_string::load(std::string_view filen
} // namespace simdjson
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-literal-operator"
+
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);
}
@@ -4045,6 +4053,8 @@ inline simdjson::padded_string operator "" _padded(const char8_t *str, size_t le
@@ -4250,6 +4258,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);
}
#endif
@@ -51,10 +51,3 @@ index f21cd9381eef59ec43502c796fcaddb1b96525f5..e691fd24aa24d225f8c00fa5638be072
#endif // SIMDJSON_PADDED_STRING_INL_H
/* end file simdjson/padded_string-inl.h */
/* skipped duplicate #include "simdjson/padded_string_view.h" */
@@ -118292,4 +118302,4 @@ namespace simdjson {
/* end file simdjson/ondemand.h */
#endif // SIMDJSON_H
-/* end file simdjson.h */
+/* end file simdjson.h */
\ No newline at end of file

View File

@@ -11,7 +11,7 @@ its own blended handler between Node and Blink.
Not upstreamable.
diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js
index 99061e62976e7cb24be81e8632b0e21d1e9adf9a..bbc9311c059e8ab0328c5f92b21a6be57620717e 100644
index fd17ce8695c55f8f38ed19d59960acc1a7692bc8..96754db3277b3a0445b69275368602166c6d5423 100644
--- a/lib/internal/modules/esm/utils.js
+++ b/lib/internal/modules/esm/utils.js
@@ -30,7 +30,7 @@ const {
@@ -23,7 +23,7 @@ index 99061e62976e7cb24be81e8632b0e21d1e9adf9a..bbc9311c059e8ab0328c5f92b21a6be5
const {
loadPreloadModules,
initializeFrozenIntrinsics,
@@ -274,12 +274,13 @@ let _forceDefaultLoader = false;
@@ -280,12 +280,13 @@ let _forceDefaultLoader = false;
* @param {boolean} [forceDefaultLoader=false] - A boolean indicating disabling custom loaders.
*/
function initializeESM(forceDefaultLoader = false) {
@@ -40,10 +40,10 @@ index 99061e62976e7cb24be81e8632b0e21d1e9adf9a..bbc9311c059e8ab0328c5f92b21a6be5
/**
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 649ec428e2dd6fbf0082b3f1ba9fdfbfab892a94..168912fe6ede3b71ab3029c292ba430915fd79d8 100644
index 912acc8da815405531d8b527383f19c3731be100..8d48f4693c3b5f0d1d94d3edadc48c4f36d1bf97 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -832,7 +832,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
@@ -858,7 +858,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
return module->module_.Get(isolate);
}
@@ -52,7 +52,7 @@ index 649ec428e2dd6fbf0082b3f1ba9fdfbfab892a94..168912fe6ede3b71ab3029c292ba4309
Local<Context> context,
Local<Data> host_defined_options,
Local<Value> resource_name,
@@ -897,12 +897,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
@@ -923,12 +923,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
Realm* realm = Realm::GetCurrent(args);
HandleScope handle_scope(isolate);
@@ -68,7 +68,7 @@ index 649ec428e2dd6fbf0082b3f1ba9fdfbfab892a94..168912fe6ede3b71ab3029c292ba4309
}
void ModuleWrap::HostInitializeImportMetaObjectCallback(
@@ -944,13 +945,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
@@ -970,13 +971,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
Realm* realm = Realm::GetCurrent(args);
Isolate* isolate = realm->isolate();

View File

@@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 8105592764abca6036e8e029ca9b6a32402e7156..431a6aa7a2cf4d537cb719f15c2749254e0433b3 100644
index 1b42c5a7f4715e56fa5bc39cd6f78a76473406f2..114b7bbf6b1e105fc1696ed8a064065db73ff519 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -3270,7 +3270,6 @@ V8 options that are allowed are:
@@ -3350,7 +3350,6 @@ V8 options that are allowed are:
* `--disallow-code-generation-from-strings`
* `--enable-etw-stack-walking`
* `--expose-gc`
@@ -30,10 +30,10 @@ index 8105592764abca6036e8e029ca9b6a32402e7156..431a6aa7a2cf4d537cb719f15c274925
* `--jitless`
* `--max-old-space-size`
diff --git a/src/node_options.cc b/src/node_options.cc
index 620776c06d835eb1bfeed060751c570e8d435b29..866f2a39a5e51a8bf434ccd54d76c685bcdd1502 100644
index b22fbb0a285f6f323779d6ebb2b027a3990b031e..54b253aa54f5cdebdb04315f9c6c2506977555c0 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -980,11 +980,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
@@ -984,11 +984,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"disallow eval and friends",
V8Option{},
kAllowedInEnvvar);
@@ -46,10 +46,10 @@ index 620776c06d835eb1bfeed060751c570e8d435b29..866f2a39a5e51a8bf434ccd54d76c685
"disable runtime allocation of executable memory",
V8Option{},
diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js
index b1d5c44ceeeebc674938d85736aace2a6ef570e2..9e89200e9f6dfd89340cd04afb76e271ffc82b54 100644
index c5d74f40e7894980b45713c77cc36f836be73528..53bca572c3405c0357f868aae71fc2c82d973c04 100644
--- a/test/parallel/test-cli-node-options.js
+++ b/test/parallel/test-cli-node-options.js
@@ -73,7 +73,6 @@ if (common.hasCrypto) {
@@ -76,7 +76,6 @@ if (common.hasCrypto) {
expect('--abort_on-uncaught_exception', 'B\n');
expect('--disallow-code-generation-from-strings', 'B\n');
expect('--expose-gc', 'B\n');

View File

@@ -9,7 +9,7 @@ modules to sandboxed renderers.
TODO(codebytere): remove and replace with a public facing API.
diff --git a/src/node_binding.cc b/src/node_binding.cc
index c2ef9b36d5b2967c798c123b6cbbd099b15c2791..b5c0a93d83ab4d4f6792d0eb648e7198de874bcf 100644
index 6c337232149ccb8bdb1188e72d59a052b1cb79c1..44ad4a480a33a2c39494a7d961318270a25620d8 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -653,6 +653,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {

View File

@@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yang Liu <ouyangliu.leo@gmail.com>
Date: Wed, 5 Mar 2025 17:22:39 +0800
Subject: feat: add oom_error_callback in node::IsolateSettings
Expose v8::OOMErrorCallback to allow setting OOM error handler outside Node.js
As described in this issue https://github.com/electron/electron/issues/45894,
Electron fails to capture js heap oom because node::OOMErrorHandler just
terminates the process without raising an exception.
To fix this issue, provide the interface oom_error_callback to enable a
custom oom error callback set from Electron.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index fc9b056d2f7e25109100fbde5f3ab0aebc8c619a..9b155213ce301df7e396a4a113992499fc7e9910 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -241,7 +241,10 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
auto* fatal_error_cb = s.fatal_error_callback ?
s.fatal_error_callback : OnFatalError;
isolate->SetFatalErrorHandler(fatal_error_cb);
- isolate->SetOOMErrorHandler(OOMErrorHandler);
+
+ auto* oom_error_cb = s.oom_error_callback ?
+ s.oom_error_callback : OOMErrorHandler;
+ isolate->SetOOMErrorHandler(oom_error_cb);
if ((s.flags & SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK) == 0) {
auto* prepare_stack_trace_cb = s.prepare_stack_trace_callback ?
diff --git a/src/node.h b/src/node.h
index afb26ec5690ccd65a3c36f8b8a1b2de416b9d843..98ad0ea649eaef43d1f5231f7bc4044e100e08d7 100644
--- a/src/node.h
+++ b/src/node.h
@@ -489,6 +489,7 @@ struct IsolateSettings {
v8::Isolate::AbortOnUncaughtExceptionCallback
should_abort_on_uncaught_exception_callback = nullptr;
v8::FatalErrorCallback fatal_error_callback = nullptr;
+ v8::OOMErrorCallback oom_error_callback = nullptr;
v8::PrepareStackTraceCallback prepare_stack_trace_callback = nullptr;
// Miscellaneous callbacks

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.
diff --git a/common.gypi b/common.gypi
index 62f26bb07d27a02aedf18fdd1191b282f9340cac..5d74876ab28f8c10bb9543f7652478514414d8d2 100644
index 372409f4b09cc3b3be9809f697816498e5c021fe..f2a45f0f0bbfce93e61d3696a18425af4d022a00 100644
--- a/common.gypi
+++ b/common.gypi
@@ -88,6 +88,23 @@
@@ -90,6 +90,23 @@
##### end V8 defaults #####

View File

@@ -53,10 +53,10 @@ index 2879e5cf541fb4d226cfd7cc0fe367ca448fb926..03082f0ec4f91382933eec48e77331cd
const maybeMain = resolvedOption <= legacyMainResolveExtensionsIndexes.kResolvedByMainIndexNode ?
packageConfig.main || './' : '';
diff --git a/src/node_file.cc b/src/node_file.cc
index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5ae8bc1db 100644
index a492b3aa113c4e1d50cc42721bd5eb58380a6264..c7915e2c8161a5d0fa05ccce368ce9c44345c05d 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -3220,13 +3220,25 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo<Value>& args) {
@@ -3237,13 +3237,25 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo<Value>& args) {
}
BindingData::FilePathIsFileReturnType BindingData::FilePathIsFile(
@@ -83,7 +83,7 @@ index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5
uv_fs_t req;
int rc = uv_fs_stat(env->event_loop(), &req, file_path.c_str(), nullptr);
@@ -3284,6 +3296,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
@@ -3301,6 +3313,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
std::optional<std::string> initial_file_path;
std::string file_path;
@@ -95,7 +95,7 @@ index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5
if (args.Length() >= 2 && args[1]->IsString()) {
auto package_config_main = Utf8Value(isolate, args[1]).ToString();
@@ -3304,7 +3321,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
@@ -3321,7 +3338,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
BufferValue buff_file_path(isolate, local_file_path);
ToNamespacedPath(env, &buff_file_path);
@@ -104,7 +104,7 @@ index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5
case BindingData::FilePathIsFileReturnType::kIsFile:
return args.GetReturnValue().Set(i);
case BindingData::FilePathIsFileReturnType::kIsNotFile:
@@ -3341,7 +3358,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
@@ -3358,7 +3375,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
BufferValue buff_file_path(isolate, local_file_path);
ToNamespacedPath(env, &buff_file_path);

View File

@@ -44,10 +44,10 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480
let filename = call.getFileName();
const line = call.getLineNumber() - 1;
diff --git a/src/node_options.cc b/src/node_options.cc
index 3608ab2b4aeb09e985ca98e23f2dff23567ade71..620776c06d835eb1bfeed060751c570e8d435b29 100644
index 23cb558a22b4462f5ce4f74833d25c7f712f8139..b22fbb0a285f6f323779d6ebb2b027a3990b031e 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -1527,14 +1527,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
@@ -1535,14 +1535,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
}
Isolate* isolate = args.GetIsolate();

View File

@@ -11,7 +11,7 @@ before it's acceptable to upstream, as this patch comments out a couple
of tests that upstream probably cares about.
diff --git a/test/common/index.js b/test/common/index.js
index 92c7294e6f6298f511b5a289e1e0e3a4be68cc77..63a350c5ed912a785b042a238c064c98ed423af4 100644
index 8f5af57a83dc6b426f1b11bd2e3a8c6c0f2d9a85..f6e00c9f3f3ac4b42662eed6c8d190586f92ab99 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -56,6 +56,8 @@ const hasCrypto = Boolean(process.versions.openssl) &&
@@ -23,7 +23,7 @@ index 92c7294e6f6298f511b5a289e1e0e3a4be68cc77..63a350c5ed912a785b042a238c064c98
function parseTestFlags(filename = process.argv[1]) {
// The copyright notice is relatively big and the flags could come afterwards.
const bytesToRead = 1500;
@@ -889,6 +891,7 @@ const common = {
@@ -901,6 +903,7 @@ const common = {
mustNotMutateObjectDeep,
mustSucceed,
nodeProcessAborted,
@@ -294,24 +294,6 @@ index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..a18aeb2bdffcc7a7e9ef12328b849994
});
// No-pad encrypted string should return the same:
diff --git a/test/parallel/test-crypto-prime.js b/test/parallel/test-crypto-prime.js
index 5ffdc1394282be046150e3759f82f8787f5604f7..e1c7a7b4824a2df20a405355696022398216fa4f 100644
--- a/test/parallel/test-crypto-prime.js
+++ b/test/parallel/test-crypto-prime.js
@@ -259,11 +259,11 @@ for (const checks of [-(2 ** 31), -1, 2 ** 31, 2 ** 32 - 1, 2 ** 32, 2 ** 50]) {
bytes[0] = 0x1;
assert.throws(() => checkPrime(bytes, common.mustNotCall()), {
code: 'ERR_OSSL_BN_BIGNUM_TOO_LONG',
- message: /bignum too long/
+ message: /bignum[_ ]too[_ ]long/i
});
assert.throws(() => checkPrimeSync(bytes), {
code: 'ERR_OSSL_BN_BIGNUM_TOO_LONG',
- message: /bignum too long/
+ message: /bignum[_ ]too[_ ]long/i
});
}
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js
index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d754b8d01 100644
--- a/test/parallel/test-crypto-rsa-dsa.js
@@ -353,10 +335,10 @@ index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d
// DSA signatures vary across runs so there is no static string to verify
diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js
index 338a19b0e88ad6f08d2f6b6a5d38b9980996ce11..a4ee215575d072450ba66c558ddca88bfb23d85f 100644
index 03a18c7522531c7317f12705550117dc389a0245..2f0f46f2c6ddc62de89877cfa0ca80949a0f4c5e 100644
--- a/test/parallel/test-crypto-scrypt.js
+++ b/test/parallel/test-crypto-scrypt.js
@@ -178,7 +178,7 @@ for (const options of bad) {
@@ -176,7 +176,7 @@ for (const options of bad) {
for (const options of toobig) {
const expected = {
@@ -599,6 +581,49 @@ index 6f88e81e9ff29defe73800fc038b0d96d1ebd846..c0b92e2bdf86d3d2638c973f8be3110d
};
// Create TLS1.2 server
diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js
index cba5bebaa29b6f8ac4fd0fcedaadb2f7bb3eb321..019d95df499892b14ab088f99013ee32c432779c 100644
--- a/test/parallel/test-tls-alert-handling.js
+++ b/test/parallel/test-tls-alert-handling.js
@@ -35,7 +35,7 @@ let iter = 0;
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.library, 'SSL routines');
- if (!hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record');
- assert.strictEqual(err.reason, expectedErrorReason);
+ if (!hasOpenSSL3 && !common.openSSLIsBoringSSL) assert.strictEqual(err.function, 'ssl3_get_record');
+ assert.match(err.reason, expectedErrorReason);
errorReceived = true;
if (canCloseServer())
server.close();
@@ -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.library, 'SSL routines');
- if (!hasOpenSSL3)
+ if (!hasOpenSSL3 && !common.openSSLIsBoringSSL)
assert.strictEqual(err.function, 'ssl3_read_bytes');
- assert.strictEqual(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

View File

@@ -19,10 +19,10 @@ index c9d4a3536d0f60375ae623b48ca2fa7095c88d42..d818320fbbc430d06a0c2852e4723981
context = { __proto__: context, source };
}
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 0caba80bb213e0edfb1f834250f895ccc05d0d1c..6feab19d24a3524e36c5ed3bbac53cba0fa298c7 100644
index 49aacb6262502ced54e817f99dd596db85b9659c..f9f065bb743275e9b2ce71375e6a9f06e00c0f36 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -286,6 +286,9 @@ function cjsPreparseModuleExports(filename, source) {
@@ -291,6 +291,9 @@ function cjsPreparseModuleExports(filename, source, isMain, format) {
if (module && module[kModuleExportNames] !== undefined) {
return { module, exportNames: module[kModuleExportNames] };
}

View File

@@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules`
binding.
diff --git a/src/env_properties.h b/src/env_properties.h
index 9f89823170782242093bc5ee0df6a2a2ef5b919f..b9374ee1acceb3d0aab51c6c5ae6a79be1cc71a9 100644
index ba8c80ff2842c63f16cae51cfa8084617bb35bf5..820aebd18d22bcef4992b09ffc8924e9b758fd3e 100644
--- a/src/env_properties.h
+++ b/src/env_properties.h
@@ -478,6 +478,7 @@
@@ -485,6 +485,7 @@
V(maybe_cache_generated_source_map, v8::Function) \
V(messaging_deserialize_create_object, v8::Function) \
V(message_port, v8::Object) \

View File

@@ -70,19 +70,19 @@ index bfd9bd3d127404de1cbb6f30c43ab0342590759d..9e7d8ef0adef3b68a3ec186e4b218f59
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
index a587246e329b41f33a3fdfe5ef92910915911611..1b94d923b6d83cc7806d793497a4f9f978c5938c 100644
index 7dcd7afe8ce3c25ceb314cdf15c330f3d66eb84f..4445bcc4c4c6c6f87ac45e693012a18a93739f9b 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -182,7 +182,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
@@ -186,7 +186,7 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul
const { exportNames, module } = cjsPreparseModuleExports(filename, source);
const { exportNames, module } = cjsPreparseModuleExports(filename, source, isMain, format);
cjsCache.set(url, module);
- const namesWithDefault = exportNames.has('default') ?
+ const namesWithDefault = filename === 'electron' ? ['default', ...Object.keys(module.exports)] : exportNames.has('default') ?
[...exportNames] : ['default', ...exportNames];
if (isMain) {
@@ -204,8 +204,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
@@ -208,8 +208,8 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul
({ exports } = module);
}
for (const exportName of exportNames) {
@@ -93,8 +93,8 @@ index a587246e329b41f33a3fdfe5ef92910915911611..1b94d923b6d83cc7806d793497a4f9f9
continue;
}
// We might trigger a getter -> dont fail.
@@ -239,6 +239,10 @@ translators.set('require-commonjs', (url, source, isMain) => {
return createCJSModuleWrap(url, source);
@@ -243,6 +243,10 @@ translators.set('require-commonjs', (url, source, isMain) => {
return createCJSModuleWrap(url, source, isMain, 'commonjs');
});
+translators.set('electron', () => {

View File

@@ -238,20 +238,10 @@ index d94f6e1c82c4a62547b3b395f375c86ce4deb5de..b81b9005365272217c77e2b9289bd9f8
X509View ca(sk_X509_value(peer_certs.get(), i));
if (!cert->view().isIssuedBy(ca)) continue;
diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
index c89d591c6804ab7d41199d61452d10d12cdf7398..05740c7dc599954bca0779b8c8d6bd615183288a 100644
index a054e4c1285208c9ba8b9679c284f459f1ace690..3de8ef4fafcdbdc2cb0ce31de162663d5272340f 100644
--- a/src/crypto/crypto_context.cc
+++ b/src/crypto/crypto_context.cc
@@ -26,7 +26,9 @@ using ncrypto::BIOPointer;
using ncrypto::ClearErrorOnReturn;
using ncrypto::CryptoErrorList;
using ncrypto::DHPointer;
+#ifndef OPENSSL_NO_ENGINE
using ncrypto::EnginePointer;
+#endif // !OPENSSL_NO_ENGINE
using ncrypto::EVPKeyPointer;
using ncrypto::MarkPopErrorOnReturn;
using ncrypto::SSLPointer;
@@ -105,7 +107,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
@@ -123,7 +123,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
// the CA certificates.
SSL_CTX_clear_extra_chain_certs(ctx);
@@ -260,7 +250,7 @@ index c89d591c6804ab7d41199d61452d10d12cdf7398..05740c7dc599954bca0779b8c8d6bd61
X509* ca = sk_X509_value(extra_certs, i);
// NOTE: Increments reference count on `ca`
@@ -931,11 +933,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
@@ -1584,11 +1584,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
// If the user specified "auto" for dhparams, the JavaScript layer will pass
// true to this function instead of the original string. Any other string
// value will be interpreted as custom DH parameters below.
@@ -274,7 +264,7 @@ index c89d591c6804ab7d41199d61452d10d12cdf7398..05740c7dc599954bca0779b8c8d6bd61
DHPointer dh;
{
BIOPointer bio(LoadBIO(env, args[0]));
@@ -1161,7 +1164,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
@@ -1814,7 +1815,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
}
// Add CA certs too
@@ -416,7 +406,7 @@ index 471fee77531139ce988292470dff443fdfb05b07..931f7c2ae3d7e12afce471545d610d22
return EVPKeyCtxPointer();
diff --git a/src/crypto/crypto_keys.cc b/src/crypto/crypto_keys.cc
index f66c57b1079af6cd040dc6d11e72f353507b75e5..abd2bccb9669e06dd8355f66220f8b06c8e863dc 100644
index b38a9a377738fd5fe6cc89c3a27c403bf6a97715..0cd43c2005b431e180b7483cb89825a75e1fe03f 100644
--- a/src/crypto/crypto_keys.cc
+++ b/src/crypto/crypto_keys.cc
@@ -949,6 +949,7 @@ void KeyObjectHandle::GetAsymmetricKeyType(
@@ -469,20 +459,20 @@ index 05a3882c7e17d78e27aabb29891aa250789a47c0..1f2fccce6ed8f14525557644e0bdd130
if (target
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f7268d89c 100644
index 7c548d32b40365343f0e208c3aa856a1c847f4c3..6346f8f7199cf7b7d3736c59571606fff102fbb6 100644
--- a/src/crypto/crypto_util.cc
+++ b/src/crypto/crypto_util.cc
@@ -29,7 +29,9 @@ namespace node {
using ncrypto::BignumPointer;
using ncrypto::BIOPointer;
using ncrypto::CryptoErrorList;
+#ifndef OPENSSL_NO_ENGINE
using ncrypto::EnginePointer;
+#endif // !OPENSSL_NO_ENGINE
using ncrypto::EVPKeyCtxPointer;
using v8::ArrayBuffer;
using v8::BackingStore;
@@ -502,24 +504,15 @@ Maybe<void> Decorate(Environment* env,
@@ -207,7 +207,8 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo<v8::Value>& args) {
void GetOpenSSLSecLevelCrypto(const FunctionCallbackInfo<Value>& args) {
// for BoringSSL assume the same as the default
- int sec_level = OPENSSL_TLS_SECURITY_LEVEL;
+ // value of OPENSSL_TLS_SECURITY_LEVEL.
+ int sec_level = 1;
#ifndef OPENSSL_IS_BORINGSSL
Environment* env = Environment::GetCurrent(args);
@@ -527,24 +528,15 @@ Maybe<void> Decorate(Environment* env,
V(BIO) \
V(PKCS7) \
V(X509V3) \
@@ -508,7 +498,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f
V(USER) \
#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
@@ -661,7 +654,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -686,7 +678,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsUint32());
Environment* env = Environment::GetCurrent(args);
uint32_t len = args[0].As<Uint32>()->Value();
@@ -517,7 +507,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f
if (data == nullptr) {
// There's no memory available for the allocation.
// Return nothing.
@@ -672,7 +665,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -697,7 +689,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
data,
len,
[](void* data, size_t len, void* deleter_data) {
@@ -526,7 +516,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f
},
data);
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
@@ -680,10 +673,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -705,10 +697,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
}
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
@@ -540,7 +530,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f
} // namespace
diff --git a/src/env.h b/src/env.h
index 1239cbdbf2d375a50ada37ee0ed5592c751d4c5c..aed066852d7c257076cc7ca8b173fd2a3a353a00 100644
index b6bdff9b8580d2588a39f00b594c4c480157d78a..cfe917c797a6e4bb0f0284ec56be82637f840129 100644
--- a/src/env.h
+++ b/src/env.h
@@ -50,7 +50,7 @@
@@ -552,7 +542,7 @@ index 1239cbdbf2d375a50ada37ee0ed5592c751d4c5c..aed066852d7c257076cc7ca8b173fd2a
#include <openssl/evp.h>
#endif
@@ -1071,7 +1071,7 @@ class Environment final : public MemoryRetainer {
@@ -1073,7 +1073,7 @@ class Environment final : public MemoryRetainer {
kExitInfoFieldCount
};
@@ -562,7 +552,7 @@ index 1239cbdbf2d375a50ada37ee0ed5592c751d4c5c..aed066852d7c257076cc7ca8b173fd2a
// We declare another alias here to avoid having to include crypto_util.h
using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>;
diff --git a/src/node_metadata.h b/src/node_metadata.h
index c59e65ad1fe3fac23f1fc25ca77e6133d1ccaccd..f2f07434e076e2977755ef7dac7d489aedb760b0 100644
index 6f8cb433ff8059c63d5cf16c8783139ae92fbf61..603ac3dde7d1a1109afbc451b69c8d0935b81641 100644
--- a/src/node_metadata.h
+++ b/src/node_metadata.h
@@ -6,7 +6,7 @@
@@ -575,7 +565,7 @@ index c59e65ad1fe3fac23f1fc25ca77e6133d1ccaccd..f2f07434e076e2977755ef7dac7d489a
#if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h>
diff --git a/src/node_options.cc b/src/node_options.cc
index 1d81079a9b7d8a69ad2d87835090be88ae507bd8..3608ab2b4aeb09e985ca98e23f2dff23567ade71 100644
index 1444acd59d42f64831cead5f153419f7c12a88bf..23cb558a22b4462f5ce4f74833d25c7f712f8139 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -6,7 +6,7 @@
@@ -588,7 +578,7 @@ index 1d81079a9b7d8a69ad2d87835090be88ae507bd8..3608ab2b4aeb09e985ca98e23f2dff23
#endif
diff --git a/src/node_options.h b/src/node_options.h
index 621f5eca96b10685734a39e56cce7cee6c8a25bf..41dd04f5e2b1cd54c32df70830389d44d7b39aa2 100644
index e68a41b60832c4b000e17dd15ce16c1bdaf4b54b..065457acfde6ba4d04ed570cc72005cfd2798fd5 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -11,7 +11,7 @@
@@ -600,24 +590,3 @@ index 621f5eca96b10685734a39e56cce7cee6c8a25bf..41dd04f5e2b1cd54c32df70830389d44
#include "openssl/opensslv.h"
#endif
diff --git a/unofficial.gni b/unofficial.gni
index a2f3a769ceaa08db6d7438223884dc5aeab1340d..08603eaef2da51fd92f9bf977647b56409eff48c 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -151,7 +151,6 @@ template("node_gn_build") {
]
deps = [
":run_node_js2c",
- "deps/brotli",
"deps/cares",
"deps/histogram",
"deps/llhttp",
@@ -161,6 +160,8 @@ template("node_gn_build") {
"deps/sqlite",
"deps/uvwasi",
"//third_party/zlib",
+ "//third_party/brotli:dec",
+ "//third_party/brotli:enc",
"$node_simdutf_path",
"$node_v8_path:v8_libplatform",
]

View File

@@ -60,7 +60,7 @@ index 9e7d8ef0adef3b68a3ec186e4b218f591aa69266..2879e5cf541fb4d226cfd7cc0fe367ca
});
const { search, hash } = resolved;
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 1b94d923b6d83cc7806d793497a4f9f978c5938c..0caba80bb213e0edfb1f834250f895ccc05d0d1c 100644
index 4445bcc4c4c6c6f87ac45e693012a18a93739f9b..49aacb6262502ced54e817f99dd596db85b9659c 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -24,7 +24,7 @@ const {
@@ -69,10 +69,10 @@ index 1b94d923b6d83cc7806d793497a4f9f978c5938c..0caba80bb213e0edfb1f834250f895cc
const assert = require('internal/assert');
-const { readFileSync } = require('fs');
+const fs = require('fs');
const { dirname, extname, isAbsolute } = require('path');
const { dirname, extname } = require('path');
const {
assertBufferSource,
@@ -268,7 +268,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) {
@@ -272,7 +272,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) {
try {
// We still need to read the FS to detect the exports.
@@ -81,12 +81,3 @@ index 1b94d923b6d83cc7806d793497a4f9f978c5938c..0caba80bb213e0edfb1f834250f895cc
} catch {
// Continue regardless of error.
}
@@ -335,7 +335,7 @@ function cjsPreparseModuleExports(filename, source) {
isAbsolute(resolved)) {
// TODO: this should be calling the `load` hook chain to get the source
// (and fallback to reading the FS only if the source is nullish).
- const source = readFileSync(resolved, 'utf-8');
+ const source = fs.readFileSync(resolved, 'utf-8');
const { exportNames: reexportNames } = cjsPreparseModuleExports(resolved, source);
for (const name of reexportNames) {
exportNames.add(name);

View File

@@ -86,7 +86,7 @@ index 13263149c111beede83b7063fa54f56655aea54c..99068098e1867af4846e18a5d039a256
NODE_DEFINE_CONSTANT(target, ETIMEDOUT);
#endif
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 609601328f7f5ff5f121151e81c2df82e7ef4253..6b9b944c11af917fe4e296961e6ed7df7b89a123 100644
index 5f51add4cdf68a9487edfc9382f586cc94539571..befb642f1effa3c4139e4cd99ff64d9c5175fd72 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -862,10 +862,6 @@ const char* errno_string(int errorno) {

View File

@@ -48,7 +48,7 @@ index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18
static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual));
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe8b747a61 100644
index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee4d8ef8f0 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -44,6 +44,14 @@
@@ -74,7 +74,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe
using v8::FunctionCallbackInfo;
using v8::Global;
using v8::HandleScope;
@@ -582,19 +589,24 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
@@ -586,19 +593,24 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
// Assume caller has properly validated args.
uint32_t FastCopy(Local<Value> receiver,
@@ -107,7 +107,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe
return to_copy;
}
@@ -858,19 +870,17 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
@@ -867,19 +879,17 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
}
int32_t FastCompare(v8::Local<v8::Value>,
@@ -135,7 +135,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe
}
static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare));
@@ -1141,14 +1151,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
@@ -1150,14 +1160,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
}
int32_t FastIndexOfNumber(v8::Local<v8::Value>,
@@ -153,7 +153,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe
}
static v8::CFunction fast_index_of_number(
@@ -1501,21 +1510,31 @@ void SlowWriteString(const FunctionCallbackInfo<Value>& args) {
@@ -1511,21 +1520,31 @@ void SlowWriteString(const FunctionCallbackInfo<Value>& args) {
template <encoding encoding>
uint32_t FastWriteString(Local<Value> receiver,
@@ -194,10 +194,10 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe
static v8::CFunction fast_write_string_ascii(
diff --git a/src/node_external_reference.h b/src/node_external_reference.h
index 8d49a119c218323674e29a522ecf71bd22cdaf1b..d39693f2f45f39e45960453112b0f6460a1b3a4d 100644
index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d46afdce75 100644
--- a/src/node_external_reference.h
+++ b/src/node_external_reference.h
@@ -40,16 +40,16 @@ using CFunctionCallbackWithStrings =
@@ -43,16 +43,16 @@ using CFunctionCallbackWithStrings =
const v8::FastOneByteString& base);
using CFunctionCallbackWithTwoUint8Arrays =
int32_t (*)(v8::Local<v8::Value>,
@@ -219,7 +219,7 @@ index 8d49a119c218323674e29a522ecf71bd22cdaf1b..d39693f2f45f39e45960453112b0f646
uint32_t,
int64_t,
bool);
@@ -68,18 +68,20 @@ using CFunctionWithBool = void (*)(v8::Local<v8::Value>,
@@ -71,18 +71,20 @@ using CFunctionWithBool = void (*)(v8::Local<v8::Value>,
using CFunctionWriteString =
uint32_t (*)(v8::Local<v8::Value> receiver,
@@ -246,7 +246,7 @@ index 8d49a119c218323674e29a522ecf71bd22cdaf1b..d39693f2f45f39e45960453112b0f646
// This class manages the external references from the V8 heap
// to the C++ addresses in Node.js.
diff --git a/src/util.h b/src/util.h
index 0d4676ddade8d91d101b6aeb8763886a234f0bae..7af9ed01a919927ae3897d4989206ec23cfe50d3 100644
index 48d3c7b8a304049cdb4d4ab2c027b300dc533dc0..f9d5a5b36701b3c65fda65ed8920521ff68e32cd 100644
--- a/src/util.h
+++ b/src/util.h
@@ -59,6 +59,7 @@
@@ -257,7 +257,7 @@ index 0d4676ddade8d91d101b6aeb8763886a234f0bae..7af9ed01a919927ae3897d4989206ec2
#ifdef _WIN32
/* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */
@@ -579,6 +580,16 @@ class BufferValue : public MaybeStackBuffer<char> {
@@ -584,6 +585,16 @@ class BufferValue : public MaybeStackBuffer<char> {
static_cast<char*>(name->Buffer()->Data()) + name##_offset; \
if (name##_length > 0) CHECK_NE(name##_data, nullptr);

View File

@@ -11,7 +11,7 @@ This patch can be removed when we upgrade to a V8 version that
contains the above CL.
diff --git a/src/node.cc b/src/node.cc
index f4365c0eda7330bd02a921608951902f41004f77..b2b10ffb572f010992f221de752618fd56b5d50e 100644
index a0f1deadfc58f18f23467889680219360386f9dd..8da5f5344051663f92d72848fbac9d041ac4fac3 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -808,7 +808,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,

View File

@@ -6,10 +6,10 @@ Subject: Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 62c33730ed17cb98b6dd8d69b61360a419518ba5..9b5772fe9b8babbb892c7a5ec79258472da55a76 100644
index 33385fa792b71ea3802904dd3c59ce845342c595..92b368394e17a9257578cd5b7422391689732d6d 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -185,6 +185,13 @@ const {
@@ -200,6 +200,13 @@ const {
CHAR_FORWARD_SLASH,
} = require('internal/constants');
@@ -23,7 +23,7 @@ index 62c33730ed17cb98b6dd8d69b61360a419518ba5..9b5772fe9b8babbb892c7a5ec7925847
const {
isProxy,
} = require('internal/util/types');
@@ -1549,10 +1556,12 @@ Module.prototype._compile = function(content, filename, format) {
@@ -1725,10 +1732,12 @@ Module.prototype._compile = function(content, filename, format) {
if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) {
const { callAndPauseOnStart } = internalBinding('inspector');
result = callAndPauseOnStart(compiledWrapper, thisValue, exports,

View File

@@ -7,10 +7,10 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index f5c0208864084a234a05898e793845681b6e80cc..48d809f61eaf09097acb3e996e956e39cf7b4ef3 100644
index 4fd535f730e6382672b853bf2098b3fefc1f83b4..bd6724de52ee1f01fa42084c7652c71054f0a9c6 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -134,6 +134,10 @@ process.domain = null;
@@ -132,6 +132,10 @@ process.domain = null;
}
process._exiting = false;

View File

@@ -16,7 +16,7 @@ patch:
(cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326)
diff --git a/src/env-inl.h b/src/env-inl.h
index 49c3513ee9b67b407a2bb6609ac89a5959a78cd1..9a8216354e646e86d692b25c2bed5134e267528c 100644
index d4b211dfb2f77a65f311701d95365e66d92f8875..4c1a5f2b92d7fdddb8c2e7bbfd6788fdff3645b9 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const {
@@ -52,7 +52,7 @@ index 49c3513ee9b67b407a2bb6609ac89a5959a78cd1..9a8216354e646e86d692b25c2bed5134
return &(wrapper_data_->cppgc_id);
}
diff --git a/src/env.cc b/src/env.cc
index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f8d20f490 100644
index f8c24e422756d5101a258175a2f28a96648bea47..ddf82c8a18c29c355641e33974c1e5e67867379d 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -23,6 +23,7 @@
@@ -63,7 +63,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f
#include <algorithm>
#include <atomic>
@@ -70,7 +71,6 @@ using v8::TryCatch;
@@ -72,7 +73,6 @@ using v8::TryCatch;
using v8::Uint32;
using v8::Undefined;
using v8::Value;
@@ -71,7 +71,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f
using worker::Worker;
int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64;
@@ -527,6 +527,14 @@ void IsolateData::CreateProperties() {
@@ -529,6 +529,14 @@ void IsolateData::CreateProperties() {
CreateEnvProxyTemplate(this);
}
@@ -86,7 +86,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f
constexpr uint16_t kDefaultCppGCEmbedderID = 0x90de;
Mutex IsolateData::isolate_data_mutex_;
std::unordered_map<uint16_t, std::unique_ptr<PerIsolateWrapperData>>
@@ -564,36 +572,16 @@ IsolateData::IsolateData(Isolate* isolate,
@@ -566,36 +574,16 @@ IsolateData::IsolateData(Isolate* isolate,
v8::CppHeap* cpp_heap = isolate->GetCppHeap();
uint16_t cppgc_id = kDefaultCppGCEmbedderID;
@@ -130,7 +130,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f
{
// GC could still be run after the IsolateData is destroyed, so we store
@@ -625,11 +613,12 @@ IsolateData::~IsolateData() {
@@ -628,11 +616,12 @@ IsolateData::~IsolateData() {
}
}
@@ -146,7 +146,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f
void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
diff --git a/src/env.h b/src/env.h
index aed066852d7c257076cc7ca8b173fd2a3a353a00..1f8dc8f88d40ca95ba13d6517b2b5ed83184e1ce 100644
index cfe917c797a6e4bb0f0284ec56be82637f840129..9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f 100644
--- a/src/env.h
+++ b/src/env.h
@@ -175,10 +175,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
@@ -161,10 +161,10 @@ index aed066852d7c257076cc7ca8b173fd2a3a353a00..1f8dc8f88d40ca95ba13d6517b2b5ed8
inline MultiIsolatePlatform* platform() const;
inline const SnapshotData* snapshot_data() const;
diff --git a/src/node.h b/src/node.h
index 120e3a1042e29590cbbf4be258a1cd2d3d4f0043..afb26ec5690ccd65a3c36f8b8a1b2de416b9d843 100644
index bdc77f8eb7abffa9e6c98cd254daedad3e44b981..98ad0ea649eaef43d1f5231f7bc4044e100e08d7 100644
--- a/src/node.h
+++ b/src/node.h
@@ -1552,24 +1552,14 @@ void RegisterSignalHandler(int signal,
@@ -1553,24 +1553,14 @@ void RegisterSignalHandler(int signal,
bool reset_handler = false);
#endif // _WIN32

View File

@@ -40,10 +40,10 @@ index 0f0cde7be431dcb80c5314b1a9da49886c436d1c..f6d2bd439cad8b9f91c9d9a6cdb302e6
}
HistogramBase* histogram;
diff --git a/src/node_file.cc b/src/node_file.cc
index 3d7e303741a73134e140152bed637fe5ae8bc1db..5e744bc34b9dc364e8f20adfd37ee41d76451170 100644
index c7915e2c8161a5d0fa05ccce368ce9c44345c05d..23347379328794467a497c86cbae0b428b7ba791 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -1061,13 +1061,8 @@ static int32_t FastInternalModuleStat(
@@ -1071,13 +1071,8 @@ static int32_t FastInternalModuleStat(
// NOLINTNEXTLINE(runtime/references) This is V8 api.
FastApiCallbackOptions& options) {
// This needs a HandleScope which needs an isolate.
@@ -60,10 +60,10 @@ index 3d7e303741a73134e140152bed637fe5ae8bc1db..5e744bc34b9dc364e8f20adfd37ee41d
auto path = std::filesystem::path(input.data, input.data + input.length);
diff --git a/src/node_wasi.cc b/src/node_wasi.cc
index 468c2e59903fefe58d9c178d3afac3ef5b09f611..23a376e52e08a8af49dd47c47488552e01287426 100644
index 090866960beb8f1759c99e95536924b8b61fb723..3f91b651b83a20e70d5b368e012f5ee4b9d16092 100644
--- a/src/node_wasi.cc
+++ b/src/node_wasi.cc
@@ -251,17 +251,19 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback(
@@ -275,17 +275,19 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback(
return EinvalError<R>();
}

View File

@@ -7,7 +7,7 @@ This refactors several allocators to allocate within the V8 memory cage,
allowing them to be compatible with the V8_SANDBOXED_POINTERS feature.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index ad323fc800a33c010b0504a4aa55c107498dee26..fc9b056d2f7e25109100fbde5f3ab0aebc8c619a 100644
index 88c2c932a6b045317c83c911b1cd8267b60d9334..7f4f233b26425493a58ce71dfc0c3a92b7c0bef8 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -102,6 +102,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
@@ -64,10 +64,10 @@ index 5387d9625a28bb7d11f7f0f05a5f07d1fee2c216..1b3b8c7b70073926f8dbf02759c2e1af
return Buffer::New(env, ab, 0, ab->ByteLength()).FromMaybe(Local<Value>());
}
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0c8d93af3 100644
index 6346f8f7199cf7b7d3736c59571606fff102fbb6..7eea2eaefcad5780663a6b87985925ae5d70a5f9 100644
--- a/src/crypto/crypto_util.cc
+++ b/src/crypto/crypto_util.cc
@@ -335,10 +335,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept {
@@ -359,10 +359,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept {
return *this;
}
@@ -104,7 +104,7 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0
std::unique_ptr<BackingStore> ptr = ArrayBuffer::NewBackingStore(
allocated_data_,
size(),
@@ -350,10 +375,11 @@ std::unique_ptr<BackingStore> ByteSource::ReleaseToBackingStore() {
@@ -374,10 +399,11 @@ std::unique_ptr<BackingStore> ByteSource::ReleaseToBackingStore() {
data_ = nullptr;
size_ = 0;
return ptr;
@@ -117,7 +117,7 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0
return ArrayBuffer::New(env->isolate(), std::move(store));
}
@@ -650,6 +676,16 @@ namespace {
@@ -674,6 +700,16 @@ namespace {
// in which case this has the same semantics as
// using OPENSSL_malloc. However, if the secure heap is
// initialized, SecureBuffer will automatically use it.
@@ -134,7 +134,7 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0
void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsUint32());
Environment* env = Environment::GetCurrent(args);
@@ -671,6 +707,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -695,6 +731,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
args.GetReturnValue().Set(Uint8Array::New(buffer, 0, len));
}
@@ -143,10 +143,10 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
#ifndef OPENSSL_IS_BORINGSSL
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
index a5967c7d24b8365eb64ab63ec0b3ef8dc23c727e..2acebc3ac2ed9f631fc572f42f19f2e3dccfeb12 100644
index b85c8daeb464097c2e93bdc7ffdfcfe16b76234b..470a0c4adadcd092dd0105c384e87917ac6fe69a 100644
--- a/src/crypto/crypto_util.h
+++ b/src/crypto/crypto_util.h
@@ -241,7 +241,7 @@ class ByteSource {
@@ -242,7 +242,7 @@ class ByteSource {
// Creates a v8::BackingStore that takes over responsibility for
// any allocated data. The ByteSource will be reset with size = 0
// after being called.
@@ -189,7 +189,7 @@ index 3465454e4de4a78912b81e7eca0de395fbe89911..c8ae863460107c69dd77d67c76c11843
Local<Value> ret;
if (!Buffer::New(env, ab, 0, ab->ByteLength()).ToLocal(&ret)) return {};
diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index 0bcf10a0b35accb8d6d5fe9891d4f52b27d40346..606c2021242e6967ea4195af3e2493a7d5745dae 100644
index ea7810e41e2667713a896250dc1b904b0a7cf198..865b3128c1edfe7074769f25a0b87878ca094f31 100644
--- a/src/node_i18n.cc
+++ b/src/node_i18n.cc
@@ -104,7 +104,7 @@ namespace {
@@ -253,7 +253,7 @@ index 382df89a2312f76b5293412a8d51969ae5d9fa9c..1c90da9bbcb9547ab36de4d01088c03f
// Delegate to V8's allocator for compatibility with the V8 memory cage.
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
index 7a70997bc024efa4f3ff4cabe30d5e88dcc7bc78..6552af3ed0acede41c1b16ef77eb359dc54f088a 100644
index c55a2e28066147ae5ca5def10ec76ccc03c634b4..c54183c72944989219b6437c9e571a3f7f3f8dd5 100644
--- a/src/node_serdes.cc
+++ b/src/node_serdes.cc
@@ -29,6 +29,26 @@ using v8::ValueSerializer;

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.
diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status
index fd42444c7b216a4a1fa026efc1bbc1b5df8c7394..26f78764842aaaa781a9409dda2a7d3265351178 100644
index cc99efd7a743d683d5210ad83e258560c28cbd16..b2f0f7fb49665f0dc924cdd3e344c2579d617fbf 100644
--- a/test/parallel/parallel.status
+++ b/test/parallel/parallel.status
@@ -5,6 +5,16 @@ prefix parallel

View File

@@ -1,83 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 12 Feb 2025 21:01:13 +0100
Subject: test: make eval snapshot tests more flexible
Upstreamed in X
diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot
index f6fc803e0e3ec3f6a0c7cd056f42ac860012c907..998a06584b3bf3648e6703774aeb31c07bdb5d0e 100644
--- a/test/fixtures/eval/eval_messages.snapshot
+++ b/test/fixtures/eval/eval_messages.snapshot
@@ -35,7 +35,7 @@ Node.js *
var ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
@@ -43,7 +43,7 @@ Node.js *
var ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
done
diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot
index 66bd506f758ca93906f850a9c773b617745eb834..0382a6ae3ccd792523cc19847bbdeef4d53e1579 100644
--- a/test/fixtures/eval/stdin_messages.snapshot
+++ b/test/fixtures/eval/stdin_messages.snapshot
@@ -40,7 +40,7 @@ Node.js *
let ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
@@ -48,7 +48,7 @@ Node.js *
let ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
done
diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs
index d8c52176b1c3c3a0664d7f6b6750da03aa960587..8a3cc59574206769e4c80a04f05b03586f511ac2 100644
--- a/test/parallel/test-node-output-eval.mjs
+++ b/test/parallel/test-node-output-eval.mjs
@@ -1,6 +1,7 @@
import '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import * as snapshot from '../common/assertSnapshot.js';
+import { basename } from 'node:path';
import { describe, it } from 'node:test';
describe('eval output', { concurrency: true }, () => {
@@ -16,6 +17,7 @@ describe('eval output', { concurrency: true }, () => {
snapshot.replaceNodeVersion,
removeStackTraces,
filterEmptyLines,
+ generalizeProcessName,
);
function removeStackTraces(output) {
@@ -26,6 +28,11 @@ describe('eval output', { concurrency: true }, () => {
return output.replaceAll(/^\s*$/gm, '');
}
+ function generalizeProcessName(output) {
+ const baseName = basename(process.argv0 || 'node', '.exe');
+ return output.replaceAll(`${baseName} --`, '* --');
+ }
+
const tests = [
{ name: 'eval/eval_messages.js' },
{ name: 'eval/stdin_messages.js' },

View File

@@ -16,10 +16,10 @@ a bus error killing node.
see https://github.com/google/brotli/issues/1159
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index 90307cd4984ae5aa55386f2980ad9cd540322dfd..6f12b5034d1a98da50c064cf2cfdf12fc88137eb 100644
index 0b7c47b326c7c5480086228b3d40d54c260ef16a..7e6b38ecd1aa360012c0d73e94412530a48cb8c3 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -493,7 +493,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
@@ -608,7 +608,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
}
static void* AllocForBrotli(void* data, size_t size) {
@@ -29,7 +29,7 @@ index 90307cd4984ae5aa55386f2980ad9cd540322dfd..6f12b5034d1a98da50c064cf2cfdf12f
CompressionStream* ctx = static_cast<CompressionStream*>(data);
char* memory = UncheckedMalloc(size);
if (memory == nullptr) [[unlikely]] {
@@ -502,7 +503,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
@@ -617,7 +618,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
*reinterpret_cast<size_t*>(memory) = size;
ctx->unreported_allocations_.fetch_add(size,
std::memory_order_relaxed);
@@ -38,7 +38,7 @@ index 90307cd4984ae5aa55386f2980ad9cd540322dfd..6f12b5034d1a98da50c064cf2cfdf12f
}
static void FreeForZlib(void* data, void* pointer) {
@@ -510,7 +511,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
@@ -625,7 +626,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
return;
}
CompressionStream* ctx = static_cast<CompressionStream*>(data);

View File

@@ -33,6 +33,7 @@
"parallel/test-http2-https-fallback",
"parallel/test-http2-server-unknown-protocol",
"parallel/test-https-agent-session-reuse",
"parallel/test-https-client-renegotiation-limit",
"parallel/test-https-options-boolean-check",
"parallel/test-icu-env",
"parallel/test-icu-minimum-version",