🐛 fix(build): 修复干净环境 Wails 构建失败 - #1245
Merged
Merged
Conversation
- 在生成 bindings 前按需准备前端资源占位包 - 构建结束时拒绝嵌入占位资源并删除无效二进制
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
干净仓库中不存在被 Git 忽略的
frontend/dist.zip。Wails 在执行前端构建前先生成 bindings,导致assets_prod.go的go:embed直接报错,Linux 用户无法执行普通wails build。Closes #1244
变更点
frontend/dist.zip缺失时复制仓库内的tools/stub-dist.zip,使 bindings 可以生成。-s跳过前端且没有真实资源,则删除无效二进制并明确失败,避免生成可启动但只有占位页的坏包。影响范围
frontend/dist.zip。-s -skipbindings的路径保持不变。验证
v2.15.0:干净临时 clone、初始无frontend/dist.zip,完整wails build成功。wails build -s:退出码为 1,且无效二进制被删除。wails build -s -skipbindings:构建成功。