Skip to content

build: Rust 构建与测试效率优化(P0/P2) - #1

Merged
knqiufan merged 6 commits into
mainfrom
feat/rust-build-test-optimization
Jul 9, 2026
Merged

build: Rust 构建与测试效率优化(P0/P2)#1
knqiufan merged 6 commits into
mainfrom
feat/rust-build-test-optimization

Conversation

@knqiufan

@knqiufan knqiufan commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • 新增 docs/guides/rust-build-test-optimization.md,系统说明 Rust/Tauri 编译与测试变慢的原因,并按 P0→P3 给出可执行优化步骤与验收标准
  • 修正开发文档(AGENTS.mdCLAUDE.mdREADME.mdDEVELOPMENT_STATUS.md):停止日常 cargo clean,推广增量编译、cargo check 优先与精准 --test 工作流
  • 落地 P2 构建加速配置:src-tauri/.cargo/config.toml(dev 依赖 opt-level = 1)、src-tauri/.config/nextest.toml,CI 改用 cargo nextest run --all-features --profile ci,并修正 .gitignore 以保留 src-tauri/.cargo/ 配置

Test plan

  • 确认 CI Rust job 成功安装 nextest 并通过全量测试
  • 本地 cd src-tauri && cargo check 第二次运行应明显快于首次(增量编译生效)
  • 本地 cargo nextest run --test minimal 可正常运行
  • 文档中的日常/提交前命令与 hook 行为一致

knqiufan and others added 6 commits July 7, 2026 19:21
…g guidelines

- Revised instructions in AGENTS.md and CLAUDE.md to clarify the Rust build process, emphasizing the use of incremental compilation and when to run `cargo clean`.
- Updated README.md to reflect changes in Rust testing practices, including targeted tests and full suite execution before commits.
- Enhanced documentation on Rust hygiene practices to prevent unnecessary clean operations, directing users to consult the optimization guide for troubleshooting scenarios.
- Adjusted PHASE_3_REMAINING_TODO.md and DEVELOPMENT_STATUS.md to reflect the current project status and testing recommendations.
Add src-tauri/.cargo/config.toml and nextest profiles, switch CI to cargo nextest, and update dev docs. Fix .gitignore so project .cargo config is tracked.
Ensure generated Tauri context can validate app icons in CI by storing PNG assets with alpha channels.
Run nextest compilation serially and omit test debug info so Linux CI avoids GNU ld crashes while linking large Tauri test binaries.
extract_project_name used std::path::Path::file_name(), which only
recognizes the host OS separator. On the Ubuntu CI runner a Windows-style
path like `D:\code\Misaka-Tauri` is treated as one component, so
project_name came back as the full path instead of `Misaka-Tauri`, failing
full_workspace_binding_flow.

Split on both `/` and `\` so the result is the same on any host.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@knqiufan
knqiufan merged commit e43a696 into main Jul 9, 2026
5 checks passed
@knqiufan
knqiufan deleted the feat/rust-build-test-optimization branch July 9, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant