fix: missing SQLite builtin support in Node.js (#47706)

https://github.com/nodejs/node/pull/58122
This commit is contained in:
Shelley Vohr 2025-07-15 15:39:16 +02:00 committed by GitHub
commit 17dba93587
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 19 deletions

View file

@ -24,7 +24,7 @@ index 4560bac7b8e3c707ecea5a425f642efb9de9ed36..e9c2a4391f4058a21a259cacaac4fde5
o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
diff --git a/node.gni b/node.gni
index 35ccd0487f20cece033d58827ecb7ed016908ee4..b4450e3dd17994d1eaf59eb5cff5912545e89793 100644
index 35ccd0487f20cece033d58827ecb7ed016908ee4..62cd49c6a87074912a1cb6792576c8d4f239b669 100644
--- a/node.gni
+++ b/node.gni
@@ -5,10 +5,10 @@
@ -40,7 +40,15 @@ index 35ccd0487f20cece033d58827ecb7ed016908ee4..b4450e3dd17994d1eaf59eb5cff59125
# The location of OpenSSL - use the one from node's deps by default.
node_openssl_path = "$node_path/deps/openssl"
@@ -44,7 +44,7 @@ declare_args() {
@@ -39,12 +39,15 @@ declare_args() {
# The variable is called "openssl" for parity with node's GYP build.
node_use_openssl = true
+ # Build node with SQLite support.
+ node_use_sqlite = true
+
# 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 = ""
# Initialize v8 platform during node.js startup.
@ -49,7 +57,7 @@ index 35ccd0487f20cece033d58827ecb7ed016908ee4..b4450e3dd17994d1eaf59eb5cff59125
# Custom build tag.
node_tag = ""
@@ -64,10 +64,16 @@ declare_args() {
@@ -64,10 +67,16 @@ declare_args() {
# TODO(zcbenz): There are few broken things for now:
# 1. cross-os compilation is not supported.
# 2. node_mksnapshot crashes when cross-compiling for x64 from arm64.
@ -271,10 +279,22 @@ index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd1
if sys.platform == 'win32':
files = [ x.replace('\\', '/') for x in files ]
diff --git a/unofficial.gni b/unofficial.gni
index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187f3c04c5c 100644
index 44641b92678ab2f28e6f5de75a92878f9f3d322d..a6cfd45b109c7b38fcf1529468ff64d3c1c8bd1b 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -142,32 +142,42 @@ template("node_gn_build") {
@@ -22,6 +22,11 @@ template("node_gn_build") {
} else {
defines += [ "HAVE_OPENSSL=0" ]
}
+ if (node_use_sqlite) {
+ defines += [ "HAVE_SQLITE=1" ]
+ } else {
+ defines += [ "HAVE_SQLITE=0" ]
+ }
if (node_use_amaro) {
defines += [ "HAVE_AMARO=1" ]
} else {
@@ -142,32 +147,41 @@ template("node_gn_build") {
public_configs = [
":node_external_config",
"deps/googletest:googletest_config",
@ -297,7 +317,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187
"deps/nghttp2",
- "deps/ngtcp2",
"deps/postject",
"deps/sqlite",
- "deps/sqlite",
"deps/uvwasi",
- "deps/zstd",
"//third_party/zlib",
@ -320,7 +340,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187
"$target_gen_dir/node_javascript.cc",
] + gypi_values.node_sources
@@ -190,7 +200,7 @@ template("node_gn_build") {
@@ -190,9 +204,13 @@ template("node_gn_build") {
}
if (node_use_openssl) {
deps += [ "deps/ncrypto" ]
@ -328,8 +348,14 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187
+ public_deps += [ "//third_party/boringssl" ]
sources += gypi_values.node_crypto_sources
}
+ if (node_use_sqlite) {
+ deps += [ "deps/sqlite" ]
+ sources += gypi_values.node_sqlite_sources
+ }
if (node_enable_inspector) {
@@ -214,6 +224,10 @@ template("node_gn_build") {
deps += [
"src/inspector:crdtp",
@@ -214,6 +232,10 @@ template("node_gn_build") {
}
}
@ -340,7 +366,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187
executable(target_name) {
forward_variables_from(invoker, "*")
@@ -288,6 +302,7 @@ template("node_gn_build") {
@@ -288,6 +310,7 @@ template("node_gn_build") {
}
executable("node_js2c") {
@ -348,7 +374,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187
deps = [
"deps/uv",
"$node_simdutf_path",
@@ -298,26 +313,75 @@ template("node_gn_build") {
@@ -298,26 +321,75 @@ template("node_gn_build") {
"src/embedded_data.cc",
"src/embedded_data.h",
]
@ -434,7 +460,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187
outputs = [ "$target_gen_dir/node_javascript.cc" ]
# Get the path to node_js2c executable of the host toolchain.
@@ -331,11 +395,11 @@ template("node_gn_build") {
@@ -331,11 +403,11 @@ template("node_gn_build") {
get_label_info(":node_js2c($host_toolchain)", "name") +
host_executable_suffix