mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-11-07 09:47:23 +00:00
fix(gui): Windows 构建链改用 modelrouter 命名 + 内嵌核心 strip
改名在桌面打包链上漏了两处,都是"构建能过、产物不可用"的类型: 1. `dist-win-docker.sh` 仍交叉编译到 `bin/llmsproxy.exe` 并构建 `./cmd/llmsproxy`,而 package.json 的 extraResources 已指向 `bin/modelrouter.exe` —— Windows 包装完会缺内嵌核心。 同时把 npmmirror 的 electron / electron-builder-binaries 镜像传进容器: 首次构建需在容器内下载数百 MB,直连会卡满 600s 请求超时(Linux 侧已实测)。 2. `prepare-core.js` 只带 `-trimpath`,内嵌核心保留调试符号(14.4MB)。 补 `-ldflags "-s -w"`,与 `packaging/core-dist.sh` 一致,各平台安装包少约 4MB。
This commit is contained in:
@ -17,7 +17,10 @@ function buildLinux() {
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
execFileSync(
|
||||
"go",
|
||||
["build", "-tags", "luajit", "-trimpath", "-o", out, "./cmd/modelrouter"],
|
||||
// -s -w: same stripping as packaging/core-dist.sh. Without it the bundled
|
||||
// core carries debug info (~14.4 MB vs ~10.3 MB) and every installer pays
|
||||
// for it, for a binary the user never debugs.
|
||||
["build", "-tags", "luajit", "-trimpath", "-ldflags", "-s -w", "-o", out, "./cmd/modelrouter"],
|
||||
{ cwd: projectRoot, stdio: "inherit" },
|
||||
);
|
||||
return out;
|
||||
@ -43,7 +46,7 @@ function buildWin() {
|
||||
}
|
||||
execFileSync(
|
||||
"go",
|
||||
["build", "-tags", "luajit", "-trimpath", "-o", out, "./cmd/modelrouter"],
|
||||
["build", "-tags", "luajit", "-trimpath", "-ldflags", "-s -w", "-o", out, "./cmd/modelrouter"],
|
||||
{
|
||||
cwd: projectRoot,
|
||||
stdio: "inherit",
|
||||
|
||||
Reference in New Issue
Block a user