mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
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:
@@ -73,6 +73,7 @@ log = "0.4"
|
||||
metrics = "0.24"
|
||||
metrics-util = "0.19"
|
||||
moka = { version = "0.12", features = ["future"] }
|
||||
napi = { version = "3.15.0", default-features = false }
|
||||
object_store = "0.14.1"
|
||||
pin-project = "1.0.7"
|
||||
prost = "0.14"
|
||||
|
||||
+5
-1
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user