| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The Rust binding source lives in the kernel repo at databricks-sql-kernel/napi/. Building it requires a local checkout of that repo — see "Build for local dev" below. The published npm package is @databricks/databricks-sql-kernel-<triple>.
The napi crate is a standalone Cargo workspace ([workspace] members = ["."] in napi/Cargo.toml), not a sibling of pyo3/ in the kernel root workspace.
The reason is Cargo feature unification. pyo3 builds the kernel with the default tls-native feature (system OpenSSL via native-tls). The napi crate has to opt INTO tls-rustls instead: napi modules are loaded into Node.js processes that statically link OpenSSL 3.x, and dynamically linking the system's OpenSSL 1.1 (which native-tls pulls in on Linux) collides with Node's symbols at module-load time and segfaults the process before any Rust code runs. rustls is pure Rust + ring and avoids the conflict entirely.
If napi lived in the same workspace as pyo3, cargo build --workspace would unify the kernel's feature set to tls-native ∪ tls-rustls, link both TLS stacks into the resulting napi cdylib, and reintroduce the same clash. Standalone-workspace is the fix.
# From the nodejs repo root:
export DATABRICKS_SQL_KERNEL_REPO=/path/to/your/databricks-sql-kernel
npm run build:native # release build (default)
BUILD_PROFILE= npm run build:native # debug build (empty BUILD_PROFILE drops --release)DATABRICKS_SQL_KERNEL_REPO points at the kernel repo root (the directory containing napi/) and is required when your kernel checkout isn't at ../../databricks-sql-kernel relative to the nodejs repo.
At release time the kernel's CI publishes @databricks/databricks-sql-kernel-<triple> npm packages — one per supported platform — each containing a single .node binary. native/kernel/index.js (the napi-rs router) require()s the package matching the consumer's process.platform / process.arch at load time.
Status: the per-platform packages are published on npm (kernel 0.2.0) and declared in the driver's optionalDependencies, pinned to that exact version. npm install resolves only the package matching the consumer's process.platform / process.arch; the others are skipped (that is what optionalDependencies tolerates), so installing on an unsupported platform does not fail. Local development can still override the installed binary with npm run build:native, which copies a freshly built index.<triple>.node into this directory — the router prefers that local file over the installed package.
The driver declares all eight published triples in optionalDependencies:
On any other platform (e.g. linux-arm gnueabihf, riscv64, s390x, FreeBSD) the kernel binding is simply absent: KernelNativeLoader returns undefined from tryGet() / throws a structured MODULE_NOT_FOUND hint from get(), and the driver continues to use the Thrift backend exclusively. This is expected, not a regression — additional triples are added to optionalDependencies as the kernel CI starts publishing them.
The triple names not yet built/published (…-linux-arm-gnueabihf, …-riscv64-gnu, etc.) referenced by the router boilerplate are not squat-able: @databricks is a Databricks-owned npm scope, and npm only allows org members to publish under a scope it owns. A third party therefore cannot register @databricks/databricks-sql-kernel-* and have the router autoload it. No placeholder packages are required.
| Back | FazBrowse Home | New Git URL |