Conversation
…ult, and clean up snapshot side-effects
…rceOS builds Remove runtime feature injection from axbuild (arceos auto-enable, irq/paging/std-compat baseline, smp unconditional push, package.metadata.axstd parsing) and move feature ownership to applications via their `arceos` feature with `ax-std/arceos` baseline. Require explicit vmx/svm selection for x86_64 Axvisor, removing CPUID auto-detection and AXVISOR_X86_BACKEND env var. Add `fd` dependency to axlibc pipe/select/poll/epoll features and stop auto-injecting `fd` in cbuild.
…force feature validation Remove `apply_dynamic_platform_qemu_boot` and all runtime QEMU/CPU/UEFI mutations that axbuild previously inferred from target architecture and host KVM availability. QEMU firmware, acceleration, and device configuration now comes solely from each `qemu-*.toml` contract. Replace silent feature alias normalization and removal with explicit `validate_features()` that rejects removed platform controls (`plat-dyn`, `axstd/*`, etc.) and legacy aliases as build errors. Move the ArceOS baseline (`ax-std/arceos`) into `test-suit`'s own Cargo feature, add a `qperf` preset owned by the StarryOS package, and remove the ArceOS x86_64 guest image injection from Axvisor tests.
… fs feature Replace `ax-std/fs` with `ax-std/fatfs` in the shell's `arceos` feature so the application manifest declares the filesystem backend matching its QEMU FAT32 disk image, rather than relying on axbuild to infer it. Add a test guarding this declaration.
…efi config-driven Replace the hard error for missing x86_64 virtualization backend with a temporary vmx default for the generic QEMU board. Remove architecture-based to_bin inference and instead propagate the explicit uefi/to_bin flags from each qemu-*.toml config. Enable uefi and to_bin on the x86_64 QEMU configs and update tests accordingly.
There was a problem hiding this comment.
审查总结
本 PR 对 axbuild 进行了大规模重构,主要方向是将 ArceOS feature 声明从 axbuild 运行时注入转移到应用程序 manifest 中,同时清理了动态平台 QEMU 注入、firmware 缓存预热、Axvisor x86 后端自动检测等旧逻辑。重构方向正确,测试更新到位,格式与 clippy 检查通过。
变更概要
- ArceOS app feature 模型改革:各 app 的
Cargo.toml改为default = ["arceos"]/arceos = ["dep:ax-std", "ax-std/arceos"],移除[package.metadata.axstd]。ax-std新增arceosfeature 打包irq + paging + std-compat + smp基线。 - Axvisor x86 后端简化:删除
x86.rs(171 行),移除 CPUID 自动检测和AXVISOR_X86_BACKEND环境变量;通用 QEMU 配置临时默认vmx。 - UEFI 启动变更:LoongArch StarryOS、x86_64 ArceOS 测试等切换为 UEFI 启动。
- ArceOS QEMU 默认:
cargo xtask arceos qemu不带--package时默认选择 board 模板的 hello world。 - Feature 验证强化:旧别名
axstd→ax-std、plat-dyn等不再静默转换,改为直接报错。 - Firmware 缓存移除:删除
scripts/axbuild/src/firmware.rs,AIC8800 固件完全由 crate 内build.rs自行处理。 - C app 包解析收紧:C app 构建拒绝非
ax-libc包并给出明确错误。
验证结果
cargo fmt --check:通过cargo clippy --package axbuild -- -D warnings:通过cargo test --package axbuild:735 通过,0 失败- 未发现
[patch.crates-io]条目
CI 状态
当前 CI 仍在运行中(部分 job 为 in_progress,部分已 skipped)。Detect changed paths 与 Cancel stale CI runs 通过。
重复与重叠分析
搜索了 open PR 中与 axbuild 相关的条目,未发现与本 PR 重叠或冲突的其他 PR。
阻塞问题
1. spin 版本回退(Cargo.toml:315 / spin_lint.rs)
本 PR 将 spin 依赖从 =0.12.2 降级为 =0.12.0,同时 spin_lint.rs 中的版本常量也相应改为 0.12.0。dev 分支在 commit 465c09cd2("chore(repo): update spin to 0.12.2")中已明确将 spin 升级到 0.12.2。本 PR 在合并 dev 时保留了旧版本,这是合并冲突解决时的意外回退。
修复方向:将 Cargo.toml 中的 spin = { version = "=0.12.0", ... } 改回 spin = { version = "=0.12.2", ... },并将 scripts/axbuild/src/spin_lint.rs 中的 SPIN_VERSION_REQ 和 SPIN_LOCKFILE_VERSION 恢复为 "0.12.2",同时更新 Cargo.lock。
非阻塞观察
- 整体重构方向合理,将 feature 声明权从 axbuild 移到应用 manifest 使依赖关系更清晰。
- 测试更新充分,新增了多个有针对性的回归测试(如 C app 包冲突拒绝、SVM 后端保留、UEFI 配置验证等)。
- 文档更新与代码变更一致。
Powered by deepseek-v4-pro
…feature application Remove `default_to_bin_for_target` and always produce ELF artifacts from Cargo; BIN conversion is now an explicit runner/config concern. Unify `apply_makefile_features` and `apply_makefile_features_with_metadata` into a single function that no longer takes package or metadata parameters. Simplify std-build env preparation by inlining `AX_TARGET` and removing the unused `prepare_std_build_env_for_package` wrapper. Make SMP feature propagation explicit based on `max_cpu_num` instead of metadata-driven.
…efaulting x86_64 Remove the temporary x86_64 vmx backend auto-selection from axbuild and instead declare the `vmx` feature explicitly in each board configuration that needs it (qemu-x86_64, qemu-x86_64-linux, and asus-nuc15crh). Update the corresponding tests to assert that no backend is implicitly injected.
There was a problem hiding this comment.
审查总结
本轮审查确认上一轮审查中提出的阻塞问题(spin 版本回退)已修复,未发现新的阻塞问题。
上一轮阻塞问题验证
✅ spin 版本回归已修复:Cargo.toml、Cargo.lock、spin_lint.rs 中均已正确使用 0.12.2。Cargo.toml 中为 spin = { version = "=0.12.2", ... },spin_lint.rs 中 SPIN_VERSION_REQ 和 SPIN_LOCKFILE_VERSION 均为 "0.12.2"。
变更概要
本 PR 对 axbuild 进行了大规模重构(106 文件,+803/-2421 行):
- ArceOS app feature 模型改革:各 app 的
Cargo.toml改为default = ["arceos"]/arceos = ["dep:ax-std", "ax-std/arceos"],移除[package.metadata.axstd]。ax-std新增arceosfeature 打包irq + paging + std-compat + smp基线。 - Axvisor x86 后端简化:删除
x86.rs(171 行),移除 CPUID 自动检测和AXVISOR_X86_BACKEND环境变量;通用 QEMU 配置临时默认vmx。 - UEFI 启动变更:LoongArch StarryOS、x86_64 ArceOS 测试、Axvisor nimbos smoke test 等切换为 UEFI 启动,
uefi/to_bin由各qemu-*.toml显式声明。 - ArceOS QEMU 默认:
cargo xtask arceos qemu不带--package时从 board 模板默认选择 hello world。 - Feature 验证强化:旧别名
axstd→ax-std、plat-dyn等不再静默转换,改为validate_features()直接报错。 - Firmware 缓存移除:删除
scripts/axbuild/src/firmware.rs,AIC8800 固件完全由 crate 内build.rs自行处理。 - C app 包解析收紧:C app 构建拒绝非
ax-libc包并给出明确错误。 - axlibc feature 依赖修复:
pipe/select/poll/epoll增加fd依赖,不再由 axbuild 自动注入。 - StarryOS Cargo.toml:增加
std-compatfeature 和qperf/qperf-metrics预设。 - 文档更新:README、quickstart、配置文档等同步更新。
代码审查
- feature 声明权转移:将 feature 从 axbuild 运行时注入转移到应用 manifest 是正确的架构方向,使依赖关系更清晰、可审计。
- ax-std
arceos基线 feature:arceos = ["irq", "paging", "std-compat", "smp"]设计合理,作为所有 ArceOS Rust 应用的共同基线。 - Feature 验证:
validate_features()对已移除的平台控制(plat-dyn、axstd/*等)和遗留别名直接报错,避免静默降级,有助于强制迁移。 - Axvisor x86 后端:临时默认
vmx的兼容策略明确标记为过渡方案,文档中注明了后续应删除该兼容逻辑。 - UEFI/
to_bin配置化:将 QEMU 启动方式从架构推断改为各qemu-*.toml显式声明,符合arch-platform-porting技能中 "axbuild must not infer or overwrite them" 的要求。 - 测试覆盖:新增了多个回归测试(C app 包冲突拒绝、SVM 后端保留、UEFI 配置验证、shell fatfs 后端声明等),测试更新与代码变更同步。
- 无
[patch.crates-io]:确认工作区 manifest 中未引入 crates.io patch。
CI 状态
CI 仍在运行中(30/58 jobs 完成)。已完成的 job 状态:
Detect changed paths:✅ successCancel stale CI runs:✅ successartifact.ci:✅ success- 其余 skipped jobs 为预期的分支限制发布 job、互斥矩阵 job 和路径过滤 job。
重复与重叠分析
搜索了与 axbuild 相关的 open PR,未发现与本 PR 重复或冲突的其他 PR。
结论
上一轮阻塞问题已全部修复,代码质量良好,架构方向正确,文档同步更新。批准合并。
Powered by deepseek-v4-pro
ZR233
left a comment
There was a problem hiding this comment.
代码与启动契约本身未发现新的阻塞:显式 feature、UEFI/to_bin、VMX/SVM 和配置所有权方向符合 arch-platform-porting 规范;本地 cargo test -p axbuild --lib 为 738/738 通过,current-head CI 为 pass=32、skipped=32,涵盖 ArceOS/StarryOS/Axvisor 多架构及 x86_64 UEFI/self-hosted 流程。未发现 crates.io patch,开放 PR 搜索和与 #1607 的文件交集检查也未发现重复或冲突。
当前唯一阻塞是 PR 元数据:仓库明确要求 PR 标题使用 Conventional Commits 的 type(scope): content,现标题 Refactor axbuild for ArceOS features and UEFI boot improvements 不符合格式。请改为例如 refactor(axbuild): make feature and UEFI boot contracts explicit;标题更新且 head/CI 未变化后即可重新确认批准。
refactor(axbuild): 将构建与启动能力收敛到显式配置
背景
本 PR 的主要目的是移除 axbuild 根据目标架构、宿主机环境、包元数据或历史兼容规则自动补全构建参数的行为。此前这些隐式修正会让 Cargo feature、QEMU 启动方式和固件路径的真实来源不清晰:配置或代码缺少能力声明时,axbuild 仍可能构建或启动成功;一旦重构移除某个补丁,CI 才以超时或启动失败的方式暴露问题。
本次将能力声明回归到应用 manifest、board/build TOML、VM TOML 和 QEMU TOML,使 axbuild 只负责读取显式输入、转发命令参数、准备测试资产,以及拒绝不再支持的旧配置。
主要修改
1. 移除 axbuild 的隐式 feature 与平台补全
smp、动态平台、静态平台和兼容 feature 的行为;仅当max_cpu_num或--smp明确请求多核时,转发对应的 SMP 能力。plat-dyn、axstd等兼容 feature,而不是静默过滤或改写。fd;将pipe、select、poll、epoll对fd的依赖收敛到axlibcmanifest。ax-libc,对冲突的--package或配置选择器直接报错,不再在执行阶段静默覆盖用户请求。2. 将运行能力声明回归到代码与配置
Cargo.toml中声明arceos、std-compat、文件系统等基础能力;Shell 明确选择 FAT32 后端。std-compat;Starry perf 使用 package 定义的qperfpreset,而不是由 axbuild 拼装驱动 feature。vmx,AMD 测例选择svm。axbuild 不再默认注入 VMX。3. 将 QEMU 启动契约回归到 QEMU TOML
/dev/kvm或 Cargo feature 自动改写 QEMU 的逻辑,包括 UEFI、BIN、KVM、CPU 嵌套虚拟化 feature、默认设备和调试参数。uefi = true、to_bin = true,并在 Axvisor VMX/SVM 测例中显式配置 CPU feature 和 UEFI 所需设备。to_bin = true,以 raw BIN 加载高半区内核,避免将高半区 ELF 直接交给 QEMU 后无输出超时。uefi = true, to_bin = false的矛盾配置直接报错,不再隐式把 UEFI 请求修正为 BIN。snapshot=on,避免全局-snapshot使可写 ESP 失效。4. 清理与可维护性调整
build.rs独立处理按需下载与校验,仓库内固件目录仅作为可选离线缓存。qemu在没有 package/config 选择器时使用显式的qemu-<arch>board 模板默认启动 Hello World;显式--package和--config仍优先。spin锁定版本至 dev 已采用的0.12.2。设计原则
uefi、to_bin、CPU、设备、固件和加速方式属于选定的 QEMU TOML。验证
已完成以下验证: