fix(desktop): upgrade better-sqlite3 to 13 so the Electron 43 installer builds and opens its database
better-sqlite3 12.8.0 has no prebuild for Electron 43 (ABI 148) and does not compile against its V8 API, so the v1.18.0 installer build stopped in fix-native-abi and was never published. 13.2.0 ships Node-API prebuilds in the package; one binary runs on Node and Electron. - fix-native-abi.mjs: nothing to swap when the packaged module is a Node-API prebuild. - verify-native-abi.mjs: require the target prebuild, fail on a shadowing build/Release binary, and open a database through the packaged module. - electron-builder: leave out the linux prebuilds we do not ship. Verified: desktop 2,933 tests on Node 24, and WAL/transaction/FTS5 queries in an Electron 43.8.10 main process.
This commit is contained in:
parent
a117bc0d09
commit
fb5f76f57f
9 changed files with 88 additions and 255 deletions
|
|
@ -51,6 +51,18 @@ const targetBinary = inPlace
|
|||
? join(root, relativeBinary)
|
||||
: join(packagedDir, 'resources', 'app.asar.unpacked', relativeBinary)
|
||||
|
||||
// better-sqlite3 13 부터는 Node-API 프리빌드(prebuilds/<platform>-<arch>.node)가 패키지에 들어 있다.
|
||||
// Node-API 바이너리는 런타임 ABI(NODE_MODULE_VERSION)에 묶이지 않아 Node 와 Electron 이 같은 파일을 쓴다 —
|
||||
// 교체할 것이 없다. (12 이하는 Electron 43(ABI 148)용 프리빌드가 없고 소스 빌드도 V8 API 변경으로 실패한다.)
|
||||
const moduleRoot = inPlace
|
||||
? join(root, 'node_modules', 'better-sqlite3')
|
||||
: join(packagedDir, 'resources', 'app.asar.unpacked', 'node_modules', 'better-sqlite3')
|
||||
const napiPrebuild = join(moduleRoot, 'prebuilds', `${process.platform}-${arch}.node`)
|
||||
if (!existsSync(targetBinary) && existsSync(napiPrebuild)) {
|
||||
console.log(`[native-abi] better-sqlite3 는 Node-API 프리빌드입니다 — ABI 교체 불필요 (${napiPrebuild})`)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
if (!existsSync(targetBinary)) {
|
||||
console.error(`[native-abi] 패키징 트리에 better-sqlite3 바이너리가 없습니다: ${targetBinary}`)
|
||||
process.exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue