You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sea-napi-binding: address review — sql-kernel rename, loader class + DI seam, packaging, tests
Rebuilds native/sea against the merged kernel main (binding renamed
@databricks/sea-native -> @databricks/sql-kernel via kernel #82) and
addresses the /full-review findings on PR #380:
- C1: commit the napi-rs router (native/sea/index.js, un-ignored) + a
prepack assertion so the publish tarball can never ship without it.
Companion kernel fix (databricks-sql-kernel#93) corrects the base
package name so the router require paths resolve.
- C2: drop the @sea-native tsconfig path alias; use a relative import
so no unresolvable specifier leaks into the emitted .d.ts.
- C3/C11: error hints no longer name a 404-ing package; dlopen hint now
includes the underlying dlerror string + concrete remediation.
- C4: document M0 = linux-x64-gnu-only scope + npm scope-lock note.
- C5: SeaNativeBinding = typeof import('../../native/sea') (no drift).
- C6: SeaNativeLoader is now a class with an injectable load seam;
getSeaNative/tryGetSeaNative are thin process-global wrappers.
- C7: re-exports renamed Sea* to avoid colliding with Thrift types.
- C8: version.test.ts fails loud on the linux-x64 CI runner + shape
checks; new loader.test.ts covers the hint branches, Node gate,
shape check, and caching via the injected seam.
- C9: Node-version guard fails closed (NaN or < floor).
- C13: e2e smoke uses the shared tests/e2e/utils/config.ts creds.
- C10/C12 are resolved upstream in merged kernel main / deferred to M1.
index.d.ts regenerated from merged main: ExecuteOptions dropped
(catalog/schema/sessionConf are session-level on openSession),
close() awaits DeleteSession, schema() is sync, sessionId/statementId
getters added.
Verified: 11 unit tests; e2e SELECT 1 against a live warehouse, direct
and through mitmproxy (SEA REST: POST /sql/sessions -> POST
/sql/statements -> DELETE /sql/sessions/<id>).
Co-authored-by: Isaac
// not the bare `${platform}` shown here, so a literal example would
73
+
// 404. Point at the README's supported-triple list instead.
74
+
constinstallHint=
75
+
'Install the matching @databricks/sql-kernel-* optional dependency for your platform '+
76
+
'(see native/sea/README.md for the supported triples; M0 ships linux-x64-gnu only).';
56
77
if(err.code==='MODULE_NOT_FOUND'){
57
78
return`SEA native binding not installed for platform ${platform} on Node ${process.version}. ${installHint}`;
58
79
}
59
80
if(err.code==='ERR_DLOPEN_FAILED'){
60
-
return`SEA native binding present but failed to dlopen on platform ${platform} / Node ${process.version} — likely a libc or Node ABI mismatch. The binding requires Node >=${MIN_NODE_MAJOR}.`;
81
+
// Surface the underlying dlerror string (e.g. `GLIBC_2.32 not found`)
82
+
// plus concrete remediation — without it the cause is invisible.
83
+
return(
84
+
`SEA native binding present but failed to dlopen on platform ${platform} / Node ${process.version}: `+
85
+
`${err.message}. Common causes: glibc/musl mismatch (e.g. Alpine Linux — install the -musl variant), `+
86
+
`Node ABI mismatch (try \`rm -rf node_modules && npm install\`), or CPU-architecture mismatch. `+
87
+
`The binding requires Node >=${MIN_NODE_MAJOR}.`
88
+
);
61
89
}
62
90
return`SEA native binding failed to load on platform ${platform} / Node ${process.version}: ${err.message}`;
63
91
}
64
92
65
-
letcached: SeaNativeBinding|null|undefined;
66
-
letcachedError: Error|undefined;
93
+
/**
94
+
* Default loader: resolves `native/sea/index.js` (the napi-rs router),
95
+
* which selects the per-platform `.node`. `.js` is omitted so eslint's
0 commit comments