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

Commit

Permalink
chore: bump node to v18.13.0 (main) (electron#36818)
Browse files Browse the repository at this point in the history
* chore: bump node in DEPS to v18.13.0

* child_process: validate arguments for null bytes

nodejs/node#44782

* bootstrap: merge main thread and worker thread initializations

nodejs/node#44869

* module: ensure relative requires work from deleted directories

nodejs/node#42384

* src: add support for externally shared js builtins

nodejs/node#44000

* lib: disambiguate `native module` to `binding`

nodejs/node#45673

* test: convert test-debugger-pid to async/await

nodejs/node#45179

* deps: upgrade to libuv 1.44.2

nodejs/node#42340

* src: fix cppgc incompatibility in v8

nodejs/node#43521

* src: use qualified `std::move` call in node_http2

nodejs/node#45555

* build: fix env.h for cpp20

nodejs/node#45516

* test: remove experimental-wasm-threads flag

nodejs/node#45074

* src: iwyu in cleanup_queue.cc

nodejs/node#44983

* src: add missing include for `std::all_of`

nodejs/node#45541

* deps: update ICU to 72.1

nodejs/node#45068

* chore: fixup patch indices

* chore: remove errant semicolons

- nodejs/node#44179
- nodejs/node#44193

* src: add support for externally shared js builtins

nodejs/node#44376

* chore: add missing GN filenames

* deps: update nghttp2 to 1.51.0

nodejs/node#45537

* chore: disable more Node.js snapshot tests

The Snapshot feature is currently disabled

* chore: disable ICU timezone tests

Node.js uses a different version of ICU than Electron so they
will often be out of sync.

* chore: disable threadpool event tracing test

Event tracing is not enabled in embedded Node.js

* chore: fixup patch indices

* chore: comments from review

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
2 people authored and khalwa committed Feb 22, 2023
1 parent 3ffa369 commit cd481d5
Show file tree
Hide file tree
Showing 54 changed files with 330 additions and 2,311 deletions.
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'111.0.5518.0',
'node_version':
'v18.12.1',
'v18.13.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
Expand Down
21 changes: 2 additions & 19 deletions patches/node/.patches
Expand Up @@ -16,40 +16,23 @@ repl_fix_crash_when_sharedarraybuffer_disabled.patch
fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
fix_serdes_test.patch
darwin_bump_minimum_supported_version_to_10_15_3406.patch
be_compatible_with_cppgc.patch
feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch
process_monitor_for_exit_with_kqueue_on_bsds_3441.patch
process_bsd_handle_kevent_note_exit_failure_3451.patch
reland_macos_use_posix_spawn_instead_of_fork_3257.patch
process_reset_the_signal_mask_if_the_fork_fails_3537.patch
process_only_use_f_dupfd_cloexec_if_it_is_defined_3512.patch
unix_simplify_uv_cloexec_fcntl_3492.patch
unix_remove_uv_cloexec_ioctl_3515.patch
process_simplify_uv_write_int_calls_3519.patch
macos_don_t_use_thread-unsafe_strtok_3524.patch
process_fix_hang_after_note_exit_3521.patch
feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
macos_avoid_posix_spawnp_cwd_bug_3597.patch
json_parse_errors_made_user-friendly.patch
support_v8_sandboxed_pointers.patch
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
fix_override_createjob_in_node_platform.patch
v8_api_advance_api_deprecation.patch
enable_-wunqualified-std-cast-call.patch
fixup_for_error_declaration_shadows_a_local_variable.patch
fixup_for_wc_98-compat-extra-semi.patch
drop_deserializerequest_move_constructor_for_c_20_compat.patch
fix_parallel_test-v8-stats.patch
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
heap_remove_allocationspace_map_space_enum_constant.patch
test_remove_experimental-wasm-threads_flag.patch
api_pass_oomdetails_to_oomerrorcallback.patch
src_iwyu_in_cleanup_queue_cc.patch
fix_expose_lookupandcompile_with_parameters.patch
fix_prevent_changing_functiontemplateinfo_after_publish.patch
chore_add_missing_algorithm_include.patch
fix_tolocalstring_unicode_mismatch.patch
enable_crashpad_linux_node_processes.patch
allow_embedder_to_control_codegenerationfromstringscallback.patch
chore_remove_errant_semicolons.patch
chore_remove_unreached_return.patch
Expand Up @@ -8,10 +8,10 @@ This is needed to blend Blink and Node's code generation policy.
This should be upstreamed.

diff --git a/src/api/environment.cc b/src/api/environment.cc
index b6981c37d5b286e22f24d11751eb05f72ca27619..c4a3a54753767e7686a0e32996bcda0c90f659a7 100644
index c0c422e969543dcd570dabfd8ff0755abe37face..4f14b308d14f3653c8646345a5b375014a51851f 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -259,11 +259,15 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
@@ -267,11 +267,15 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
isolate->SetMicrotasksPolicy(s.policy);

Expand All @@ -30,10 +30,10 @@ index b6981c37d5b286e22f24d11751eb05f72ca27619..c4a3a54753767e7686a0e32996bcda0c
Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
if (per_process::cli_options->get_per_isolate_options()
diff --git a/src/node.h b/src/node.h
index bee494f9da8470530ee9ec58958f8f2c7ce6a302..387ce8e5edf6524db170e2d46ef501a1cd956d98 100644
index 6ff7527d4fe4d126bda80615ffed75f77f700b86..5a849f047feca5d4d101c21c125e1c0500150077 100644
--- a/src/node.h
+++ b/src/node.h
@@ -461,6 +461,8 @@ struct IsolateSettings {
@@ -463,6 +463,8 @@ struct IsolateSettings {
v8::PromiseRejectCallback promise_reject_callback = nullptr;
v8::AllowWasmCodeGenerationCallback
allow_wasm_code_generation_callback = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion patches/node/api_pass_oomdetails_to_oomerrorcallback.patch
Expand Up @@ -25,7 +25,7 @@ index 323fc7d4ff635ca287ee241cee234da0600340a2..36ab78f739f3faecab47eead99f9aa3c
if (location) {
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
diff --git a/src/node_errors.h b/src/node_errors.h
index 5587c2348626102febe33a20ff45748a6eec61ad..6dbba32858dc82bc04171da7ee2a33a0b4dee791 100644
index 926f54286ec72fda98a9a477ac8e22feef522291..f926cc1c70dd6f883c0729c46f09e10972ce6385 100644
--- a/src/node_errors.h
+++ b/src/node_errors.h
@@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env,
Expand Down
96 changes: 0 additions & 96 deletions patches/node/be_compatible_with_cppgc.patch

This file was deleted.

38 changes: 30 additions & 8 deletions patches/node/build_add_gn_build_files.patch
Expand Up @@ -893,10 +893,10 @@ index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb
+}
diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..9abde472d88923db835b12982b7f2ccb1f260196
index 0000000000000000000000000000000000000000..23eed033d31eced6a85c794eee550655af7a9a1d
--- /dev/null
+++ b/deps/nghttp2/BUILD.gn
@@ -0,0 +1,47 @@
@@ -0,0 +1,48 @@
+config("nghttp2_config") {
+ defines = [ "NGHTTP2_STATICLIB" ]
+ include_dirs = [ "lib/includes" ]
Expand All @@ -923,6 +923,7 @@ index 0000000000000000000000000000000000000000..9abde472d88923db835b12982b7f2ccb
+ "lib/nghttp2_buf.c",
+ "lib/nghttp2_callbacks.c",
+ "lib/nghttp2_debug.c",
+ "lib/nghttp2_extpri.c",
+ "lib/nghttp2_frame.c",
+ "lib/nghttp2_hd.c",
+ "lib/nghttp2_hd_huffman.c",
Expand Down Expand Up @@ -1192,10 +1193,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9b477239e
index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101af305de82
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,638 @@
@@ -0,0 +1,653 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
Expand Down Expand Up @@ -1301,7 +1302,6 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "dest_dir": "include/node//uv/",
+ "files": [
+ "deps/uv/include/uv/aix.h",
+ "deps/uv/include/uv/android-ifaddrs.h",
+ "deps/uv/include/uv/bsd.h",
+ "deps/uv/include/uv/darwin.h",
+ "deps/uv/include/uv/errno.h",
Expand Down Expand Up @@ -1414,6 +1414,7 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "lib/internal/error_serdes.js",
+ "lib/internal/errors.js",
+ "lib/internal/event_target.js",
+ "lib/internal/file.js",
+ "lib/internal/fixed_queue.js",
+ "lib/internal/freelist.js",
+ "lib/internal/freeze_intrinsics.js",
Expand All @@ -1422,6 +1423,7 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "lib/internal/fs/dir.js",
+ "lib/internal/fs/promises.js",
+ "lib/internal/fs/read_file_context.js",
+ "lib/internal/fs/recursive_watch.js",
+ "lib/internal/fs/rimraf.js",
+ "lib/internal/fs/streams.js",
+ "lib/internal/fs/sync_write_stream.js",
Expand Down Expand Up @@ -1451,6 +1453,7 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "lib/internal/main/test_runner.js",
+ "lib/internal/main/watch_mode.js",
+ "lib/internal/main/worker_thread.js",
+ "lib/internal/mime.js",
+ "lib/internal/modules/cjs/helpers.js",
+ "lib/internal/modules/cjs/loader.js",
+ "lib/internal/modules/esm/assert.js",
Expand Down Expand Up @@ -1537,7 +1540,11 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "lib/internal/test/binding.js",
+ "lib/internal/test/transfer.js",
+ "lib/internal/test_runner/harness.js",
+ "lib/internal/test_runner/mock.js",
+ "lib/internal/test_runner/runner.js",
+ "lib/internal/test_runner/tap_checker.js",
+ "lib/internal/test_runner/tap_lexer.js",
+ "lib/internal/test_runner/tap_parser.js",
+ "lib/internal/test_runner/tap_stream.js",
+ "lib/internal/test_runner/test.js",
+ "lib/internal/test_runner/utils.js",
Expand All @@ -1561,6 +1568,7 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "lib/internal/v8_prof_polyfill.js",
+ "lib/internal/v8_prof_processor.js",
+ "lib/internal/validators.js",
+ "lib/internal/vm.js",
+ "lib/internal/vm/module.js",
+ "lib/internal/wasm_web_api.js",
+ "lib/internal/watch_mode/files_watcher.js",
Expand Down Expand Up @@ -1637,6 +1645,7 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "src/api/hooks.cc",
+ "src/api/utils.cc",
+ "src/async_wrap.cc",
+ "src/base_object.cc",
+ "src/cares_wrap.cc",
+ "src/cleanup_queue.cc",
+ "src/connect_wrap.cc",
Expand Down Expand Up @@ -1685,10 +1694,12 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "src/node_process_events.cc",
+ "src/node_process_methods.cc",
+ "src/node_process_object.cc",
+ "src/node_realm.cc",
+ "src/node_report.cc",
+ "src/node_report_module.cc",
+ "src/node_report_utils.cc",
+ "src/node_serdes.cc",
+ "src/node_shadow_realm.cc",
+ "src/node_snapshotable.cc",
+ "src/node_sockaddr.cc",
+ "src/node_stat_watcher.cc",
Expand Down Expand Up @@ -1743,6 +1754,7 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "src/connection_wrap.h",
+ "src/debug_utils.h",
+ "src/debug_utils-inl.h",
+ "src/env_properties.h",
+ "src/env.h",
+ "src/env-inl.h",
+ "src/handle_wrap.h",
Expand Down Expand Up @@ -1790,16 +1802,20 @@ index 0000000000000000000000000000000000000000..b445ccdd7ba2f0b5661d4761f995a4c9
+ "src/node_platform.h",
+ "src/node_process.h",
+ "src/node_process-inl.h",
+ "src/node_realm.h",
+ "src/node_realm-inl.h",
+ "src/node_report.h",
+ "src/node_revert.h",
+ "src/node_root_certs.h",
+ "src/node_shadow_realm.h",
+ "src/node_snapshotable.h",
+ "src/node_snapshot_builder.h",
+ "src/node_sockaddr.h",
+ "src/node_sockaddr-inl.h",
+ "src/node_stat_watcher.h",
+ "src/node_union_bytes.h",
+ "src/node_url.h",
+ "src/node_util.h",
+ "src/node_version.h",
+ "src/node_v8.h",
+ "src/node_v8_platform-inl.h",
Expand Down Expand Up @@ -2075,7 +2091,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index 68c7df653ebb84d9e0c5d34a1cfa4fa3bd4ce690..2762b9f8ae782518ecc9c21f09880c10025155aa 100644
index d6b2f18cf8599ed7994954c808379565b740ac83..cd73f646bb3e9dbc4d9f4a3f24ef5970ec33b3a5 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand All @@ -2091,10 +2107,10 @@ index 68c7df653ebb84d9e0c5d34a1cfa4fa3bd4ce690..2762b9f8ae782518ecc9c21f09880c10
// which the Node binary being built supports.
diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py
new file mode 100755
index 0000000000000000000000000000000000000000..87621ba1d7f1c80aadb81461824b0c2edab1de22
index 0000000000000000000000000000000000000000..616dc0c61ed4ea1bf2fb9e4768ba2ec566a83e42
--- /dev/null
+++ b/tools/generate_gn_filenames_json.py
@@ -0,0 +1,75 @@
@@ -0,0 +1,81 @@
+#!/usr/bin/env python3
+import json
+import os
Expand Down Expand Up @@ -2143,6 +2159,12 @@ index 0000000000000000000000000000000000000000..87621ba1d7f1c80aadb81461824b0c2e
+ def filter_v8_files(files):
+ if any(f.startswith('deps/v8/') for f in files):
+ files = [f.replace('deps/v8/', '//v8/', 1) for f in files]
+
+ if any(f == '<@(node_builtin_shareable_builtins)' for f in files):
+ files.remove('<@(node_builtin_shareable_builtins)')
+ shared_builtins = ['deps/cjs-module-lexer/lexer.js', 'deps/cjs-module-lexer/dist/lexer.js', 'deps/undici/undici.js']
+ files.extend(shared_builtins)
+
+ return files
+
+ lib_files = SearchFiles('lib', 'js')
Expand Down
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 3e73073fb3f0e3bed74ff00521fc1b98997d9540..ca089eee5eafef6e08960d2a96ef27d8cfa95180 100644
index 6704d96142f806be9c0605f0b41206e77f492b96..f1404d27e14ce7143d3b2dbccde7af8269369cbf 100644
--- a/common.gypi
+++ b/common.gypi
@@ -79,6 +79,8 @@
Expand All @@ -27,7 +27,7 @@ index 3e73073fb3f0e3bed74ff00521fc1b98997d9540..ca089eee5eafef6e08960d2a96ef27d8
],

# Forcibly disable -Werror. We support a wide range of compilers, it's
@@ -392,6 +395,11 @@
@@ -388,6 +391,11 @@
}],
],
}],
Expand All @@ -40,10 +40,10 @@ index 3e73073fb3f0e3bed74ff00521fc1b98997d9540..ca089eee5eafef6e08960d2a96ef27d8
'defines': [
'V8_COMPRESS_POINTERS',
diff --git a/configure.py b/configure.py
index 1b7a721585764aecfd855ee47c47a3bd235d2ef3..c152ea9f29478729ec3752132140e3ec44dbd366 100755
index bae674fd264ff0bfbe025c286279182358872b23..1f3c398c034d2c0bf0eca51b892ca87c3fcf7ce1 100755
--- a/configure.py
+++ b/configure.py
@@ -1464,6 +1464,7 @@ def configure_library(lib, output, pkgname=None):
@@ -1511,6 +1511,7 @@ def configure_library(lib, output, pkgname=None):


def configure_v8(o):
Expand All @@ -52,7 +52,7 @@ index 1b7a721585764aecfd855ee47c47a3bd235d2ef3..c152ea9f29478729ec3752132140e3ec
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 10061d4298368bc0ad53c0c8c3a3c964c13d4c3c..bee494f9da8470530ee9ec58958f8f2c7ce6a302 100644
index 173e0bc669a2fd90e764da72e09003f4c7311fd7..6ff7527d4fe4d126bda80615ffed75f77f700b86 100644
--- a/src/node.h
+++ b/src/node.h
@@ -22,6 +22,12 @@
Expand Down

0 comments on commit cd481d5

Please sign in to comment.