fix(release): stop shipping native modules built for the wrong runtime
Some checks failed
deploy-site / deploy (push) Failing after 14m16s

The released installer could not start: it carried a better-sqlite3 build for the
host Node runtime instead of Electron, so the app died immediately with a module
version mismatch when it opened its database.

Packaging now proves the Electron build of every runtime-sensitive native module
before an installer or archive exists, and installers are produced only from that
verified tree, so the mistake cannot pass silently. The release pipelines run the
same check.

The default local model also pointed at a retired model: a *.gguf name that
Ollama cannot serve, while the settings, onboarding, and guide screens
recommended an older model. All of them now use the model the service code
already preferred.
This commit is contained in:
Yun Chan 2026-09-18 15:45:03 +09:00
parent 0fbbbc1756
commit 1af3cf75c7
42 changed files with 473 additions and 83 deletions

View file

@ -78,6 +78,20 @@ if (!existsSync(join(desktopDir, 'sidecar-dist', 'sidecar'))) {
process.exit(1)
}
/** 현재 스크립트와 같은 Node로 CI 스크립트를 실행한다 */
function runNodeScript(relativePath, scriptArgs) {
console.log(`[portable] $ node ${relativePath} ${scriptArgs.join(' ')}`)
const result = spawnSync(
process.execPath,
[join(root, relativePath), ...scriptArgs],
{ cwd: root, stdio: 'inherit' },
)
if (result.status !== 0) {
console.error(`[portable] ${relativePath} 실패 (exit ${result.status ?? 'null'})`)
process.exit(result.status ?? 1)
}
}
function resolve7za() {
// electron-builder가 의존하는 7zip-bin이 플랫폼별 7za 실행 파일을 제공한다.
const platformDir =
@ -128,6 +142,11 @@ if (!existsSync(appDir)) {
process.exit(1)
}
// 네이티브 모듈 ABI 사고 방지: 호스트 Node ABI로 빌드된 모듈이 섞이면 설치본이 시작조차 못 한다.
// (실측 사고: better_sqlite3.node가 NODE_MODULE_VERSION 131 → Electron 130 요구)
runNodeScript('scripts/ci/fix-native-abi.mjs', ['--dir', appDir])
runNodeScript('scripts/ci/verify-native-abi.mjs', ['--dir', appDir])
// 이전 볼륨 정리 (같은 버전 재드 시 잔여 볼륨이 섞이지 않도록)
for (const name of readdirSync(releaseDir)) {
if (name.startsWith(ARCHIVE_BASE)) {
@ -251,6 +270,9 @@ const zipBuild = spawnSync(
'npx',
[
'electron-builder',
// 검증된 트리에서 바로 패키징한다(ne ABI가 확실한 디렉토리만 사용).
'--prepackaged',
appDir,
'--win',
'zip',
'--x64',