Skip to content

Commit ef63c69

Browse files
committed
fix(sea): align napi package name to @databricks/databricks-sql-kernel-*
Same alignment as the logging PR: kernel #131/#135 renamed the published napi package @databricks/sql-kernel -> @databricks/databricks-sql-kernel. Update the packaging test, version-test hint, SeaNativeLoader install hint, and README to match the regenerated router, fixing the native-packaging unit tests under the KERNEL_REV bump to kernel main 80b68e1. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent 7f7784e commit ef63c69

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

lib/sea/SeaNativeLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* Mirrors the load-failure-tolerant pattern of `lib/utils/lz4.ts`: the
1919
* `.node` artifact ships via per-platform optional dependencies
20-
* (`@databricks/sql-kernel-<triple>`), so its absence must not crash
20+
* (`@databricks/databricks-sql-kernel-<triple>`), so its absence must not crash
2121
* a Thrift-only consumer of the driver. Callers that actually need
2222
* SEA construct a {@link SeaNativeLoader} (or use the process-global
2323
* {@link getSeaNative}) which throws a structured error if the binding
@@ -104,7 +104,7 @@ function loadFailureHint(err: NodeJS.ErrnoException): string {
104104
// not the bare `${platform}` shown here, so a literal example would
105105
// 404. Point at the README's supported-triple list instead.
106106
const installHint =
107-
'Install the matching @databricks/sql-kernel-* optional dependency for your platform ' +
107+
'Install the matching @databricks/databricks-sql-kernel-* optional dependency for your platform ' +
108108
'(see native/sea/README.md for the supported triples; M0 ships linux-x64-gnu only).';
109109
if (err.code === 'MODULE_NOT_FOUND') {
110110
return `SEA native binding not installed for platform ${platform} on Node ${process.version}. ${installHint}`;

native/sea/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**The Rust binding source lives in the kernel repo** at
44
`databricks-sql-kernel/napi/`. Building it requires a local checkout
55
of that repo — see "Build for local dev" below. The published npm
6-
package is `@databricks/sql-kernel-<triple>`.
6+
package is `@databricks/databricks-sql-kernel-<triple>`.
77

88
## Workspace topology
99

@@ -33,10 +33,10 @@ and reintroduce the same clash. Standalone-workspace is the fix.
3333
- `index.js` — napi-rs's per-platform router shim. Gitignored;
3434
populated by `npm run build:native` for local dev. In published
3535
tarballs it ships alongside the `.d.ts` and `require()`s the
36-
right `@databricks/sql-kernel-<triple>` optional dependency.
36+
right `@databricks/databricks-sql-kernel-<triple>` optional dependency.
3737
- `index.*.node` — the actual native binary, one per platform.
3838
Gitignored. In production these live in the per-triple optional
39-
dependencies (`@databricks/sql-kernel-linux-x64-gnu`, etc.); for
39+
dependencies (`@databricks/databricks-sql-kernel-linux-x64-gnu`, etc.); for
4040
local dev `npm run build:native` copies one into this directory.
4141

4242
## Build for local dev
@@ -56,7 +56,7 @@ nodejs repo.
5656
## Production load path
5757

5858
At release time the kernel's CI publishes
59-
`@databricks/sql-kernel-<triple>` npm packages — one per supported
59+
`@databricks/databricks-sql-kernel-<triple>` npm packages — one per supported
6060
platform — each containing a single `.node` binary. `native/sea/index.js`
6161
(the napi-rs router) `require()`s the package matching the consumer's
6262
`process.platform` / `process.arch` at load time.
@@ -68,13 +68,13 @@ platform — each containing a single `.node` binary. `native/sea/index.js`
6868
> unpublished package would break every install.) Until they ship, the
6969
> binding is produced locally via `npm run build:native` (which copies
7070
> `index.<triple>.node` into this directory). Once the packages are
71-
> published, add `@databricks/sql-kernel-<triple>` back to
71+
> published, add `@databricks/databricks-sql-kernel-<triple>` back to
7272
> `optionalDependencies` — npm then installs only the matching one.
7373
7474
## Supported platforms (M0)
7575

7676
M0 targets a **single** triple: **`linux-x64-gnu`** (package
77-
`@databricks/sql-kernel-linux-x64-gnu`, once published).
77+
`@databricks/databricks-sql-kernel-linux-x64-gnu`, once published).
7878

