chore: bump node to v20.11.0 (main) (#40941)

* chore: bump node in DEPS to v20.11.0

* module: bootstrap module loaders in shadow realm

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

* src: add commit hash shorthand in zlib version

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

* v8,tools: expose necessary V8 defines

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

* esm: do not call getSource when format is commonjs

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

* esm: fallback to readFileSync when source is nullish

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

* vm: allow dynamic import with a referrer realm

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

* test: skip test-diagnostics-channel-memory-leak.js

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

* esm: do not call getSource when format is commonjs

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

* lib: fix assert throwing different error messages in ESM and CJS

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

* src: fix compatility with upcoming V8 12.1 APIs

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

* deps: update base64 to 0.5.1

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

* src: avoid silent coercion to signed/unsigned int

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

* src: fix compatility with upcoming V8 12.1 APIs

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

* chore: fix patch indices

* chore: update patches

* test: disable TLS cipher test

This can't be enabled owing to BoringSSL incompatibilities.

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

* fix: check for Buffer and global definition in shadow realm

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

* test: disable parallel/test-shadow-realm-custom-loader

Incompatible with our asar logic, resulting in the following failure:

> Failed to CompileAndCall electron script: electron/js2c/asar_bundle

* chore: remove deleted parallel/test-crypto-modp1-error test

* test: make test-node-output-v8-warning generic

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

* chore: fixup ModuleWrap patch

* test: match wpt/streams/transferable/transform-stream-members.any.js to upstream

* fix: sandbox is not enabled on arm

* chore: disable v8 sandbox on ia32/arm

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
electron-roller[bot] 2024-01-18 16:16:45 -05:00 committed by GitHub
parent 6ea7da4b90
commit f4ee3c1b2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 727 additions and 748 deletions

View file

@ -5,24 +5,38 @@ Subject: build: add GN build files
This adds GN build files for Node, so we don't have to build with GYP.
Note that there always GN files in upstream Node in 20/21 branches,
however those files were cherry-picked from main branch and do not
really in 20/21. We have to wait until 22 is released to be able to
build with upstream GN files.
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf43883207c754
--- /dev/null
index 1ed186b597eece7c34cb69c8e1e20870555a040d..541e7d2b8ee05677b64a3ea39c1422560fd5df75 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -0,0 +1,402 @@
@@ -1,14 +1,404 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+import("//v8/gni/v8.gni")
+import("//electron/js2c_toolchain.gni")
+import("node.gni")
+
+import("electron_node.gni")
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+declare_args() {
+ # Enable the V8 inspector protocol for use with node.
+ node_enable_inspector = true
+
-import("unofficial.gni")
+ # Build node with SSL support.
+ # The variable is called "openssl" for parity with node's GYP build.
+ node_use_openssl = true
+
-node_gn_build("node") {
+ # Use the specified path to system CA (PEM format) in addition to
+ # the BoringSSL supplied CA store or compiled-in Mozilla CA copy.
+ node_openssl_system_ca_path = ""
@ -155,9 +169,12 @@ index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf4388
+config("node_lib_config") {
+ include_dirs = [ "src" ]
+
+ # FIXME(deepak1556): include paths should be corrected,
+ # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
+ cflags = [ "-Wno-microsoft-include" ]
+ cflags = [
+ "-Wno-shadow",
+ # FIXME(deepak1556): include paths should be corrected,
+ # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
+ "-Wno-microsoft-include",
+ ]
+
+ configs = [ ":node_features" ]
+
@ -317,7 +334,6 @@ index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf4388
+ "-Wno-unused-label",
+ "-Wno-unused-private-field",
+ "-Wno-unused-variable",
+ "-Wno-shadow",
+ ]
+
+ if (v8_enable_i18n_support) {
@ -412,172 +428,122 @@ index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf4388
+ ]
+ cflags_cc += [ "-Wno-sign-compare" ]
+ }
+}
}
diff --git a/deps/ada/BUILD.gn b/deps/ada/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..1ce69e9deba1a9b191e8d95f4c82e0ec1f7b50ca
--- /dev/null
index e92ac3a3beac143dced2efb05304ed8ba832b067..1ce69e9deba1a9b191e8d95f4c82e0ec1f7b50ca 100644
--- a/deps/ada/BUILD.gn
+++ b/deps/ada/BUILD.gn
@@ -0,0 +1,12 @@
@@ -1,14 +1,12 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+import("//v8/gni/v8.gni")
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+config("ada_config") {
+ include_dirs = [ "." ]
+}
+
-import("unofficial.gni")
+static_library("ada") {
+ include_dirs = [ "." ]
+ sources = [ "ada.cpp" ]
+
-ada_gn_build("ada") {
+ public_configs = [ ":ada_config" ]
+}
diff --git a/deps/base64/BUILD.gn b/deps/base64/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..9b97aabe865e4cf12f6c3ccda196b372769a823b
--- /dev/null
+++ b/deps/base64/BUILD.gn
@@ -0,0 +1,135 @@
+config("base64_config") {
+ include_dirs = [
+ "base64/include",
+ "base64/lib",
+ ]
}
diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni
index 269c62d976d6adea6d020568094e23e9b0a9dc7c..14ffff0b4badb7ad71f2b6df43ad2eb300fc55ed 100644
--- a/deps/base64/unofficial.gni
+++ b/deps/base64/unofficial.gni
@@ -18,6 +18,10 @@ template("base64_gn_build") {
}
}
+ # FIXME(zcbenz): ASM on win/x86 compiles perfectly in upstream Node, figure
+ # out why it does not work in Electron's build configs.
+ support_x86_asm = target_cpu == "x64" || (target_cpu == "x86" && !is_win)
+
+ defines = [ "BASE64_STATIC_DEFINE" ]
+}
+
+static_library("base64") {
+ defines = []
+ deps = [
+ ":base64_neon32",
+ ":base64_neon64",
+ ":base64_avx",
+ ":base64_avx2",
+ ":base64_sse41",
+ ":base64_sse42",
+ ":base64_ssse3",
+ ]
+
+ public_configs = [ ":base64_config" ]
+
+ cflags_c = [
+ "-Wno-implicit-fallthrough",
+ "-Wno-unused-but-set-variable",
+ "-Wno-shadow",
+ ]
+
+ sources = [
+ "base64/include/libbase64.h",
+ "base64/lib/arch/generic/codec.c",
+ "base64/lib/codec_choose.c",
+ "base64/lib/codecs.h",
+ "base64/lib/lib.c",
+ "base64/lib/tables/tables.c",
+ ]
+}
+
+source_set("base64_ssse3") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_SSSE3=1" ]
+
+ cflags = [ "-mssse3" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+
+ sources = [ "base64/lib/arch/ssse3/codec.c" ]
+}
+
+source_set("base64_sse41") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_SSE41=1" ]
+
+ cflags = [ "-msse4.1" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+
+ sources = [ "base64/lib/arch/sse41/codec.c" ]
+}
+
+
+source_set("base64_sse42") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [
+ "BASE64_STATIC_DEFINE",
+ "HAVE_SSE42=1",
+ ]
+
+ cflags = [ "-msse4.2" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+
+ sources = [ "base64/lib/arch/sse42/codec.c" ]
+}
+
+source_set("base64_avx") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_AVX=1" ]
+
+ cflags = [ "-mavx" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+
+ sources = [ "base64/lib/arch/avx/codec.c" ]
+}
+
+source_set("base64_avx2") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_AVX2=1" ]
+
+ cflags = [ "-mavx2" ]
+ cflags_c = [
+ "-Wno-implicit-fallthrough",
+ "-Wno-implicit-function-declaration",
+ ]
+ }
+
+ sources = [ "base64/lib/arch/avx2/codec.c" ]
+}
+
+source_set("base64_neon32") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "arm") {
+ defines = [ "HAVE_NEON32=1" ]
+
+ cflags = [ "-mfpu=neon" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+
+ sources = [ "base64/lib/arch/neon32/codec.c" ]
+}
+
+source_set("base64_neon64") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "arm64") {
+ defines = [ "HAVE_NEON64=1" ]
+
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+
+ sources = [ "base64/lib/arch/neon64/codec.c" ]
+}
config("base64_internal_config") {
include_dirs = [ "base64/lib" ]
if (is_component_build) {
@@ -25,7 +29,7 @@ template("base64_gn_build") {
} else {
defines = []
}
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
defines += [
"HAVE_SSSE3=1",
"HAVE_SSE41=1",
@@ -75,7 +79,7 @@ template("base64_gn_build") {
source_set("base64_ssse3") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/ssse3/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mssse3" ]
}
@@ -85,7 +89,7 @@ template("base64_gn_build") {
source_set("base64_sse41") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/sse41/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-msse4.1" ]
}
@@ -95,7 +99,7 @@ template("base64_gn_build") {
source_set("base64_sse42") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/sse42/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-msse4.2" ]
}
@@ -105,7 +109,7 @@ template("base64_gn_build") {
source_set("base64_avx") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mavx" ]
} else if (is_win) {
@@ -117,7 +121,7 @@ template("base64_gn_build") {
source_set("base64_avx2") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx2/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mavx2" ]
} else if (is_win) {
@@ -129,7 +133,7 @@ template("base64_gn_build") {
source_set("base64_avx512") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx512/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [
"-mavx512vl",
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..fb1b3138cdb674205afa0ffe078270585843eca3
--- /dev/null
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..fb1b3138cdb674205afa0ffe078270585843eca3 100644
--- a/deps/cares/BUILD.gn
+++ b/deps/cares/BUILD.gn
@@ -0,0 +1,143 @@
@@ -1,14 +1,143 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("cares_config") {
+ include_dirs = [ "include", "src/lib" ]
+}
@ -692,7 +658,10 @@ index 0000000000000000000000000000000000000000..fb1b3138cdb674205afa0ffe07827058
+ "_GNU_SOURCE",
+ ]
+ }
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ if (is_win) {
+ defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
+ include_dirs += [ "config/win32" ]
@ -710,23 +679,29 @@ index 0000000000000000000000000000000000000000..fb1b3138cdb674205afa0ffe07827058
+ } else {
+ defines += [ "HAVE_CONFIG_H" ]
+ }
+
-import("unofficial.gni")
+ if (is_linux) {
+ include_dirs += [ "config/linux" ]
+ sources += [ "config/linux/ares_config.h" ]
+ }
+
-cares_gn_build("cares") {
+ if (is_mac) {
+ include_dirs += [ "config/darwin" ]
+ sources += [ "config/darwin/ares_config.h" ]
+ }
+}
}
diff --git a/deps/googletest/BUILD.gn b/deps/googletest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2718021c9
--- /dev/null
index de13f3f653b5d53610f4611001c10dce332293c2..0daf8c006cef89e76d7eccec3e924bd2718021c9 100644
--- a/deps/googletest/BUILD.gn
+++ b/deps/googletest/BUILD.gn
@@ -0,0 +1,64 @@
@@ -1,14 +1,64 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("gtest_config") {
+ include_dirs = [ "include" ]
+ defines = [ "UNIT_TEST" ]
@ -739,13 +714,17 @@ index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2
+ ]
+
+ public_configs = [ ":gtest_config" ]
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ cflags_cc = [
+ "-Wno-c++98-compat-extra-semi",
+ "-Wno-unused-const-variable",
+ "-Wno-unreachable-code-return",
+ ]
+
-import("unofficial.gni")
+ defines = [
+ "GTEST_HAS_POSIX_RE=0",
+ "GTEST_LANG_CXX11=1",
@ -786,20 +765,28 @@ index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2
+ "src/gtest.cc",
+ ]
+}
+
-googletest_gn_build("googletest") {
+static_library("gtest_main") {
+ deps = [ ":gtest" ]
+ sources = [ "src/gtest_main.cc" ]
+}
}
diff --git a/deps/histogram/BUILD.gn b/deps/histogram/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..02bc887db7c8545e1d8adc57f73f203eec2f2592
--- /dev/null
index e2f3ee37137a6b7d45cbe79f8b9ba7f693ffc4d3..85467b372f01cf602af45fa2f0d599acabfc2310 100644
--- a/deps/histogram/BUILD.gn
+++ b/deps/histogram/BUILD.gn
@@ -0,0 +1,19 @@
@@ -1,14 +1,19 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("histogram_config") {
+ include_dirs = [ "include" ]
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ cflags = [
+ "-Wno-implicit-function-declaration",
+ "-Wno-incompatible-pointer-types",
@ -807,27 +794,39 @@ index 0000000000000000000000000000000000000000..02bc887db7c8545e1d8adc57f73f203e
+ "-Wno-atomic-alignment",
+ ]
+}
+
-import("unofficial.gni")
+static_library("histogram") {
+ public_configs = [ ":histogram_config" ]
+
-histogram_gn_build("histogram") {
+ sources = [
+ "src/hdr_histogram.c",
+ "src/hdr_histogram.h",
+ ]
+}
\ No newline at end of file
}
diff --git a/deps/llhttp/BUILD.gn b/deps/llhttp/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb7770d109
--- /dev/null
index 64a2a4799d5530276f46aa1faa63ece063390ada..fb000f8ee7647c375bc190d1729d67bb7770d109 100644
--- a/deps/llhttp/BUILD.gn
+++ b/deps/llhttp/BUILD.gn
@@ -0,0 +1,15 @@
@@ -1,14 +1,15 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
-
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
-
-import("unofficial.gni")
+config("llhttp_config") {
+ include_dirs = [ "include" ]
+ cflags = [ "-Wno-unreachable-code" ]
+}
+
-llhttp_gn_build("llhttp") {
+static_library("llhttp") {
+ include_dirs = [ "include" ]
+ public_configs = [ ":llhttp_config" ]
@ -837,13 +836,21 @@ index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb
+ "src/http.c",
+ "src/llhttp.c",
+ ]
+}
}
diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3124b2765
--- /dev/null
index 274352b0e2449f8db49d9a49c6b92a69f97e8363..7d2ca477db2415f43ababa270d8aefa3124b2765 100644
--- a/deps/nghttp2/BUILD.gn
+++ b/deps/nghttp2/BUILD.gn
@@ -0,0 +1,51 @@
@@ -1,14 +1,51 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
-
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+config("nghttp2_config") {
+ defines = [ "NGHTTP2_STATICLIB" ]
+ include_dirs = [ "lib/includes" ]
@ -857,7 +864,8 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
+ "HAVE_CONFIG_H",
+ ]
+ include_dirs = [ "lib/includes" ]
+
-import("unofficial.gni")
+ cflags_c = [
+ "-Wno-implicit-function-declaration",
+ "-Wno-implicit-fallthrough",
@ -865,7 +873,8 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
+ "-Wno-unreachable-code-return",
+ "-Wno-unused-but-set-variable",
+ ]
+
-nghttp2_gn_build("nghttp2") {
+ sources = [
+ "lib/nghttp2_buf.c",
+ "lib/nghttp2_callbacks.c",
@ -894,44 +903,81 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
+ "lib/nghttp2_version.c",
+ "lib/sfparse.c"
+ ]
+}
}
diff --git a/deps/simdjson/BUILD.gn b/deps/simdjson/BUILD.gn
index d0580ccf354d2000fb0075fd3bb4579f93477927..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/deps/simdjson/BUILD.gn
+++ b/deps/simdjson/BUILD.gn
@@ -1,14 +0,0 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
-
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
-
-import("unofficial.gni")
-
-simdjson_gn_build("simdjson") {
-}
diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..bfbd4e656db1a6c73048443f96f1d576a0df7519
--- /dev/null
index 119d49456911e99944294bd00b3f182a8f0e35b5..ce38c3633a228306622a7237067393d25332c59c 100644
--- a/deps/simdutf/BUILD.gn
+++ b/deps/simdutf/BUILD.gn
@@ -0,0 +1,20 @@
@@ -1,14 +1,21 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("simdutf_config") {
+ include_dirs = [ "." ]
+}
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+static_library("simdutf") {
+ include_dirs = [ "." ]
+ sources = [
+ "simdutf.cpp",
+ ]
+
-import("unofficial.gni")
+ public_configs = [ ":simdutf_config" ]
+
-simdutf_gn_build("simdutf") {
+ cflags_cc = [
+ "-Wno-ambiguous-reversed-operator",
+ "-Wno-c++98-compat-extra-semi",
+ "-Wno-unreachable-code",
+ "-Wno-unreachable-code-break",
+ "-Wno-unused-const-variable",
+ "-Wno-unused-function",
+ ]
+}
}
diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..7518168141db7958550c7f5dc1ed17ccdbbe4a60
--- /dev/null
index 8e6ac27048b5965e20f35c7a63e469beb6fa5970..7518168141db7958550c7f5dc1ed17ccdbbe4a60 100644
--- a/deps/uv/BUILD.gn
+++ b/deps/uv/BUILD.gn
@@ -0,0 +1,194 @@
@@ -1,14 +1,194 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("libuv_config") {
+ include_dirs = [ "include" ]
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ defines = []
+
-import("unofficial.gni")
+ if (is_linux) {
+ defines += [ "_POSIX_C_SOURCE=200112" ]
+ }
@ -1045,7 +1091,8 @@ index 0000000000000000000000000000000000000000..7518168141db7958550c7f5dc1ed17cc
+ "src/win/winsock.c",
+ "src/win/winsock.h",
+ ]
+
-uv_gn_build("uv") {
+ libs += [
+ "advapi32.lib",
+ "iphlpapi.lib",
@ -1120,13 +1167,17 @@ index 0000000000000000000000000000000000000000..7518168141db7958550c7f5dc1ed17cc
+ "src/unix/kqueue.c",
+ ]
+ }
+}
}
diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..d9fcf8dc972b1caa2b7a130b1144c685316035cd
--- /dev/null
index 4f8fb081df805a786e523e5f0ffbb0096fdeca99..d9fcf8dc972b1caa2b7a130b1144c685316035cd 100644
--- a/deps/uvwasi/BUILD.gn
+++ b/deps/uvwasi/BUILD.gn
@@ -0,0 +1,39 @@
@@ -1,14 +1,39 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("uvwasi_config") {
+ include_dirs = [ "include" ]
+}
@ -1146,14 +1197,19 @@ index 0000000000000000000000000000000000000000..d9fcf8dc972b1caa2b7a130b1144c685
+ }
+
+ deps = [ "../../deps/uv" ]
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ public_configs = [ ":uvwasi_config" ]
+
-import("unofficial.gni")
+ cflags_c = []
+ if (!is_win) {
+ cflags_c += [ "-fvisibility=hidden" ]
+ }
+
-uvwasi_gn_build("uvwasi") {
+ sources = [
+ "src/clocks.c",
+ "src/fd_table.c",
@ -1165,13 +1221,23 @@ index 0000000000000000000000000000000000000000..d9fcf8dc972b1caa2b7a130b1144c685
+ "src/wasi_rights.c",
+ "src/wasi_serdes.c"
+ ]
}
diff --git a/electron_node.gni b/electron_node.gni
new file mode 100644
index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1c4349223
--- /dev/null
+++ b/electron_node.gni
@@ -0,0 +1,4 @@
+declare_args() {
+ # Allows embedders to override the NODE_MODULE_VERSION define
+ node_module_version = ""
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf90892392d36
index 0000000000000000000000000000000000000000..4404338bb5d576b341cae3bf79c84334fb05654f
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,732 @@
@@ -0,0 +1,733 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
@ -1389,6 +1455,7 @@ index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf908
+ "lib/internal/blocklist.js",
+ "lib/internal/bootstrap/node.js",
+ "lib/internal/bootstrap/realm.js",
+ "lib/internal/bootstrap/shadow_realm.js",
+ "lib/internal/bootstrap/switches/does_not_own_process_state.js",
+ "lib/internal/bootstrap/switches/does_own_process_state.js",
+ "lib/internal/bootstrap/switches/is_main_thread.js",
@ -1492,6 +1559,7 @@ index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf908
+ "lib/internal/modules/helpers.js",
+ "lib/internal/modules/package_json_reader.js",
+ "lib/internal/modules/run_main.js",
+ "lib/internal/navigator.js",
+ "lib/internal/net.js",
+ "lib/internal/options.js",
+ "lib/internal/per_context/domexception.js",
@ -1540,7 +1608,6 @@ index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf908
+ "lib/internal/source_map/source_map_cache.js",
+ "lib/internal/stream_base_commons.js",
+ "lib/internal/streams/add-abort-signal.js",
+ "lib/internal/streams/buffer_list.js",
+ "lib/internal/streams/compose.js",
+ "lib/internal/streams/destroy.js",
+ "lib/internal/streams/duplex.js",
@ -1557,7 +1624,6 @@ index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf908
+ "lib/internal/streams/transform.js",
+ "lib/internal/streams/utils.js",
+ "lib/internal/streams/writable.js",
+ "lib/internal/structured_clone.js",
+ "lib/internal/test/binding.js",
+ "lib/internal/test/transfer.js",
+ "lib/internal/test_runner/coverage.js",
@ -1566,6 +1632,7 @@ index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf908
+ "lib/internal/test_runner/mock/mock_timers.js",
+ "lib/internal/test_runner/reporter/dot.js",
+ "lib/internal/test_runner/reporter/junit.js",
+ "lib/internal/test_runner/reporter/lcov.js",
+ "lib/internal/test_runner/reporter/spec.js",
+ "lib/internal/test_runner/reporter/tap.js",
+ "lib/internal/test_runner/reporter/v8-serializer.js",
@ -1904,26 +1971,24 @@ index 0000000000000000000000000000000000000000..cf88cae11d5fe0f4436688d41f4bf908
+ "deps/postject/postject-api.h"
+ ]
+}
diff --git a/node.gni b/node.gni
new file mode 100644
index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1c4349223
--- /dev/null
+++ b/node.gni
@@ -0,0 +1,4 @@
+declare_args() {
+ # Allows embedders to override the NODE_MODULE_VERSION define
+ node_module_version = ""
+}
diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868bd1321be2
--- /dev/null
index 909fd14345fcd988c381e640280f4b33f2e0c351..cb0e4558436ab7a109cadf439d49413b0f569a5a 100644
--- a/src/inspector/BUILD.gn
+++ b/src/inspector/BUILD.gn
@@ -0,0 +1,200 @@
@@ -1,14 +1,203 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+import("//v8/gni/v8.gni")
+
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+inspector_protocol_dir = "../../tools/inspector_protocol"
+
-import("unofficial.gni")
+_protocol_generated = [
+ "protocol/Forward.h",
+ "protocol/Protocol.cpp",
@ -1935,7 +2000,8 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
+ "protocol/NodeRuntime.cpp",
+ "protocol/NodeRuntime.h",
+]
+
-inspector_gn_build("inspector") {
+# These are from node_protocol_config.json
+# These convoluted path hacks are to work around the fact that node.js is very
+# confused about what paths are in its includes, without changing node at all.
@ -1982,7 +2048,10 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
+ "../../deps/simdutf",
+ "//third_party/icu:icuuc",
+ ]
+ configs += [ "../..:node_internal_config" ]
+ configs += [
+ "../..:node_internal_config",
+ "../..:node_lib_config",
+ ]
+ public_configs = [ ":inspector_config" ]
+}
+
@ -2119,12 +2188,12 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
+ ]
+ script = "../../tools/compress_json.py"
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
}
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 84815969b6d1faa7cc3ed177e04248d9cb074596..80b36dc1aefca4d5d4124d7f84b12b9762a8de2c 100644
index bafd8d4b8581f0aee6cb1f30b810c8dfc46c2ce9..453d874efff767a95ef25fad7005ac11717f0c67 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -738,6 +738,7 @@ void BuiltinLoader::RegisterExternalReferences(
@@ -739,6 +739,7 @@ void BuiltinLoader::RegisterExternalReferences(
registry->Register(GetNatives);
RegisterExternalReferencesForInternalizedBuiltinCode(registry);