← Back to Pull requests

🚀 feat & fix: 基建升级!全平台统一构建、ARM64 适配、AUR 三发与 Linux 原生体验修复 #26

Closed
unknown closed this pull request without merging on Feb 28, 2026 06:47 UTC
View on GitHub
unknown unknown commented on Feb 27, 2026 07:29 UTC
Author

📝 PR 摘要 | Description


本次提交对项目的自动化构建基建(CI/CD)及 Linux 原生体验进行了全面重构与深度优化。

核心成果包括:实现了 Windows、macOS、Linux (x86_64/aarch64) 的统一并行构建架构;打通了 Arch Linux 官方用户仓库 (AUR) 的全自动发版链路;并彻底解决了应用在严格的 Linux 文件权限与桌面环境下的多项“水土不服”问题。

从此版本起,XJTUToolBox 能够完美、原生、稳定地运行在各类 Linux 发行版及 ARM 设备上。

✨ 核心特性升级 | Key Features


[新增] 跨架构全平台统一构建 (build_(windows/macOS/linux).yml):
摒弃零散的脚本,采用 Matrix 与 Reusable Workflows,实现多端并行打包,最后汇总至 Release 统一发版。
新增 Linux ARM64 (aarch64) 原生构建支持,完美输出 .deb, .rpm, .pkg.tar.zst, .AppImage。
[新增] AUR 全自动发行流水线 (update_aur.yml):
引入智能轮询等待机制(消除时序竞态),在 Release 资产就绪后,自动触发 AUR 更新。
同步维护并推送三大版本:稳定源码版 (xjtutoolbox)、极速预编译版 (xjtutoolbox-bin)、激进源码版 (xjtutoolbox-git)。
[重构] 极客级 AUR 混合依赖打包 (PKGBUILD):
抛弃耗时的二进制全量编译,采用 Official + AUR + Venv 混合依赖模式。
底层深度复用 Arch 系统原生 python-pyqt5,仅通过 --system-site-packages 隔离环境补齐 PyQt-Fluent-Widgets,极大缩减打包体积与启动耗时。

🛠️ 深度 Bug 修复 | Hardcore Fixes


本次 PR 攻克了多项底层环境与交叉编译难题:

1. 解决 SQLite /opt/ 目录权限与目录缺失报错 (peewee.OperationalError):
问题:Linux 下 /opt/ 为只读目录,且 SQLite 无法自动创建父级目录。
修复:在 ScheduleInterface.py 中强制重定向数据路径至 ~/.config/XJTUToolbox/,并注入 os.makedirs(..., exist_ok=True) 确保父目录提前就绪。
2. 解决 Linux 任务栏图标丢失 / 无法映射问题:
问题:Wayland/X11 依赖 WM_CLASS 匹配图标,而 Python 默认注入 app.py 导致无法匹配 .desktop 文件。
修复:在应用层原生接入 app.setApplicationName("xjtutoolbox"),与系统级标识完美握手。
3. 攻克 QEMU 环境下的 AppImage Exec format error 模拟器漏洞:
问题:ARM64 交叉编译时,模拟器无法解析 AppImage 的 ELF+SquashFS 缝合头部。
修复:引入极客级“外科手术截断法”,使用 Python 动态探测 hsqs 偏移量,利用 tail 物理剥离文件头后交由 unsquashfs 强解,确保 ARM 构建 100% 稳定。
4. 规避 ARM64 下 PyQt5 源码编译崩溃:
修复:在 pyproject.toml 引入严格的 Environment Markers 进行环境隔离,并在 CI 阶段使用 --no-deps 强行阻断连带依赖,绕过 qmake 编译报错。

✅ 测试情况 | Validation


  • Windows & macOS 独立打包链路正常。

  • Linux x86_64 / arm64 交叉构建及 AppImage 生成正常。

  • AUR 三分发链路 (xjtutoolbox, -bin, -git) .SRCINFO 校验及推送正常。

  • Linux 本地环境运行,数据库写入、任务栏图标、更新检测(直连/代理切换)均正常。
  • Diff: 255 lines (+191 / -64) across 3 files Reviewer: JimmyWang0417 Review duration: 1397m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 255 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.332
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #26"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.1% (MEDIUM) · Higher = larger blast radius
    39.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.4% · Safe to merge
    15.4%