fix: 修复 Nuitka 编译环境下程序无法启动 (issue #106) + CI 冒烟测试 + macOS 构建矩阵修复 - #107
Merged
This-is-XiaoDeng merged 3 commits intoAug 13, 2026
Conversation
…elopmentTeam#106) - utils/logger.py: 用 sys._getframe(1).f_globals['__name__'] 获取调用方模块名, 替代 inspect.stack()/inspect.getmodule()。Nuitka 编译模块没有真实源码文件, inspect 会抛 AttributeError: 'dict' object has no attribute 'endswith' 使程序 在启动阶段崩溃(Windows 用户报告 v0.2.10 无法启动) - version.py: 打包后 pyproject.toml 作为数据文件解压到可执行文件所在目录, 依次尝试多个候选路径读取版本号,避免打包后显示 FAILED TO GET - CI: ci.yml / build-release.yml 各平台构建后新增冒烟测试(临时 config.json 启动产物,检查启动横幅与版本输出),确保发布的程序可运行 - 新增 CLAUDE.md 项目开发指南(构建、发版、编码规范)
macos-latest 已变为 arm64 运行器,原矩阵中 x64 条目从未真正构建 x64 产物 (python-arch 未传给 setup-python,runs-on 固定为 macos-latest),导致 "x64" 产物实际是 arm64。改为:x64 使用 macos-26-intel(Intel 运行器), arm64 使用 macos-latest,并把 architecture 传给 setup-python。
- 非 UTF-8 locale(英文 Windows 重定向输出、POSIX 环境)下,日志中的中文会被 Python 转义为 \uXXXX(Nuitka 打包后同样如此),导致日志不可读 - init_logger 中对 sys.stdout/sys.stderr 执行 reconfigure(encoding='utf-8') - 冒烟测试断言改为 ASCII 安全文本(启动横幅 + discord login 阶段日志), 避免依赖中文编码,保证 CI 在 Windows runner(cp1252)上稳定通过
This-is-XiaoDeng
merged commit Aug 13, 2026
91e1304
into
ITCraftDevelopmentTeam:master
2 checks passed
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.
修复内容
1. issue #106:v0.2.10 Windows exe 启动即崩溃
utils/logger.py的get_logger()使用inspect.stack()/inspect.getmodule()定位调用者模块名。在 Nuitka 编译环境下(v0.2.10 打包所用版本),inspect获取的栈帧对象在编译后无法正确解析,模块级logger = get_logger()(如actions/v12/file.py)触发AttributeError: 'dict' object has no attribute 'endswith',程序启动即崩溃sys._getframe(1).f_globals.get("__name__")+ try/except 兜底,兼容 Nuitka 编译产物2. CI 冒烟测试(ci.yml + build-release.yml)
config.json真实启动产物 → 校验启动横幅 + Discord 登录阶段日志 → 通过才算构建成功PYTHONUTF8=13. macOS 构建矩阵修复
macos-latest已变为 arm64,原 x64 条目实际产出 arm64 二进制(python-arch从未生效)macos-26-intel,arm64 →macos-latest,并在 setup-python 中显式传入architecturefile确认 x64 条目为Mach-O 64-bit x86_644. 日志中文转义修复
\uXXXXinit_logger强制 stdout/stderr 使用 UTF-8;冒烟测试断言改用 ASCII 安全文本验证记录
Closes #106