Skip to content

chore(axbuild): pin ostool runtime bin fix#1158

Merged
ZR233 merged 3 commits into
devfrom
chore/ostool-git-dep
Jun 6, 2026
Merged

chore(axbuild): pin ostool runtime bin fix#1158
ZR233 merged 3 commits into
devfrom
chore/ostool-git-dep

Conversation

@ZR233

@ZR233 ZR233 commented Jun 5, 2026

Copy link
Copy Markdown
Member

问题

ostool 0.22 调整了调用接口,axbuild 需要从旧的 Tool / ToolConfig 入口迁移到新的 Invocation 和模块级入口函数。

升级到 crates.io ostool 0.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
  • 该 ostool 修复来自 fix(ostool): prepare raw bin for runtime runners drivercraft/ostool#125:U-Boot/board/UEFI QEMU 运行路径会在内部自动准备所需 BIN,调用方不再需要手动依赖 to_bin
  • 更新 Cargo.lock,让 ostoolfitimagejkconfiguboot-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 --check
  • cargo xtask clippy --package axbuild
  • cargo test -p axbuild
  • timeout 900s cargo xtask axvisor test board --board roc-rk3568-pc-linux

@ZR233
ZR233 marked this pull request as ready for review June 5, 2026 15:15
@mai-team-app mai-team-app Bot mentioned this pull request Jun 5, 2026
@ZR233 ZR233 changed the title chore(axbuild): update ostool to 0.22 chore(axbuild): pin ostool runtime bin fix Jun 5, 2026

@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.

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 失败

变更审查

  • AppContexttool: Toolinvocation: Invocation,移除了 tool_mut() 方法,所有调用点已正确更新为直接使用 AppContext 上的封装方法
  • 新增 read_qemu_config_from_path_for_cargoread_uboot_config_from_path_for_cargoensure_uboot_config_for_cargoread_board_run_config_from_path_for_cargoensure_board_run_config_in_dir_for_cargo 等封装,解耦良好
  • CargoQemuRunnerArgsCargoUbootRunnerArgs 中移除 show_output 字段,RunQemuOptions 同理,符合 ostool 0.22 API 变更
  • build_config_path 不再同步到 tool 对象,改为每次调用时作为参数传入,更清晰
  • 测试辅助函数 test_invocation 正确创建临时 manifest,适配新 Invocation 初始化
  • fitimagejkconfiguboot-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

@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.

Review 总结

变更概述

axbuild 中的 ostool 调用从旧的 Tool/ToolConfig 入口迁移到新的 Invocation 和模块级入口函数,同时将 ostool 依赖升级到 crates.io 0.22.1 以修复 board CI 在 U-Boot 启动阶段因 ELF/BIN 路径选择导致的崩溃。

实现逻辑

  • AppContexttool: Toolinvocation: Invocation,使用 InvocationOptions 初始化
  • 移除 tool_mut() 方法,所有调用点改为通过 AppContext 上的新增封装方法(read_qemu_config_from_path_for_cargoread_uboot_config_from_path_for_cargoensure_uboot_config_for_cargoread_board_run_config_from_path_for_cargoensure_board_run_config_in_dir_for_cargo)间接调用 ostool 模块级函数
  • set_debug_mode 创建新的 Invocation 替代旧的 Tool
  • CargoQemuRunnerArgsCargoUbootRunnerArgsRunQemuOptions 中移除 show_output 字段,符合 ostool 0.22 API
  • 测试辅助函数 test_invocation 正确创建临时 manifest 适配新接口
  • fitimagejkconfiguboot-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 27048526466Check 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 #1159(CI workflow 拆分,draft):不相关
  • PR #1160(Wayland app case):不相关

无重复或冲突的 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

@mai-team-app
mai-team-app Bot requested a review from ZCShou June 6, 2026 01:47
@ZR233
ZR233 merged commit c95ef5e into dev Jun 6, 2026
95 of 111 checks passed
@ZR233
ZR233 deleted the chore/ostool-git-dep branch June 6, 2026 02:21
silicalet added a commit to silicalet/tgoskits that referenced this pull request Jun 6, 2026
- 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
@github-actions github-actions Bot mentioned this pull request Jun 9, 2026
aptacc2421 pushed a commit to aptacc2421/tgoskits that referenced this pull request Jun 14, 2026
* 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
luodeb pushed a commit that referenced this pull request Jun 30, 2026
* 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
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