diff --git a/cmd/gui/scripts/dist-win-docker.sh b/cmd/gui/scripts/dist-win-docker.sh index 527b000..e6bc6f1 100755 --- a/cmd/gui/scripts/dist-win-docker.sh +++ b/cmd/gui/scripts/dist-win-docker.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # One-shot Windows release build for the GUI — ENTIRELY inside docker. # -# 1) cross-compile the embedded core in docker (llmsproxy.exe + lua51.dll) +# 1) cross-compile the embedded core in docker (modelrouter.exe + lua51.dll) # 2) electron-builder NSIS packaging ALSO inside docker (wine for the # uninstaller step lives in the image — see Dockerfile). This is the fix # for the 1.3.0/1.4.0 broken installers: the host had amd64-only wine @@ -37,13 +37,15 @@ docker run --rm \ -v "$ROOT":/workspace \ -v "$CACHE_VOL":/root/.cache \ -e GOPROXY="$PROXY" \ + -e ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" \ + -e ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/" \ -w /workspace \ "$IMAGE" bash -c ' set -euo pipefail cp /opt/luajit2/src/lua51.dll /workspace/cmd/gui/bin/lua51.dll GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc \ go build -buildvcs=false -tags luajit -trimpath \ - -o /workspace/cmd/gui/bin/llmsproxy.exe ./cmd/llmsproxy + -o /workspace/cmd/gui/bin/modelrouter.exe ./cmd/modelrouter echo " -> core built" # wine needs one prefix initialization so its wow64 runtime (syswow64/ntdll) # exists — the exact thing that was missing on the broken host. Use a shared diff --git a/cmd/gui/scripts/prepare-core.js b/cmd/gui/scripts/prepare-core.js index 1accfe3..79111c6 100644 --- a/cmd/gui/scripts/prepare-core.js +++ b/cmd/gui/scripts/prepare-core.js @@ -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",