Skip to content

Commit 7e351e2

Browse files
imsyyclaude
andcommitted
🐞 fix(build): 各架构独立构建,修复 native 模块架构错配导致的加载失败 (#1086)
electron-builder 配置此前为每个 target 写死 arch: [x64, arm64],导致 CI 中每个单架构 job 实际同时打两个架构,但 native 模块(Rust .node 与 better-sqlite3)只按宿主架构编译,另一架构的包因此塞入了错误架构的 .node(表现为 'is not a valid Win32 application')。移除写死的 arch,改由命令行 --x64/--arm64 控制,使每个 job 仅构建本机架构、native 模块匹配。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 08a00c5 commit 7e351e2

1 file changed

Lines changed: 9 additions & 27 deletions

File tree

electron-builder.config.ts

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,10 @@ const config: Configuration = {
5555
target: [
5656
// 安装版
5757
{
58-
target: "nsis",
59-
arch: ["x64", "arm64"],
60-
},
58+
target: "nsis", },
6159
// 打包版
6260
{
63-
target: "portable",
64-
arch: ["x64", "arm64"],
65-
},
61+
target: "portable", },
6662
],
6763
// 注册协议
6864
protocols: [
@@ -133,14 +129,10 @@ const config: Configuration = {
133129
target: [
134130
// DMG 安装版
135131
{
136-
target: "dmg",
137-
arch: ["x64", "arm64"],
138-
},
132+
target: "dmg", },
139133
// 压缩包安装版
140134
{
141-
target: "zip",
142-
arch: ["x64", "arm64"],
143-
},
135+
target: "zip", },
144136
],
145137
},
146138
// Linux 平台配置
@@ -155,34 +147,24 @@ const config: Configuration = {
155147
target: [
156148
// Pacman 包管理器
157149
{
158-
target: "pacman",
159-
arch: ["x64", "arm64"],
160-
},
150+
target: "pacman", },
161151
// AppImage 格式
162152
{
163-
target: "AppImage",
164-
arch: ["x64", "arm64"],
165-
},
153+
target: "AppImage", },
166154
// Debian 包管理器
167155
{
168-
target: "deb",
169-
arch: ["x64", "arm64"],
170-
},
156+
target: "deb", },
171157
// RPM 包管理器
172158
{
173-
target: "rpm",
174-
arch: ["x64", "arm64"],
175-
},
159+
target: "rpm", },
176160
// Snap 包管理器(仅支持 x64 架构)
177161
// {
178162
// target: "snap",
179163
// arch: ["x64"],
180164
// },
181165
// 压缩包格式
182166
{
183-
target: "tar.gz",
184-
arch: ["x64", "arm64"],
185-
},
167+
target: "tar.gz", },
186168
],
187169
// 维护者信息
188170
maintainer: "imsyy.top",

0 commit comments

Comments
 (0)