Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit b19d67a

Browse files
codebyterepatchup[bot]
authored andcommitted
chore: upgrade to Node.js v18 (electron#35999)
* chore: update to Node.js v18 * child_process: improve argument validation nodejs/node#41305 * bootstrap: support configure-time user-land snapshot nodejs/node#42466 * chore: update GN patch * src: disambiguate terms used to refer to builtins and addons nodejs/node#44135 * src: use a typed array internally for process._exiting nodejs/node#43883 * chore: lib/internal/bootstrap -> lib/internal/process * src: disambiguate terms used to refer to builtins and addons nodejs/node#44135 * chore: remove redudant browserGlobals patch * chore: update BoringSSL patch * src: allow embedder-provided PageAllocator in NodePlatform nodejs/node#38362 * chore: fixup Node.js crypto tests - nodejs/node#44171 - nodejs/node#41600 * lib: add Promise methods to avoid-prototype-pollution lint rule nodejs/node#43849 * deps: update V8 to 10.1 nodejs/node#42657 * src: add kNoBrowserGlobals flag for Environment nodejs/node#40532 * chore: consolidate asar initialization patches * deps: update V8 to 10.1 nodejs/node#42657 * deps: update V8 to 9.8 nodejs/node#41610 * src,crypto: remove AllocatedBuffers from crypto_spkac nodejs/node#40752 * build: enable V8's shared read-only heap nodejs/node#42809 * src: fix ssize_t error from nghttp2.h nodejs/node#44393 * chore: fixup ESM patch * chore: fixup patch indices * src: merge NativeModuleEnv into NativeModuleLoader nodejs/node#43824 * [API] Pass OOMDetails to OOMErrorCallback https://chromium-review.googlesource.com/c/v8/v8/+/3647827 * src: iwyu in cleanup_queue.cc * src: return Maybe from a couple of functions nodejs/node#39603 * src: clean up embedder API nodejs/node#35897 * src: refactor DH groups to delete crypto_groups.h nodejs/node#43896 * deps,src: use SIMD for normal base64 encoding nodejs/node#39775 * chore: remove deleted source file * chore: update patches * chore: remove deleted source file * lib: add fetch nodejs/node#41749 * chore: remove nonexistent node specs * test: split report OOM tests nodejs/node#44389 * src: trace fs async api nodejs/node#44057 * http: trace http request / response nodejs/node#44102 * test: split test-crypto-dh.js nodejs/node#40451 * crypto: introduce X509Certificate API nodejs/node#36804 * src: split property helpers from node::Environment nodejs/node#44056 * nodejs/node#38905 bootstrap: implement run-time user-land snapshots via --build-snapshot and --snapshot-blob * lib,src: implement WebAssembly Web API nodejs/node#42701 * fixup! deps,src: use SIMD for normal base64 encoding * fixup! src: refactor DH groups to delete crypto_groups.h * chore: fixup base64 GN file * fix: check that node::InitializeContext() returns true * chore: delete _noBrowserGlobals usage * chore: disable fetch in renderer procceses * dns: default to verbatim=true in dns.lookup() nodejs/node#39987 Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
1 parent 3c76b0f commit b19d67a

File tree

50 files changed

+791
-1133
lines changed

Some content is hidden

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

50 files changed

+791
-1133
lines changed

DEPS

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars = {
44
'chromium_version':
55
'109.0.5382.0',
66
'node_version':
7-
'v16.17.1',
7+
'v18.10.0',
88
'nan_version':
99
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
1010
'squirrel.mac_version':

patches/node/.patches

+4-7
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.pa
99
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
1010
chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
1111
chore_add_context_to_context_aware_module_prevention.patch
12-
chore_read_nobrowserglobals_from_global_not_process.patch
1312
fix_handle_boringssl_and_openssl_incompatibilities.patch
14-
src_allow_embedders_to_provide_a_custom_pageallocator_to.patch
1513
fix_crypto_tests_to_run_with_bssl.patch
1614
fix_account_for_debugger_agent_race_condition.patch
1715
repl_fix_crash_when_sharedarraybuffer_disabled.patch
@@ -20,10 +18,8 @@ fix_crash_caused_by_gethostnamew_on_windows_7.patch
2018
fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
2119
fix_serdes_test.patch
2220
darwin_bump_minimum_supported_version_to_10_15_3406.patch
23-
fix_failing_node_js_test_on_outdated.patch
2421
be_compatible_with_cppgc.patch
2522
feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch
26-
worker_thread_add_asar_support.patch
2723
process_monitor_for_exit_with_kqueue_on_bsds_3441.patch
2824
process_bsd_handle_kevent_note_exit_failure_3451.patch
2925
reland_macos_use_posix_spawn_instead_of_fork_3257.patch
@@ -35,15 +31,12 @@ process_simplify_uv_write_int_calls_3519.patch
3531
macos_don_t_use_thread-unsafe_strtok_3524.patch
3632
process_fix_hang_after_note_exit_3521.patch
3733
feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
38-
fix_preserve_proper_method_names_as-is_in_error_stack.patch
3934
macos_avoid_posix_spawnp_cwd_bug_3597.patch
40-
src_update_importmoduledynamically.patch
4135
json_parse_errors_made_user-friendly.patch
4236
support_v8_sandboxed_pointers.patch
4337
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
4438
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
4539
fix_override_createjob_in_node_platform.patch
46-
src_fix_ssize_t_error_from_nghttp2_h.patch
4740
v8_api_advance_api_deprecation.patch
4841
enable_-wunqualified-std-cast-call.patch
4942
fixup_for_error_declaration_shadows_a_local_variable.patch
@@ -53,3 +46,7 @@ fix_parallel_test-v8-stats.patch
5346
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
5447
heap_remove_allocationspace_map_space_enum_constant.patch
5548
test_remove_experimental-wasm-threads_flag.patch
49+
api_pass_oomdetails_to_oomerrorcallback.patch
50+
src_iwyu_in_cleanup_queue_cc.patch
51+
fix_expose_lookupandcompile_with_parameters.patch
52+
fix_prevent_changing_functiontemplateinfo_after_publish.patch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Shelley Vohr <[email protected]>
3+
Date: Wed, 12 Oct 2022 21:25:49 +0200
4+
Subject: Pass OOMDetails to OOMErrorCallback
5+
6+
Introduced in https://chromium-review.googlesource.com/c/v8/v8/+/3647827.
7+
8+
This patch can be removed when Node.js updates to a V8 version containing
9+
the above CL.
10+
11+
diff --git a/src/node_errors.cc b/src/node_errors.cc
12+
index 323fc7d4ff635ca287ee241cee234da0600340a2..36ab78f739f3faecab47eead99f9aa3c403672c0 100644
13+
--- a/src/node_errors.cc
14+
+++ b/src/node_errors.cc
15+
@@ -495,9 +495,9 @@ void OnFatalError(const char* location, const char* message) {
16+
ABORT();
17+
}
18+
19+
-void OOMErrorHandler(const char* location, bool is_heap_oom) {
20+
+void OOMErrorHandler(const char* location, const v8::OOMDetails& details) {
21+
const char* message =
22+
- is_heap_oom ? "Allocation failed - JavaScript heap out of memory"
23+
+ details.is_heap_oom ? "Allocation failed - JavaScript heap out of memory"
24+
: "Allocation failed - process out of memory";
25+
if (location) {
26+
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
27+
diff --git a/src/node_errors.h b/src/node_errors.h
28+
index 5587c2348626102febe33a20ff45748a6eec61ad..6dbba32858dc82bc04171da7ee2a33a0b4dee791 100644
29+
--- a/src/node_errors.h
30+
+++ b/src/node_errors.h
31+
@@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env,
32+
33+
[[noreturn]] void FatalError(const char* location, const char* message);
34+
void OnFatalError(const char* location, const char* message);
35+
-void OOMErrorHandler(const char* location, bool is_heap_oom);
36+
+void OOMErrorHandler(const char* location, const v8::OOMDetails& details);
37+
38+
// Helpers to construct errors similar to the ones provided by
39+
// lib/internal/errors.js.

patches/node/be_compatible_with_cppgc.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This patch should be upstreamed to Node.
4646
See also: https://source.chromium.org/chromium/chromium/src/+/main:v8/include/v8-cppgc.h;l=70-76;drc=5a758a97032f0b656c3c36a3497560762495501a
4747

4848
diff --git a/src/base_object.h b/src/base_object.h
49-
index 842f763a56d75c55509534e3d44a8080dd283127..b6078fe83c82a5edec0f7652b8c2d1b6c2491ca4 100644
49+
index a17879be5b452aa208caf1b29c86f8e5d9baa693..c48d7a7e9d0535cabb4eb84b5700d0cf537ddc88 100644
5050
--- a/src/base_object.h
5151
+++ b/src/base_object.h
5252
@@ -40,7 +40,7 @@ class TransferData;
@@ -59,10 +59,10 @@ index 842f763a56d75c55509534e3d44a8080dd283127..b6078fe83c82a5edec0f7652b8c2d1b6
5959
// Associates this object with `object`. It uses the 0th internal field for
6060
// that, and in particular aborts if there is no such field.
6161
diff --git a/src/env.cc b/src/env.cc
62-
index 22be69ec30a5b8466caacc698c791494891e5dee..cc44d578df9e146aa72f8273c1271d6a3c00d610 100644
62+
index 24aeb329c593bfd5a35877d6f4e2b7afa9848306..de41e5b7f6ff9f818c661484a93b74db7569e31f 100644
6363
--- a/src/env.cc
6464
+++ b/src/env.cc
65-
@@ -2119,11 +2119,20 @@ void Environment::RunWeakRefCleanup() {
65+
@@ -2013,11 +2013,20 @@ void Environment::RunWeakRefCleanup() {
6666
isolate()->ClearKeptObjects();
6767
}
6868

@@ -84,7 +84,7 @@ index 22be69ec30a5b8466caacc698c791494891e5dee..cc44d578df9e146aa72f8273c1271d6a
8484
object->SetAlignedPointerInInternalField(BaseObject::kSlot,
8585
static_cast<void*>(this));
8686
env->AddCleanupHook(DeleteMe, static_cast<void*>(this));
87-
@@ -2177,7 +2186,8 @@ void BaseObject::MakeWeak() {
87+
@@ -2071,7 +2080,8 @@ void BaseObject::MakeWeak() {
8888
void BaseObject::LazilyInitializedJSTemplateConstructor(
8989
const FunctionCallbackInfo<Value>& args) {
9090
DCHECK(args.IsConstructCall());

0 commit comments

Comments
 (0)