Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: reland bump Node.js to v22.9.0 #44597

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revert "build: revert bump Node.js to v22.9.0 (#44596)"
This reverts commit f9a0401.
  • Loading branch information
VerteDinde committed Nov 13, 2024
commit 56332ec9dc151d4401a51811800d30dce90cf2d9
2 changes: 1 addition & 1 deletion .github/workflows/pipeline-segment-electron-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
if [ "${{ inputs.is-asan }}" == "true" ]; then
cd ..
ASAN_SYMBOLIZE="$PWD/tools/valgrind/asan/asan_symbolize.py --executable-path=$PWD/out/Default/electron"
export ASAN_OPTIONS="symbolize=0 handle_abort=1"
export ASAN_OPTIONS="symbolize=0 handle_abort=1 detect_container_overflow=0"
export G_SLICE=always-malloc
export NSS_DISABLE_ARENA_FREE_LIST=1
export NSS_DISABLE_UNLOAD=1
Expand Down
10 changes: 5 additions & 5 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import("//pdf/features.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//testing/test.gni")
import("//third_party/electron_node/electron_node.gni")
import("//third_party/electron_node/node.gni")
import("//third_party/ffmpeg/ffmpeg_options.gni")
import("//tools/generate_library_loader/generate_library_loader.gni")
import("//tools/grit/grit_rule.gni")
Expand Down Expand Up @@ -408,7 +408,7 @@ action("electron_generate_node_defines") {
source_set("electron_lib") {
configs += [
"//v8:external_startup_data",
"//third_party/electron_node:node_internals",
"//third_party/electron_node:node_external_config",
]

public_configs = [
Expand Down Expand Up @@ -483,7 +483,7 @@ source_set("electron_lib") {
"//third_party/blink/public:blink_devtools_inspector_resources",
"//third_party/blink/public/platform/media",
"//third_party/boringssl",
"//third_party/electron_node:node_lib",
"//third_party/electron_node:libnode",
"//third_party/inspector_protocol:crdtp",
"//third_party/leveldatabase",
"//third_party/libyuv",
Expand Down Expand Up @@ -868,7 +868,7 @@ if (is_mac) {
":electron_framework_resources",
":electron_swiftshader_library",
":electron_xibs",
"//third_party/electron_node:node_lib",
"//third_party/electron_node:libnode",
]
if (!is_mas_build) {
deps += [ ":electron_crashpad_helper" ]
Expand Down Expand Up @@ -1192,7 +1192,7 @@ if (is_mac) {
"//components/crash/core/app",
"//content:sandbox_helper_win",
"//electron/buildflags",
"//third_party/electron_node:node_lib",
"//third_party/electron_node:libnode",
"//ui/strings",
]

Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'132.0.6824.0',
'node_version':
'v20.18.0',
'v22.9.0',
'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version':
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/multithreading.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ safe.
The only way to load a native module safely for now, is to make sure the app
loads no native modules after the Web Workers get started.

```js @ts-expect-error=[1]
```js
process.dlopen = () => {
throw new Error('Load native module is not safe')
}
Expand Down
21 changes: 21 additions & 0 deletions lib/node/asar-fs-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,27 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
return files;
};

const modBinding = internalBinding('modules');
const { readPackageJSON } = modBinding;
internalBinding('modules').readPackageJSON = (
jsonPath: string,
isESM: boolean,
base: undefined | string,
specifier: undefined | string
) => {
const pathInfo = splitPath(jsonPath);
if (!pathInfo.isAsar) return readPackageJSON(jsonPath, isESM, base, specifier);
const { asarPath, filePath } = pathInfo;

const archive = getOrCreateArchive(asarPath);
if (!archive) return undefined;

const realPath = archive.copyFileOut(filePath);
if (!realPath) return undefined;

return readPackageJSON(realPath, isESM, base, specifier);
};

const binding = internalBinding('fs');
const { internalModuleReadJSON, kUsePromises } = binding;
internalBinding('fs').internalModuleReadJSON = (pathArgument: string) => {
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@electron/get": "^2.0.0",
"@types/node": "^20.9.0",
"@types/node": "^22.7.7",
"extract-zip": "^2.0.1"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@octokit/rest": "^20.0.2",
"@primer/octicons": "^10.0.0",
"@types/minimist": "^1.2.5",
"@types/node": "^20.9.0",
"@types/node": "^22.7.7",
"@types/semver": "^7.5.8",
"@types/stream-json": "^1.7.7",
"@types/temp": "^0.9.4",
Expand Down
23 changes: 21 additions & 2 deletions patches/chromium/build_allow_electron_to_use_exec_script.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,34 @@ 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 44a11ec90ec9b67cf22b6d529c6843e6b6af12bc..783dd77dcdf92ec32cc6594b739eab9738f3e3ba 100644
index 44a11ec90ec9b67cf22b6d529c6843e6b6af12bc..3e880eed02ca57db10d734d6a7566e0a977433a5 100644
--- a/.gn
+++ b/.gn
@@ -172,4 +172,8 @@ exec_script_whitelist =
@@ -172,4 +172,27 @@ exec_script_whitelist =

"//tools/grit/grit_rule.gni",
"//tools/gritsettings/BUILD.gn",
+
+ "//electron/BUILD.gn",
+ "//third_party/electron_node/deps/ada/unofficial.gni",
+ "//third_party/electron_node/deps/base64/BUILD.gn",
+ "//third_party/electron_node/deps/base64/unofficial.gni",
+ "//third_party/electron_node/node.gni",
+ "//third_party/electron_node/unofficial.gni",
+ "//third_party/electron_node/deps/brotli/unofficial.gni",
+ "//third_party/electron_node/deps/cares/unofficial.gni",
+ "//third_party/electron_node/deps/googletest/unofficial.gni",
+ "//third_party/electron_node/deps/histogram/unofficial.gni",
+ "//third_party/electron_node/deps/llhttp/unofficial.gni",
+ "//third_party/electron_node/deps/nbytes/unofficial.gni",
+ "//third_party/electron_node/deps/ncrypto/unofficial.gni",
+ "//third_party/electron_node/deps/nghttp2/unofficial.gni",
+ "//third_party/electron_node/deps/ngtcp2/unofficial.gni",
+ "//third_party/electron_node/deps/openssl/unofficial.gni",
+ "//third_party/electron_node/deps/simdutf/unofficial.gni",
+ "//third_party/electron_node/deps/simdjson/unofficial.gni",
+ "//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/src/inspector/unofficial.gni",
]
3 changes: 2 additions & 1 deletion patches/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
{ "patch_dir": "src/electron/patches/Mantle", "repo": "src/third_party/squirrel.mac/vendor/Mantle" },
{ "patch_dir": "src/electron/patches/ReactiveObjC", "repo": "src/third_party/squirrel.mac/vendor/ReactiveObjC" },
{ "patch_dir": "src/electron/patches/webrtc", "repo": "src/third_party/webrtc" },
{ "patch_dir": "src/electron/patches/reclient-configs", "repo": "src/third_party/engflow-reclient-configs" }
{ "patch_dir": "src/electron/patches/reclient-configs", "repo": "src/third_party/engflow-reclient-configs" },
{ "patch_dir": "src/electron/patches/sqlite", "repo": "src/third_party/sqlite/src" }
]
20 changes: 4 additions & 16 deletions patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,25 @@ enable_crashpad_linux_node_processes.patch
fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch
chore_expose_importmoduledynamically_and.patch
test_formally_mark_some_tests_as_flaky.patch
fix_adapt_debugger_tests_for_upstream_v8_changes.patch
chore_remove_--no-harmony-atomics_related_code.patch
fix_account_for_createexternalizablestring_v8_global.patch
fix_do_not_resolve_electron_entrypoints.patch
ci_ensure_node_tests_set_electron_run_as_node.patch
fix_assert_module_in_the_renderer_process.patch
fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch
win_process_avoid_assert_after_spawning_store_app_4152.patch
chore_remove_use_of_deprecated_kmaxlength.patch
src_update_default_v8_platform_to_override_functions_with_location.patch
fix_capture_embedder_exceptions_before_entering_v8.patch
spec_add_iterator_to_global_intrinsics.patch
test_make_test-node-output-v8-warning_generic.patch
test_match_wpt_streams_transferable_transform-stream-members_any_js.patch
fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch
deprecate_vector_v8_local_in_v8.patch
fix_remove_deprecated_errno_constants.patch
build_enable_perfetto.patch
fix_add_source_location_for_v8_task_runner.patch
cherry-pick_src_remove_calls_to_recently_deprecated_v8_apis.patch
src_do_not_use_deprecated_v8_api.patch
src_use_new_v8_api_to_define_stream_accessor.patch
src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch
test_update_v8-stats_test_for_v8_12_6.patch
src_do_not_use_soon-to-be-deprecated_v8_api.patch
fix_add_property_query_interceptors.patch
src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch
src_use_supported_api_to_get_stalled_tla_messages.patch
build_don_t_redefine_win32_lean_and_mean.patch
build_compile_with_c_20_support.patch
add_v8_taskpirority_to_foreground_task_runner_signature.patch
cli_remove_deprecated_v8_flag.patch
build_restore_clang_as_default_compiler_on_macos.patch
esm_drop_support_for_import_assertions.patch
fix_-wextra-semi_errors_in_nghttp2_helper_h.patch
fix_remove_harmony-import-assertions_from_node_cc.patch
win_almost_fix_race_detecting_esrch_in_uv_kill.patch
chore_disable_deprecation_ftbfs_in_simdjson_header.patch
Loading