mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-23 20:22:37 +00:00
## Summary - inspect the assembled x64 musl addon for the unresolved AVX-512 distance-table symbol before npm publication - fail the publish lifecycle with an actionable error if the broken symbol is present - add regression coverage using the dynamic-symbol output from the affected 0.27.x artifact ## Root cause LanceDB 0.27.x could enable the Rust AVX-512 distance-table callsite when the separate C kernel build did not emit its object, leaving `sum_4bit_dist_table_32bytes_batch_avx512` undefined in the musl addon. The current Lance dependency includes the upstream split-kernel cfg fix, and the published 0.33.0 musl artifact no longer has the undefined symbol, but the LanceDB publish path did not verify that property before releasing an addon. This adds a release guard around the corrected implementation so the same invalid binary cannot be published again. ## Validation - `pnpm lint` - `pnpm run build` - `pnpm test --runInBand` (680 passed, 5 skipped) - `pnpm run docs` - checked published artifacts: 0.27.1 is rejected for the unresolved symbol; 0.33.0 is accepted Fixes #3200 <!-- lance-gatekeeper-fix:v1 agent=4094b9b6de4b43665a9ff50fa35322fb generation=1 --> Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
|
|
const {
|
|
checkNativeBinary,
|
|
findForbiddenUndefinedSymbols,
|
|
} = require("../scripts/check-native-symbols.js");
|
|
|
|
test("detects the unresolved AVX-512 symbol from broken musl binaries", () => {
|
|
const output = [
|
|
" U napi_create_function",
|
|
" U sum_4bit_dist_table_32bytes_batch_avx512",
|
|
" U strlen",
|
|
].join("\n");
|
|
|
|
expect(findForbiddenUndefinedSymbols(output)).toEqual([
|
|
"sum_4bit_dist_table_32bytes_batch_avx512",
|
|
]);
|
|
});
|
|
|
|
test("accepts native binaries without unresolved internal Lance symbols", () => {
|
|
const runNm = jest.fn(() => ({
|
|
status: 0,
|
|
stdout:
|
|
" U napi_create_function\n U strlen\n",
|
|
stderr: "",
|
|
}));
|
|
|
|
expect(() => checkNativeBinary("lancedb.node", runNm)).not.toThrow();
|
|
expect(runNm).toHaveBeenCalledWith(
|
|
"nm",
|
|
["-D", "--undefined-only", "lancedb.node"],
|
|
{ encoding: "utf8" },
|
|
);
|
|
});
|
|
|
|
test("rejects native binaries with the unresolved AVX-512 symbol", () => {
|
|
const runNm = jest.fn(() => ({
|
|
status: 0,
|
|
stdout: " U sum_4bit_dist_table_32bytes_batch_avx512\n",
|
|
stderr: "",
|
|
}));
|
|
|
|
expect(() => checkNativeBinary("lancedb.node", runNm)).toThrow(
|
|
"lancedb.node contains unresolved internal Lance symbols: sum_4bit_dist_table_32bytes_batch_avx512",
|
|
);
|
|
});
|