Skip to content

feat(axbuild): support Starry QEMU apps#1077

Closed
YanLien wants to merge 0 commit into
devfrom
feat/starry-apps
Closed

feat(axbuild): support Starry QEMU apps#1077
YanLien wants to merge 0 commit into
devfrom
feat/starry-apps

Conversation

@YanLien

@YanLien YanLien commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactor starry app run into starry app qemu, integrating full test framework support for StarryOS QEMU apps (test-commands, success/fail regex, subcases), aligned with the cargo xtask starry test QEMU test infrastructure.

Key changes

  • starry app qemu subcommand: replaces starry app run, supports --all/-t case selection with --arch filtering
  • QEMU app test integration: parses test_commands, success/fail regex, and subcases from qemu-*.toml, reuses the TestQemuCase framework
  • CI matrix split: starry-apps.yml changed from a single job to a per-arch matrix (x86_64/aarch64/riscv64/loongarch64)
  • kallsyms fix: pre-build stage cleans stale ELF to prevent .kallsyms section size mismatch; adds padding to align the section
  • App directory reorganization: QEMU cases migrated from test-suit/starryos/normal/qemu-smp1/ to apps/starry/qemu/; stress cases to apps/starry/stress/
  • APK region default: parse_apk_region default changed from China to Us, adapting to CI network

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #1077 Review: feat(axbuild): support Starry QEMU apps

变更概要

本 PR 将 starry app run 重构为 starry app qemu,集成了完整的测试框架支持(test_commands、success/fail regex、subcases),并做了以下工作:

  • QEMU app test 框架集成:复用 TestQemuCase 框架,从 qemu-*.toml 解析 test_commands 等字段
  • CI 矩阵拆分:starry-apps.yml 从单 job 改为按架构矩阵
  • kallsyms 修复:pre-build 清理 stale ELF + section padding
  • App 目录重组:QEMU 用例从 test-suit/starryos/normal/qemu-smp1/ 迁移到 apps/starry/qemu/;stress 用例迁移到 apps/starry/stress/
  • NVMe 驱动添加内存屏障(wmb/rmb)
  • APK region 默认从 China 改为 Us

实现逻辑

代码设计合理:app_qemu_run() 通过 selected_apps() 筛选 QEMU 类型 app,利用 prepare_qemu_app_case() 构建 StarryAppQemuCase,然后通过 app_qemu_test_case() 转换为通用 TestQemuCase 复用已有测试运行框架。对于有 prebuild 且无 test_commands 的 app(如 codex-cli),走 plain pipeline 直接启动 QEMU;对于有 test_commands/subcases 的 app(如 git、busybox),走 grouped pipeline 自动构建测试资产并注入 rootfs。kallsyms 的 pre-build clean 和 padding 修复解决了增量构建时 .kallsyms section size mismatch 的问题。

⛔ 阻断问题:单元测试失败

cargo test --manifest-path scripts/axbuild/Cargo.toml 产生 7 个测试失败(437 passed, 7 failed)。

PR 将 QEMU 测试用例从 test-suit/starryos/normal/qemu-smp1/ 迁移到 apps/starry/qemu/,但 scripts/axbuild/src/starry/test.rs 中的 9 处路径引用只更新了 1 处(apk-curl @ line 1867),其余 8 处仍指向已删除的旧路径:

测试名 旧路径引用 状态
inotifywait_qemu_case_installs_tool_before_boot (line 1355) test-suit/starryos/normal/qemu-smp1/inotifywait ❌ 目录已删除
procps_qemu_case_installs_tools_before_boot (line 1448) test-suit/starryos/normal/qemu-smp1/procps ❌ 目录已删除
apk_add_fs_equivalence_qemu_case_covers_package_fs_ops (line 1532) test-suit/starryos/normal/qemu-smp1/apk-add-fs-equivalence ❌ 目录已删除
apk_net_equivalence_qemu_case_covers_apk_like_network_ops (line 1722) test-suit/starryos/normal/qemu-smp1/apk-net-equivalence ❌ 目录已删除
lua_qemu_case_installs_lua_before_boot (line 2026) test-suit/starryos/normal/qemu-smp1/lua ❌ 目录已删除
busybox_guest_script_reports_case_start_and_bounds_nologin (line 2284) test-suit/starryos/normal/qemu-smp1/busybox/sh/busybox-tests.sh ❌ 目录已删除
dhcp_qemu_case_checks_local_dhcp_state_without_external_apk_fetch (line 1938) test-suit/starryos/normal/qemu-smp1/dhcp ❌ 目录已删除
apk_curl_qemu_case_tries_cernet_before_upstream (line 1867) apps/starry/qemu/apk-curl ✅ 已更新

修复方法:将 test.rs 中这 8 处路径从 test-suit/starryos/normal/qemu-smp1/<case> 更新为 apps/starry/qemu/<case>

次要问题

  • results/riscv64-failed.log 是一个只含换行符的空文件,看起来是本地构建产物意外提交,建议从 PR 中移除。

CI 状态

CI 检查大多为 skipped 或 in_progress,暂无明确失败。需等待 CI 完成后再次确认。

重复/重叠分析

搜索了 open PR 列表,未发现与本 PR 功能重复或冲突的 PR。PR #1076(self-compile)修改的是不同功能领域,无冲突风险。

