chore(axbuild): pin ostool runtime bin fix#1158
Conversation
750bf8a to
8a9fd3c
Compare
There was a problem hiding this comment.
Review 总结
变更概述
将 axbuild 中的 ostool 调用从旧的 Tool/ToolConfig 入口迁移到新的 Invocation 和模块级入口函数,同时将 ostool 固定到 drivercraft/ostool 修复 commit f3192dda,以解决 board CI 在 U-Boot 启动阶段因 ELF/BIN 路径选择导致的崩溃。
代码质量
- ✅ cargo fmt --check: 通过
- ✅ cargo clippy --all-features -- -D warnings: 通过
- ✅ cargo test --all-features: 507 个测试全部通过,0 失败
变更审查
AppContext中tool: Tool→invocation: Invocation,移除了tool_mut()方法,所有调用点已正确更新为直接使用AppContext上的封装方法- 新增
read_qemu_config_from_path_for_cargo、read_uboot_config_from_path_for_cargo、ensure_uboot_config_for_cargo、read_board_run_config_from_path_for_cargo、ensure_board_run_config_in_dir_for_cargo等封装,解耦良好 CargoQemuRunnerArgs和CargoUbootRunnerArgs中移除show_output字段,RunQemuOptions同理,符合 ostool 0.22 API 变更build_config_path不再同步到 tool 对象,改为每次调用时作为参数传入,更清晰- 测试辅助函数
test_invocation正确创建临时 manifest,适配新Invocation初始化 fitimage、jkconfig、uboot-shell同步到同一 ostool git revision,Cargo.lock 中windows-sys版本统一
CI 状态
- Push CI run: ✅ success
- PR CI run: 仍在进行中(in_progress)
建议
- Git 依赖应尽早替换回 crates.io 正式版本(当 drivercraft/ostool 发布包含此修复的新版本后)
整体评估:干净、一致的 API 迁移,所有本地验证通过,LGTM。
Powered by mimo-v2.5-pro
There was a problem hiding this comment.
Review 总结
变更概述
将 axbuild 中的 ostool 调用从旧的 Tool/ToolConfig 入口迁移到新的 Invocation 和模块级入口函数,同时将 ostool 依赖升级到 crates.io 0.22.1 以修复 board CI 在 U-Boot 启动阶段因 ELF/BIN 路径选择导致的崩溃。
实现逻辑
AppContext中tool: Tool→invocation: Invocation,使用InvocationOptions初始化- 移除
tool_mut()方法,所有调用点改为通过AppContext上的新增封装方法(read_qemu_config_from_path_for_cargo、read_uboot_config_from_path_for_cargo、ensure_uboot_config_for_cargo、read_board_run_config_from_path_for_cargo、ensure_board_run_config_in_dir_for_cargo)间接调用 ostool 模块级函数 set_debug_mode创建新的Invocation替代旧的ToolCargoQemuRunnerArgs、CargoUbootRunnerArgs、RunQemuOptions中移除show_output字段,符合 ostool 0.22 API- 测试辅助函数
test_invocation正确创建临时 manifest 适配新接口 fitimage、jkconfig、uboot-shell同步更新,Cargo.lock 中依赖版本统一- 无
[patch.crates-io]覆盖,所有依赖使用正常 crates.io 解析
本地验证结果
- ✅
cargo fmt --check(axbuild):通过 - ✅
cargo clippy --manifest-path scripts/axbuild/Cargo.toml --all-features -- -D warnings:通过 - ✅
cargo test --manifest-path scripts/axbuild/Cargo.toml:507 个测试全部通过,0 失败
CI 状态
CI run 27048526466 中 Check formatting / run_host 在步骤 4 Show Rust version 失败(自托管 runner qcs2-rcore-os-runner-3 上 Rust 工具链初始化失败),后续 Run command 被跳过。这是自托管 runner 基础设施问题,不是 PR 代码导致。其余 job 因此被取消或跳过(success=1, skipped=7, failure=1(基础设施), cancelled=1)。
重复/重叠分析
已检查其他 open PR:
无重复或冲突的 PR。
PR 说明小问题
PR 正文中提到「固定到 drivercraft/ostool 修复 commit:f3192dda」,但实际 Cargo.toml 使用的是 ostool = { version = "0.22.1" }(crates.io 版本),Cargo.lock 确认为 registry+https://github.com/rust-lang/crates.io-index。该 commit 应该是已发布为 0.22.1 的修复。建议更新 PR 正文避免误解。
整体评估
干净、一致的 API 迁移,所有本地验证通过,代码结构合理,解耦良好。LGTM。
Powered by mimo-v2.5-pro
- mount.rs: keep Arc children model with clone_tree/clone_children_from/clone_shallow - dir.rs: adopt upstream generation-based cache + mountpoint rename transfer - inode.rs: merge upstream (name, is_dir) signature with pending-delete + truncate_inode Upstream changes absorbed: - fix(axfs-ng): zero partial last page when truncating (rcore-os#1124) - fix(locking): narrow spinlock scope in VFS and Starry paths (rcore-os#1146) - chore(axbuild): pin ostool runtime bin fix (rcore-os#1158) - feat(starry-apps): runnable eBPF demos (rcore-os#1132) - feat(starry): wire qperf app runtime into Starry perf (rcore-os#1095) - fix(axcpu-aarch64): emulate EL0 MRS reads of ID_AA64* (rcore-os#1128) - feat(rsext4): fine-grained locking for SMP (rcore-os#1057) - feat(starry-kernel): implement TCP_INFO sockopt (rcore-os#1044) - test(starryos): add fork parent-child identity test (rcore-os#995) - fix(starry-mm): mprotect returns ENOMEM on unmapped holes (rcore-os#918) Tests verified: - test-nix-prereqs: PASS - nix-smoke: PASS - syscall (upstream): PASS - test-dup2 (upstream): PASS
* chore(axbuild): update ostool to 0.22 * chore(axbuild): pin ostool runtime bin fix * Update ostool dependency to version 0.22.1 in Cargo.toml
* chore(axbuild): update ostool to 0.22 * chore(axbuild): pin ostool runtime bin fix * Update ostool dependency to version 0.22.1 in Cargo.toml
问题
ostool0.22 调整了调用接口,axbuild需要从旧的Tool/ToolConfig入口迁移到新的Invocation和模块级入口函数。升级到 crates.io
ostool0.22 后,AxVisor self-hosted board CI 在 U-Boot 启动阶段崩溃。对比成功运行后确认差异是旧流程会先把 ELF 转成axvisor.bin,而 0.22 运行路径可能把 ELF 直接作为 FIT kernel 传给 U-Boot,导致板端跳转到非 raw image 内容。改动
axbuild中的 ostool 调用改为使用新的Invocation和模块级入口函数。AppContext增加 qemu、uboot、board 配置读取封装,保留现有调用侧语义。context单测辅助 manifest,适配新接口初始化需要。ostool依赖固定到drivercraft/ostool修复 commit:f3192dda953dcfc9ed25ac67d4af52a0cfc6363b。to_bin。Cargo.lock,让ostool、fitimage、jkconfig、uboot-shell使用同一 ostool git revision。逻辑
这次变更把 ostool 的初始化集中到
AppContext,各 build/test/run 流程只通过上下文读取配置或调用对应入口函数,避免业务流程继续持有旧的可变 tool handle。board CI 崩溃的根因在 ostool 0.22 的 runtime artifact 选择:U-Boot/FIT 场景必须使用 raw BIN,而不是 ELF。tgoskits 侧固定到带修复的 ostool commit 后,board 流程会在获取板卡 session 前重新输出
Converting ELF to BIN format,并生成target/aarch64-unknown-none-softfloat/release/axvisor.bin。验证
cargo fmt --checkcargo xtask clippy --package axbuildcargo test -p axbuildtimeout 900s cargo xtask axvisor test board --board roc-rk3568-pc-linuxtarget/aarch64-unknown-none-softfloat/release/axvisor.bin。failed to acquire board type \ROC-RK3568-PC`/http://localhost:2999/api/v1/sessions`,真实板卡启动结果以 GitHub Actions 为准。