Skip to content

Commit 7982a4d

Browse files
committed
ci: add electron-rebuild for better-sqlite3 in Linux/arm64 builds
- Add Rebuild native modules for Electron step after npm install in ci-electron.yml and release-electron.yml to fix 'cannot open shared object file' on arm64 Debian (better-sqlite3 must be built for Electron's Node ABI). - Add npm script electron-rebuild in agent-electron-client package.json. Made-with: Cursor
1 parent 5010a4e commit 7982a4d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.github/workflows/ci-electron.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ jobs:
107107
working-directory: crates/agent-electron-client
108108
run: npm install
109109

110+
# 为 Electron 内嵌 Node 重编 better-sqlite3,避免 Linux arm64 等平台运行时 "cannot open shared object file"
111+
- name: Rebuild native modules for Electron
112+
working-directory: crates/agent-electron-client
113+
run: npm run electron-rebuild
114+
110115
- name: Run unit tests
111116
working-directory: crates/agent-electron-client
112117
run: npm run test:run

.github/workflows/release-electron.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ jobs:
137137
working-directory: crates/agent-electron-client
138138
run: npm install
139139

140+
# 为 Electron 内嵌 Node 重编 better-sqlite3,避免 Linux arm64 等平台运行时 "cannot open shared object file"
141+
- name: Rebuild native modules for Electron
142+
working-directory: crates/agent-electron-client
143+
run: npm run electron-rebuild
144+
140145
- name: Run unit tests
141146
working-directory: crates/agent-electron-client
142147
run: npm run test:run

crates/agent-electron-client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"check-ports": "node scripts/tools/check-startup-ports.js",
2727
"check-ports:dev": "node scripts/tools/check-startup-ports.js --vite",
2828
"prepare:all": "npm run prepare:uv && npm run prepare:sign-uv && npm run prepare:lanproxy && npm run prepare:node && npm run prepare:git",
29+
"electron-rebuild": "electron-rebuild -f -w better-sqlite3",
2930
"build:electron": "npm run build && npm run prepare:all && electron-builder --config.compression=maximum",
3031
"dist": "npm run build:electron -- --mac",
3132
"dist:mac": "npm run build:electron -- --mac",

0 commit comments

Comments
 (0)