7979
On every other platform (macOS, Windows, linux-arm64, linux-x64-musl
8080
/ Alpine, …) the SEA binding is simply absent: `SeaNativeLoader`
@@ -86,9 +86,9 @@ CI starts publishing them in later milestones.
8686

8787
## Supply-chain note
8888

89-
The unpublished triple names (`@databricks/sql-kernel-darwin-arm64`,
89+
The unpublished triple names (`@databricks/databricks-sql-kernel-darwin-arm64`,
9090
`…-win32-x64-msvc`, etc.) referenced by the router are **not**
9191
squat-able: `@databricks` is a Databricks-owned npm scope, and npm
9292
only allows org members to publish under a scope it owns. A third
93-
party therefore cannot register `@databricks/sql-kernel-*` and have
93+
party therefore cannot register `@databricks/databricks-sql-kernel-*` and have
9494
the router autoload it. No placeholder packages are required.

tests/unit/sea/native-packaging.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { join } from 'path';
2121
// (e.g. `@databricks/sea-native-linux-x64-gnu-darwin-arm64`, and the doubled
2222
// `@databricks/sea-native-linux-x64-gnu-linux-x64-gnu`), so a published
2323
// install would never resolve a `.node`. The canonical name is
24-
// `@databricks/sql-kernel-<triple>` (see native/sea/README.md and the
24+
// `@databricks/databricks-sql-kernel-<triple>` (see native/sea/README.md and the
2525
// SeaNativeLoader load-failure hint).
2626
describe('SEA native binding — packaging (native/sea/index.js)', () => {
2727
// Resolved from the repo root (the cwd for `npm test`) so the test does not
@@ -35,8 +35,8 @@ describe('SEA native binding — packaging (native/sea/index.js)', () => {
3535
expect(required.length, 'no @databricks/* require() found in the router').to.be.greaterThan(0);
3636
});
3737

38-
it('every npm fallback uses the canonical @databricks/sql-kernel-<triple> name', () => {
39-
const triple = /^@databricks\/sql-kernel-[a-z0-9]+(-[a-z0-9]+)*$/;
38+
it('every npm fallback uses the canonical @databricks/databricks-sql-kernel-<triple> name', () => {
39+
const triple = /^@databricks\/databricks-sql-kernel-[a-z0-9]+(-[a-z0-9]+)*$/;
4040
for (const name of required) {
4141
expect(name, `unexpected SEA native package name: ${name}`).to.match(triple);
4242
}
@@ -47,9 +47,9 @@ describe('SEA native binding — packaging (native/sea/index.js)', () => {
4747
expect(indexJs, 'router still doubles the linux-x64-gnu triple').to.not.contain('linux-x64-gnu-linux-x64-gnu');
4848
});
4949

50-
it('resolves the M0 linux-x64-gnu triple to @databricks/sql-kernel-linux-x64-gnu', () => {
50+
it('resolves the M0 linux-x64-gnu triple to @databricks/databricks-sql-kernel-linux-x64-gnu', () => {
5151
expect(required, 'M0 supported triple package missing from the router').to.include(
52-
'@databricks/sql-kernel-linux-x64-gnu',
52+
'@databricks/databricks-sql-kernel-linux-x64-gnu',
5353
);
5454
});
5555
});

tests/unit/sea/version.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { expect } from 'chai';
1616
import { tryGetSeaNative } from '../../../lib/sea/SeaNativeLoader';
1717

1818
// Fail loudly only when the binding is actually expected to be present —
19-
// i.e. a CI step has provisioned it (a published `@databricks/sql-kernel-*`
19+
// i.e. a CI step has provisioned it (a published `@databricks/databricks-sql-kernel-*`
2020
// optional dep installed, or `npm run build:native` was run) and opts in via
2121
// `SEA_NATIVE_EXPECTED=1`. A missing binding there is a real packaging / build
2222
// regression that a silent skip would mask.
@@ -37,7 +37,7 @@ describe('SEA native binding — smoke test', function smoke() {
3737
it('fails loudly: the binding must load on the linux-x64 CI runner', () => {
3838
expect.fail(
3939
'SEA native binding failed to load on a linux-x64 CI runner where ' +
40-
'@databricks/sql-kernel-linux-x64-gnu is expected. Run `npm run build:native` or check packaging.',
40+
'@databricks/databricks-sql-kernel-linux-x64-gnu is expected. Run `npm run build:native` or check packaging.',
4141
);
4242
});
4343
return;

0 commit comments

Comments
 (0)