feat(packaging+log): 切 QML 主入口打包 + 分级 fsync 日志兜底
打包改造(task #19 Windows 部分):
- spec Analysis 入口:image_generator.py → qml_poc/main_qml.py
- pathex 加项目根,让 PyInstaller 扫到 audit_logger / task_queue /
config_util / preflight / bridges / core 等顶层模块
(main_qml.py 顶部 sys.path.insert 静态分析看不到)
- datas 加:
- qml_poc/qml → _MEIPASS/qml/(注意目标路径不带 qml_poc/ 前缀,
因为 PyInstaller frozen 把入口脚本平铺到 _MEIPASS 根,
main_qml.py 用 Path(__file__).parent / "qml" 找的是 _MEIPASS/qml/)
- jewelry_library.json(默认词库)
- zb100_mac.icns(Mac fallback)
- hiddenimports 显式列 PySide6.QtQml/QtQuick/QtQuickControls2 兜底
日志兜底(task #22):
- TieredFsyncHandler 替代 RotatingFileHandler:
WARNING+ emit 即 fsync(一条不丢)
INFO 走 buffered(零开销)
- start_periodic_fsync daemon 线程每 1s fsync 一次(INFO 最坏丢 1s)
- enable_crash_diagnostics 启动时在 crash_log.txt 写 macOS native crash
提示路径:~/Library/Logs/DiagnosticReports/ZB100ImageGenerator-*.ips
- flush_logs() 升级,对所有 handlers 也走 fsync
Windows 打包验证:dist/ZB100ImageGenerator/ZB100ImageGenerator.exe
启动 8 phases 全过、QML 装载成功、进入主循环零警告。
Mac 打包待 build_mac_universal.sh 验证。
Showing
2 changed files
with
110 additions
and
8 deletions
-
Please register or sign in to post a comment