QEMU 验证说明

本 PR 不新增 QEMU app 测试用例,而是将已有用例从 test-suit 迁移到 apps 目录。由于 7 个单元测试失败表明路径迁移不完整,需要先修复再验证。修复后 cargo test --manifest-path scripts/axbuild/Cargo.toml 应全部通过。

Powered by mimo-v2.5-pro

@mai-team-app
mai-team-app Bot requested review from ZCShou and luodeb June 1, 2026 18:39
@YanLien
YanLien force-pushed the feat/starry-apps branch from b4186fc to 1bfbc0a Compare June 2, 2026 00:56
@YanLien

YanLien commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

PR #1077 Review: feat(axbuild): support Starry QEMU apps

变更概要

本 PR 将 starry app run 重构为 starry app qemu,集成了完整的测试框架支持(test_commands、success/fail regex、subcases),并做了以下工作:

  • QEMU app test 框架集成:复用 TestQemuCase 框架,从 qemu-*.toml 解析 test_commands 等字段
  • CI 矩阵拆分:starry-apps.yml 从单 job 改为按架构矩阵
  • kallsyms 修复:pre-build 清理 stale ELF + section padding
  • App 目录重组:QEMU 用例从 test-suit/starryos/normal/qemu-smp1/ 迁移到 apps/starry/qemu/;stress 用例迁移到 apps/starry/stress/
  • NVMe 驱动添加内存屏障(wmb/rmb)
  • APK region 默认从 China 改为 Us

实现逻辑

代码设计合理:app_qemu_run() 通过 selected_apps() 筛选 QEMU 类型 app,利用 prepare_qemu_app_case() 构建 StarryAppQemuCase,然后通过 app_qemu_test_case() 转换为通用 TestQemuCase 复用已有测试运行框架。对于有 prebuild 且无 test_commands 的 app(如 codex-cli),走 plain pipeline 直接启动 QEMU;对于有 test_commands/subcases 的 app(如 git、busybox),走 grouped pipeline 自动构建测试资产并注入 rootfs。kallsyms 的 pre-build clean 和 padding 修复解决了增量构建时 .kallsyms section size mismatch 的问题。

⛔ 阻断问题:单元测试失败

cargo test --manifest-path scripts/axbuild/Cargo.toml 产生 7 个测试失败(437 passed, 7 failed)。

PR 将 QEMU 测试用例从 test-suit/starryos/normal/qemu-smp1/ 迁移到 apps/starry/qemu/,但 scripts/axbuild/src/starry/test.rs 中的 9 处路径引用只更新了 1 处(apk-curl @ line 1867),其余 8 处仍指向已删除的旧路径:

测试名 旧路径引用 状态
inotifywait_qemu_case_installs_tool_before_boot (line 1355) test-suit/starryos/normal/qemu-smp1/inotifywait ❌ 目录已删除
procps_qemu_case_installs_tools_before_boot (line 1448) test-suit/starryos/normal/qemu-smp1/procps ❌ 目录已删除
apk_add_fs_equivalence_qemu_case_covers_package_fs_ops (line 1532) test-suit/starryos/normal/qemu-smp1/apk-add-fs-equivalence ❌ 目录已删除
apk_net_equivalence_qemu_case_covers_apk_like_network_ops (line 1722) test-suit/starryos/normal/qemu-smp1/apk-net-equivalence ❌ 目录已删除
lua_qemu_case_installs_lua_before_boot (line 2026) test-suit/starryos/normal/qemu-smp1/lua ❌ 目录已删除
busybox_guest_script_reports_case_start_and_bounds_nologin (line 2284) test-suit/starryos/normal/qemu-smp1/busybox/sh/busybox-tests.sh ❌ 目录已删除
dhcp_qemu_case_checks_local_dhcp_state_without_external_apk_fetch (line 1938) test-suit/starryos/normal/qemu-smp1/dhcp ❌ 目录已删除
apk_curl_qemu_case_tries_cernet_before_upstream (line 1867) apps/starry/qemu/apk-curl ✅ 已更新
修复方法:将 test.rs 中这 8 处路径从 test-suit/starryos/normal/qemu-smp1/<case> 更新为 apps/starry/qemu/<case>

次要问题

  • results/riscv64-failed.log 是一个只含换行符的空文件,看起来是本地构建产物意外提交,建议从 PR 中移除。

CI 状态

CI 检查大多为 skipped 或 in_progress,暂无明确失败。需等待 CI 完成后再次确认。

重复/重叠分析

搜索了 open PR 列表,未发现与本 PR 功能重复或冲突的 PR。PR #1076(self-compile)修改的是不同功能领域,无冲突风险。

QEMU 验证说明

本 PR 不新增 QEMU app 测试用例,而是将已有用例从 test-suit 迁移到 apps 目录。由于 7 个单元测试失败表明路径迁移不完整,需要先修复再验证。修复后 cargo test --manifest-path scripts/axbuild/Cargo.toml 应全部通过。

Powered by mimo-v2.5-pro

已修复

@YanLien YanLien closed this Jun 2, 2026
@YanLien
YanLien force-pushed the feat/starry-apps branch from 1bfbc0a to 68ffbf6 Compare June 2, 2026 00:58
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