fix(node): link standalone Rust tests without Node (#5321)

The Node binding's Rust tests construct and drop `napi::Error`. Its
cleanup code references Node-API symbols, which Node supplies when it
loads the addon. Standalone Rust test executables have no Node host, so
`lancedb-nodejs` fails at link time. [Linux
`build-no-lock`](https://github.com/lancedb/lancedb/actions/runs/46573309068/job/142389591633)
· [macOS 15 `--locked` test
job](https://github.com/lancedb/lancedb/actions/runs/46574143498/job/142392302720)

Enable napi-rs `dyn-symbols` through the dev dependency. Cargo activates
it when building the existing Rust tests and uses the original linkage
for ordinary addon builds.

On `08911d637`, deleting `Cargo.lock` and running `cargo +stable build
--profile ci --all-features --tests -p lancedb-nodejs --jobs 2`
reproduced the three missing symbols. With the same freshly resolved
dependencies, `cargo +stable test --profile ci --all-features --tests -p
lancedb-nodejs --jobs 2` linked and passed all 10 tests, including the
cause chain and resource metadata assertions.

---------

Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Xuanwo
2026-12-01 13:16:02 +08:00
committed by GitHub
parent 08911d6378
commit 4e7d5c0d1a
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -23,7 +23,7 @@ env_logger.workspace = true
futures.workspace = true
lancedb.workspace = true
lance-namespace.workspace = true
napi = { version = "3.15.0", default-features = false, features = [
napi = { workspace = true, features = [
"napi9",
"async",
"chrono_date",
@@ -45,6 +45,10 @@ aws-lc-rs = "=1.18.1"
[build-dependencies]
napi-build = "2.3.1"
[dev-dependencies]
# Standalone Rust test binaries have no Node host to resolve Node-API symbols.
napi = { workspace = true, features = ["dyn-symbols"] }
[features]
default = ["remote", "lancedb/aws", "lancedb/gcs", "lancedb/azure", "lancedb/dynamodb", "lancedb/oss", "lancedb/huggingface", "lancedb/goosefs", "lancedb/metrics-otel", "lancedb/geo"]
fp16kernels = ["lancedb/fp16kernels"]