Skip to content

feat(std): unify std-aware ArceOS builds#1080

Merged
ZR233 merged 34 commits into
rcore-os:devfrom
ZR233:feat/std
Jun 9, 2026
Merged

feat(std): unify std-aware ArceOS builds#1080
ZR233 merged 34 commits into
rcore-os:devfrom
ZR233:feat/std

Conversation

@ZR233

@ZR233 ZR233 commented Jun 2, 2026

Copy link
Copy Markdown
Member

问题

本 PR 将 ArceOS Rust app/test/example、StarryOS、Axvisor 统一到官方 Rust std-aware 构建路径后,需要继续使用源码树内的 linux-musl JSON target 和 fake libc.a/libunwind.a 来承载 ArceOS runtime。CI 暴露出几个 std 化后的目标/cfg 迁移问题:

  • Starry loongarch64 QEMU 构建中,Rust target JSON 使用 lp64s soft-float ABI,但部分 C 依赖仍按 loongarch64-linux-musl-cc 默认的 lp64d double-float ABI 编译,导致 lwprintf-rs C object 和 Rust object ABI 不一致。
  • Axvisor x86_64 SVM hosted 构建中,ax-plat-x86-qemu-q35 仍只在 target_os = "none" 下编译;std JSON target 下平台接口实现符号没有导出,链接阶段缺少 __PowerIf_*__TimeIf_*__ConsoleIf_*__MemIf_* 等符号。
  • Starry OrangePi 5 Plus NPU board case 中,NPU 驱动已经注册,但 RKNN 用户态打开设备失败;原因是 Starry RKNPU devfs 模块仍用 not(any(windows, unix)) 判断内核构建,std JSON target 下 target_os = "linux"cfg(unix) 为真,导致 /dev/dri/card1/dev/dma_heap/system 等 RKNPU 用户态设备接口被裁掉。
  • Axvisor PhytiumPi board case 中,allocator 日志显示 buddy-slab 已启用,但 VM 1GiB guest RAM 分配失败;原因是 std JSON target 下 target_os = "linux"ax-alloc#[global_allocator] 仍只在 target_os = "none" 下注册,官方 std/alloc 的全局分配入口没有绑定到 ArceOS allocator。
  • Starry loongarch64 QEMU 全量测试中,SMP4 affinity 用例触发 ax-sync mutex owner 校验失败;原因是 RawMutex::unlock() 的直接 owner handoff 会在 waiter 尚未返回 guard 前让 owner_id 指向另一个 task,调度/迁移窗口下可能出现当前 guard 释放时 owner mismatch。

同时旧的 std = true/false 配置字段、Hermit 伪装路径、以及 USB 后端基于 target_os = "none" 的判断,在统一 std 构建后都容易选错分支,需要清理为显式的 ArceOS std 构建语义。

修改

  • axbuild 统一 Rust OS/app 构建为 std-aware 路径,固定使用源码树内 linux-musl JSON target、-Z build-std=std,panic_abortstd-compat feature 链路和 fake 固定库名占位。
  • 删除 build config 中用户可配置的 std 字段;旧配置出现 std = true/false 时直接报错提示删除。
  • examples 和 std test apps 统一通过 app feature arceos 依赖 ax-std,源码使用自然 crate 名 ax_std,底层接口保持在 ax_std::os::arceos::{api, modules}
  • fake libc.a / libunwind.a 只作为编译器固定库名占位;真实 libc ABI symbols 来自 app 对 ax-std 的直接依赖。
  • StarryOS / Axvisor 迁移到同一套 std-aware 构建入口,继续保留内部 no_std library 作为实现细节。
  • USB 栈改为 umod feature 注入 cfg(umod),否则默认注入互斥的 cfg(kmod);Starry usbfs 常编译,运行时没有 USB host 时跳过挂载。
  • axbuild 在 std C toolchain 环境中注入和 Rust target JSON 匹配的 C/CXX/bindgen flags:loongarch64 使用 -mabi=lp64s -msoft-float,并同步补齐 x86_64、aarch64、riscv64 的 C ABI flags,避免 C build.rs/bindgen 走到和 Rust target 不一致的 ABI。
  • std linker wrapper 对 .rlib/.a archive 参数使用 --start-group/--end-group,让跨 crate interface symbols 在 std-aware rlib 顺序下也能稳定解析。
  • ax-plat-x86-qemu-q35 不再依赖 target_os = "none" 判定导出平台接口实现符号,保证 x86 Q35 平台在 std target 下也能完成链接。
  • Starry RKNPU devfs 模块和 /dev/dri/card1/dev/dma_heap/system 注册只跟随 rknpu feature,不再依赖 target family 或 std-compat,保证 std-aware board 构建仍然暴露 RKNN 用户态需要的设备接口。
  • ax-alloc#[global_allocator] 注册条件从 target_os = "none" 扩展为 target_os = "none" || feature = "global-allocator",并由 ax-std/std-compat 启用,保证 std-aware 构建中的官方 std/alloc 全局分配入口也使用同一个 ArceOS allocator;测试构建仍保持关闭,避免影响 host unit test。
  • ax-syncRawMutex::unlock() 恢复为先清空 owner、再唤醒 waiter;被唤醒任务通过正常 CAS 路径重新获取 mutex,避免 owner id 提前指向尚未持有 guard 的 waiter。

验证

  • cargo fmt
  • cargo test -p axbuild std -- --nocapture
  • cargo test -p axbuild build -- --nocapture
  • cargo xtask clippy --package axbuild
  • cargo xtask clippy --package ax-alloc
  • cargo xtask clippy --package ax-sync
  • cargo xtask clippy --package ax-plat-x86-qemu-q35
  • cargo xtask clippy --package starryos
  • cargo xtask clippy --package starry-kernel
  • cargo xtask starry build --target aarch64-unknown-none-softfloat --config test-suit/starryos/normal/board-orangepi-5-plus/build-aarch64-unknown-none-softfloat.toml
  • cargo xtask starry test qemu --arch loongarch64 --test-group normal --test-case smoke
  • cargo xtask starry test qemu --arch loongarch64 -c affinity
  • cargo xtask starry test qemu --arch loongarch64,本地 45/45 case 通过。
  • cargo xtask axvisor test qemu --arch x86_64 --test-group svm --test-case smoke
  • cargo xtask axvisor build --target aarch64-unknown-none-softfloat --plat_dyn true --config test-suit/axvisor/normal/board-phytiumpi/build-aarch64-unknown-none-softfloat.toml

备注:本地 loongarch64 Starry smoke、affinity 复测和 loongarch64 Starry 全量 QEMU 均已通过。Axvisor x86_64 SVM smoke 本地已完成 std-aware 构建和链接,并启动到虚拟化初始化;本机由于硬件虚拟化/SVM 不可用,在运行态返回 AxErrorKind::Unsupported,CI 的 AMD hosted runner 继续覆盖完整运行态结果。Starry OrangePi NPU 和 Axvisor PhytiumPi 物理板运行态需要 self-hosted board CI 覆盖;本地已完成对应 board build 验证。

追加修复:someboot BSS/TLS 边界

最新一轮检查发现 std/TLS 场景下 someboot 早期 linker 边界还需要收紧:loongarch64 入口原先只清零了 __bss_start 起始的一个机器字,且 loongarch64/x86_64 的 _edata__kernel_load_end__bss_start 位于 .tdata 之前,会让 TLS 初始化数据被排除在 load size 外,或在非 UEFI BSS 清零路径中被覆盖。

本次补充修复:

  • loongarch64 入口改为从 __bss_start 循环清零到 __bss_stop
  • loongarch64/x86_64 linker 脚本把 .tdata 纳入 _edata / __kernel_load_end 之前,并在 __bss_start 前做 8 字节对齐。
  • aarch64 当前已经是 .tdata -> ALIGN(8) -> __bss_start,riscv64 使用字节级 BSS 清零且 __bss_start.tbss 后,本轮不需要同款修改。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo xtask clippy --package someboot
  • cargo xtask arceos test qemu --arch loongarch64 --test-group rust --test-case task/sleep
  • cargo xtask arceos test qemu --arch loongarch64 --test-group rust --test-case task/tls
  • cargo xtask arceos test qemu --arch x86_64 --test-group rust --test-case task/tls
  • cargo xtask arceos test qemu --arch aarch64 --test-group rust --test-case task/tls
  • cargo xtask arceos test qemu --arch riscv64 --test-group rust --test-case task/tls

追加修复:Starry QEMU smoke 超时裕量

CI 中 Test starry riscv64 qemu / run_host 失败于 smoke case:日志显示系统已经启动到 root@starry:/root #,但原配置 timeout = 5,CI runner 上在 shell_init_cmd 输出 All tests passed! 前到达 5.33s 超时。该失败不是功能错误,而是 smoke case 的超时裕量过紧。

本次补充修复:

  • 将 Starry qemu-smp1/smoke 的 riscv64、aarch64、loongarch64 timeout 从 5s 调整为 15s,与 x86_64 smoke 保持一致。
  • 保持 success/fail regex 和启动命令不变,只增加正常 CI 抖动裕量。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo xtask starry test qemu --arch riscv64 --test-group normal --test-case smoke
  • cargo xtask starry test qemu --arch aarch64 --test-group normal --test-case smoke
  • cargo xtask starry test qemu --arch loongarch64 --test-group normal --test-case smoke

追加修复:dev rebase 后的 RKNPU std-compat 与 PCI ACPI cfg

rebase 到最新 dev 后,Starry RKNPU devfs 已从旧 cfg 迁移到 std-compat feature 语义,但 starryosstarry-kernel 的 feature 转发和 devfs cfg 没有完整保留。CI 中 Test starry self-hosted board orangepi-5-plus / run_host 因此仍然出现 NPU 驱动已注册、但 RKNN 用户态打不开 rknpu 设备的问题。同时,OrangePi 5 Plus std/musl board build 暴露出 ax-driver PCI ACPI endpoint IRQ helper 的导出条件和函数本体 cfg 不一致。

本次补充修复:

  • starryosstarry-kernel 增加并转发 std-compat feature。
  • 将 RKNPU devfs 模块和 /dev/dma_heap/system/dev/dri/card1 注册块改为只由 rknpu feature 控制,避免 linux-musl std target 下被 cfg(unix) 误裁剪。
  • 删除未接入的旧 rknpu_card stub,将实际使用的 RKNPU ioctl 命令枚举和用户拷贝 helper 收敛到 card1
  • 对齐 ax-driver ACPI PCI endpoint IRQ helper 的 cfg,避免 std/dyn board build 中 re-export 存在但函数本体被裁掉。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo metadata --no-default-features --features starryos/std-compat,starryos/rknpu,starryos/plat-dyn --format-version 1
  • cargo xtask starry build -c test-suit/starryos/normal/board-orangepi-5-plus/build-aarch64-unknown-none-softfloat.toml
  • cargo xtask clippy --package ax-driver
  • cargo xtask clippy --package starry-kernel
  • cargo xtask clippy --package starryos
  • cargo clippy --no-deps -p starry-kernel --no-default-features --features rknpu,std-compat -- -D warnings
  • cargo clippy --no-deps -p starryos --no-default-features --features rknpu,std-compat,plat-dyn,smp -- -D warnings
  • cargo xtask clippy --package axbuild

备注:本地已完成和失败 job 匹配的 OrangePi 5 Plus std/musl board build;物理板运行态继续由 self-hosted board CI 覆盖。

追加修复:ax-task affinity migration panic

CI rerun 中 Test starry loongarch64 qemu / run_containeraffinity case 触发 axtask/src/api.rs: Migration failed panic。失败点在 set_current_affinity 修改当前任务 affinity 后立刻断言当前 CPU 已经落在新 mask 内;但当前任务迁移是通过 migration task 交给目标 run queue 的调度动作,是否在同一调用栈里立刻重新运行取决于 SMP 调度时机,不能用 panic 作为正常路径检查。

本次补充修复:

  • 删除 set_current_affinity 中迁移后的即时 panic 断言,避免调度时序波动把 affinity 调整变成内核 panic。
  • 保持原有 cpumask 更新和 migration task 触发逻辑不变,不改 Starry affinity 测试配置。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo xtask clippy --package ax-task
  • cargo xtask starry test qemu --arch loongarch64 --test-group normal --test-case affinity

追加修复:x86_64 EFI raw data size

CI rerun 中 Test arceos x86_64 qemu / run_host 只有 thread_test 超时失败。日志显示 OVMF 加载 Boot0003 返回 Unsupported,随后进入 PXE/无启动设备路径;本地复现后确认并非线程用例运行失败,而是 EFI 镜像在 UEFI 加载阶段被拒绝。

根因是 x86_64 linker script 在 .tdata 后额外做了 8 字节对齐,并用对齐后的 _edata 计算 PE header 中的 raw data size;但 objcopy -O binary 生成的 EFI 文件不会物化这段尾部 padding,导致 PE 头声明的初始化数据大小比实际文件内容多几个字节。带 TLS 的 thread_test 正好触发该边界,OVMF 因文件不足以覆盖 header 声明范围而返回 Unsupported

本次补充修复:

  • 删除 x86_64 linker script 中 .tdata 后、_edata 前的额外 ALIGN(8),让 _edata 精确落在实际 loadable data 文件末尾。
  • 保持 .tdata / .tbss 的 TLS 边界符号不变,运行时 TLS 初始化和 BSS 大小计算继续使用原有 _etdata / _etbss 路径。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo xtask clippy --package someboot
  • cargo xtask arceos test qemu --arch x86_64 --test-group std --test-case thread_test
  • cargo xtask arceos test qemu --arch x86_64 --test-group std

追加修复:clone 继承 signal mask

最新 CI 中 Test starry x86_64 qemu / run_containertest-mt-execve 偶发失败在 pending-signal exec 阶段:post-exec image 查询到 SIGUSR1 disposition 已经恢复为 SIG_DFL,但 unblock 后仍可能跑进 pre-exec 的 SIGUSR1 handler 并以普通退出结束。该现象只在 clone/exec 的极短时序窗口中触发。

根因是 Starry 创建新用户线程时 ThreadSignalManager 的 blocked mask 先初始化为空,再由用户态 pthread 入口同步;在新线程第一次进入用户态前,内核 signal 检查可能先看到空 mask,从进程 pending 队列取走原本应保持 blocked 的 SIGUSR1。随后非 leader exec 过程中就会出现 pending signal 被旧 image handler 消费的竞态。

本次补充修复:

  • ThreadSignalManager 增加可指定初始 blocked mask 的构造路径,默认构造语义保持为空 mask。
  • Starry clone / fork / vfork / pthread 创建路径在构造新 Thread 时继承当前线程的 blocked signal mask,保证新 task 从内核对象创建完成开始就符合 POSIX/Linux 线程 signal mask 继承语义。
  • test-mt-execve 的 pending-signal exec 阶段补充 pthread 子线程 mask 继承检查,避免后续回归再次打开该时序窗口。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo xtask starry test qemu --arch x86_64 --test-group normal --test-case test-mt-execve
  • cargo xtask clippy --package starry-signal
  • cargo xtask clippy --package starry-kernel

追加清理:legacy bare target JSON 和 axbuild 非 std 路径

继续清理 std 化后的旧残留时,发现 scripts/targets/pie / scripts/targets/no-pie 下的 legacy unknown-none*.json 已经不再作为实际构建目标使用,但 axbuild 中仍保留了按裸机 JSON target 注入 -Z json-target-spec、拼接 target spec 路径、以及相关单测配置。这些路径会让后续维护者误以为非 std 构建还依赖源码树内 JSON target。

本次补充修复:

  • 删除 scripts/targets/piescripts/targets/no-pie 下不再使用的 legacy bare target JSON,scripts/targets 只保留 std/linux-musl target specs。
  • axbuild 非 std / C app 裸机构建改回使用 Rust 内置 *-unknown-none* target,仅保留 -Z build-std=core,alloc;std 构建继续使用静态 JSON target 和 -Z json-target-spec
  • 移除 cargo_target_json_path、旧 bare cargo config helper、旧 target spec 路径测试,并新增检查确保源码树 target specs 只剩 std 版本。
  • 更新 Starry/QEMU 相关测试 fixture,避免继续引用已删除的 legacy scripts/targets/pie|no-pie 路径。
  • 全仓搜索旧路径、旧 helper 和旧配置字段,确认没有遗留;仅保留用于拒绝 std = true/false 旧字段的单测样例。

追加修复:AIO raw syscall 负数参数符号扩展

x86_64 Starry syscall 分组复测中,test-io-submit 的 raw syscall(SYS_io_submit, ctx, -1, NULL) 没有稳定传入 signed long 的 -1,内核侧可能看到 0x00000000ffffffff 这样的正数计数,从而先走到用户指针访问并返回 EFAULT,而不是测试期望的 EINVAL

本次补充修复:

  • test-io-submittest-io-geteventstest-io-pgetevents 中用于 raw syscall 的负数计数参数显式转换为 (long)-1
  • 保持 syscall 期望 errno 不变,让测试真实覆盖 Linux/raw syscall ABI 下的 signed count 负值校验。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo test -p axbuild
  • cargo xtask clippy --package axbuild
  • cargo xtask starry test qemu --arch x86_64
  • cargo xtask starry test qemu --arch x86_64 -c syscall
  • rg -n "scripts/targets/(pie|no-pie)|targets/(pie|no-pie)|unknown-none[^\\s\\\"']*\\.json|std\\s*=\\s*(true|false)\\b|load_bare|bare_cargo|cargo_target_json_path" --glob '!target/**' --glob '!tmp/**' .
  • find scripts/targets -maxdepth 3 -type f -print | sort

追加重构:ArceOS C app 显式 app-c 构建模式

继续清理 axbuild 的 std/none-C 构建选择时,发现 ArceOS C 测试仍通过 test-suit/arceos/c 目录结构隐式选择 ax-libc C 构建路径,普通 arceos build/qemu/uboot 入口也没有统一的 C app mode 判断。这样容易让 std-aware Rust 构建和 none C 静态库构建继续靠目录约定耦合。

本次补充重构:

  • ArceOS build config 新增 app-c = "..." 字段;有该字段时按 ax-libc + C objects + 内置 *-unknown-none* target 的 C app 路径构建,没有该字段时保持 std-aware Rust 构建。
  • app-c 相对 build config 所在目录解析,必须指向存在目录,且目录内至少包含一个直接 .c 源文件;app-c = "c" 时 app name 取 case/build config 目录名。
  • ArceOS 普通 build/qemu/uboot 和 C test 统一通过 build config mode 分发;C mode 固定内部 Cargo package 为 ax-libc,不走 fake musl/std linker wrapper。
  • Starry/Axvisor build config 若出现 app-c 直接报错,避免字段被静默忽略。
  • 所有 test-suit/arceos/c/**/build-*.toml 增加 app-c = "c",C 测试不再依赖所在目录自动选择构建方式。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo test -p axbuild
  • cargo xtask clippy --package axbuild
  • cargo xtask arceos test qemu --arch x86_64 --test-group c --test-case httpclient
  • cargo xtask arceos test qemu --arch x86_64 --test-group rust --test-case backtrace-raw-normal
  • cargo xtask arceos build --arch x86_64 --config test-suit/arceos/c/httpclient/build-x86_64-unknown-none.toml

追加修复:rebase 最新 dev 后适配统一 ArceOS test suite

rebase 到最新 dev 后,ArceOS Rust/C 测试已经合并为统一 test suite。原分支上的旧 per-case 配置和 app-c 重构在冲突解决后需要跟随新布局,否则 Rust suite 会被误判成 C app,且 std backtrace host symbolize 仍会按 *-unknown-none* 目录查找 ELF。

本次补充修复:

  • 保留最新 dev 的统一 ArceOS Rust/C test suite 布局,删除 rebase 后 Rust build config 中误带入的 app-c = "c" 和旧 std = false 字段。
  • 移除根 workspace 中已经删除的 arceos-rust 残留 member/dependency,并重新生成 Cargo.lock;std app 依赖统一落到 ax-std
  • ArceOS C suite 继续通过 app-c = "c" 显式选择 ax-libc C app 构建,Rust suite 没有 app-c 时保持 std-aware Rust 构建。
  • std-aware Rust test 的 host backtrace symbolizer 改为按实际 linux-musl Cargo target-dir 查找 ELF,而不是按逻辑 none target-dir 查找。
  • std Cargo config 按 build config 中 BACKTRACE / DWARF 生成对应 rustflags,确保 debug-backtrace case 同时具备 debug info 和 frame pointers。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo test -p axbuild
  • cargo xtask clippy --package axbuild
  • cargo xtask arceos test qemu --arch x86_64 --test-group rust --test-case debug-backtrace
  • cargo xtask arceos test qemu --arch x86_64 --test-group rust --test-case all
  • cargo xtask arceos test qemu --arch x86_64 --test-group c --test-case mem

追加修复:affinity migration 唤醒目标 CPU

最新 CI 中 Test starry riscv64 qemu / run_containeraffinity case 在 bug-sched-affinity-pid 阶段触发 kernel task panic;本地重复运行时也复现过同一阶段卡住。根因是当前任务 affinity 变化后通过 migration task 迁入目标 run queue,但 migrate_entry 只把任务放入目标 CPU scheduler,没有像 add_task / unblock_task 那样 kick 目标 CPU。若目标 CPU 正在 idle/wfi,迁移后的任务可能不能及时被调度,进而放大 Starry signal/exit 路径中的调度竞态。

本次补充修复:

  • migrate_entry 在记录目标 run queue CPU id、放入 migrated task 后,对 SMP+IPI 构建调用 kick_remote_cpu(cpu_id)
  • 保持 affinity 迁移的任务状态和 run queue 选择逻辑不变,只补齐与新增任务/普通唤醒一致的远端 CPU 唤醒语义。

追加验证:

  • cargo fmt
  • git diff --check
  • cargo xtask clippy --package ax-task
  • cargo xtask starry test qemu --arch riscv64 --test-group normal --test-case affinity,修复后连续多轮通过。
  • cargo xtask arceos test qemu --arch x86_64 --test-group rust --test-case debug-backtrace

@mai-team-app mai-team-app Bot mentioned this pull request Jun 2, 2026
@ZR233
ZR233 marked this pull request as ready for review June 2, 2026 04:01

@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 #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口从 target_os = "none" / Hermit 分支判断统一迁移到 arceos_std 自定义 cfg 标志路径。通过 axbuild 注入 arceos_std cfg + linux-musl JSON target spec + fake libc.a/libunwind.a,替代旧的 target_os 分支逻辑。

主要改动包括:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64)
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature
  • USB fs 改为运行时探测 USB host
  • Linker scripts 补充 TLS phdrs、.got.init_array
  • scope-local 改为 Once<ItemBox> 延迟初始化
  • ax-std 扩展依赖(ax-allocax-driverax-halax-posix-apiax-runtimelibc

实现逻辑评估

整体架构设计合理:用 arceos_std 区分「ArceOS unikernel 运行时」与「编译目标 OS」是更干净的抽象。USB 后端 feature 化避免了 std-aware target 下误选 host/user backend。usbfs 运行时探测比编译期条件更灵活。scope-localOnce<ItemBox> 延迟初始化是正确的优化。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
cargo clippy -p crab-usb --no-default-features ✅ 通过
cargo clippy -p crab-usb --no-default-features --features umod ✅ 通过
cargo clippy -p crab-usb --no-default-features --features libusb ✅ 通过
cargo test -p scope-local ✅ 8 tests pass(含新增 scope_init_is_per_item_lazy
cargo test -p axbuild ✅ 460 tests pass

发现的问题

1. percpu read_percpu_reg/write_percpu_reg 中存在死代码(非阻塞)

components/percpu/percpu/src/imp.rsread_percpu_reg()write_percpu_reg() 中,arceos_std 已经在第一个 if 分支匹配,第三个分支 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 部分是死代码。建议简化为 cfg!(target_os = "none")。虽然不影响正确性(两个分支做了相同的事),但冗余代码增加阅读负担。

2. 合并冲突状态

当前 PR mergeable_state=dirty,存在与 dev 分支的合并冲突。maintainer_can_modify=true,可以由维护者修复。需要 rebase 或合并最新 dev 后重新验证。

重复/重叠分析

检查了当前 open PR 列表,未发现与本 PR 功能重叠的 PR。PR #1076(QEMU 内自编译)是无关的功能扩展。

结论

架构方向正确,实现质量良好,无阻塞性问题。建议清理 percpu 死代码后合入。合并冲突需要先解决。

Powered by mimo-v2.5-pro

Comment thread components/percpu/percpu/src/imp.rs Outdated
tp = if cfg!(target_os = "linux") {
tp = if cfg!(arceos_std) {
x86::msr::rdmsr(x86::msr::IA32_GS_BASE) as usize
} else if cfg!(target_os = "linux") {

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.

此处 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 是死代码——第一个 if cfg!(arceos_std) 已经匹配了所有 arceos_std 情况。建议改为 cfg!(target_os = "none") 以消除冗余。

同样的问题也存在于 write_percpu_reg() 中(约第 179 行)。

@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 #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口从 target_os = "none" / Hermit 分支判断统一迁移到 arceos_std 自定义 cfg 标志路径。通过 axbuild 注入 arceos_std cfg + linux-musl JSON target spec + fake libc.a/libunwind.a,替代旧的 target_os 分支逻辑。144 个文件变更,+5759/-2498 行。

主要改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64)
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature
  • USB fs 改为运行时探测 USB host
  • Linker scripts 补充 TLS phdrs、.got.init_array
  • scope-local 改为 Once<ItemBox> 延迟初始化
  • ax-std 扩展依赖(ax-allocax-driverax-halax-posix-apiax-runtimelibc
  • 新增 libc_compat.rs(~3066 行),提供完整的 libc ABI 符号实现(malloc/free、pthread、futex、文件系统操作等)

实现逻辑评估

整体架构设计合理:用 arceos_std 区分「ArceOS unikernel 运行时」与「编译目标 OS」是更干净的抽象。USB 后端 feature 化避免了 std-aware target 下误选 host/user backend。usbfs 运行时探测比编译期条件更灵活。scope-localOnce<ItemBox> 延迟初始化是正确的优化。libc compat 层覆盖了 musl std 会弱引用的符号,__cxa_thread_atexit_impl 的实现与 TLS 析构调用链完整。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
cargo check -p crab-usb --no-default-features ✅ 通过
cargo check -p crab-usb --no-default-features --features umod ✅ 通过
cargo check -p crab-usb --no-default-features --features libusb ✅ 通过
cargo test -p scope-local ✅ 10 tests pass(含新增 scope_init_is_per_item_lazy
cargo test -p axbuild ✅ 465 tests pass

发现的问题

1. percpu read_percpu_reg/write_percpu_reg 中存在死代码(非阻塞)

components/percpu/percpu/src/imp.rs 中,arceos_std 已经在第一个 if 分支匹配,第三个分支 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 部分是死代码。建议简化为 cfg!(target_os = "none")。不影响正确性,但冗余代码增加阅读负担。(此问题已被前一位 reviewer 指出。)

2. 合并冲突状态(阻塞)

当前 PR mergeable_state=dirty,存在与 dev 分支的合并冲突。maintainer_can_modify=true。自 PR 创建以来,dev 分支已移除了 [patch.crates-io]ax-errno 补丁,以及 axhal/axruntime 的部分改动。需要 rebase 或合并最新 dev 后重新验证。

重复/重叠分析

检查了当前 open PR 列表(#1076 等),未发现与本 PR 功能重叠的 PR。PR #1076(QEMU 内自编译)是无关的功能扩展。

结论

架构方向正确,实现质量良好,技术上无阻塞性问题。合并冲突需先解决后再合入。建议 rebase 后重新验证并合入。

Powered by mimo-v2.5-pro

Comment thread components/percpu/percpu/src/imp.rs Outdated
tp = if cfg!(target_os = "linux") {
tp = if cfg!(arceos_std) {
x86::msr::rdmsr(x86::msr::IA32_GS_BASE) as usize
} else if cfg!(target_os = "linux") {

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.

此处 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 是死代码——第一个 if cfg!(arceos_std) 已经匹配了所有 arceos_std 情况。建议改为 cfg!(target_os = "none") 以消除冗余。

同样的问题也存在于 write_percpu_reg() 中(约第 179 行的 else if cfg!(any(target_os = "none", arceos_std)) 分支)。

@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 #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口从 target_os = "none" / Hermit 分支判断统一迁移到 arceos_std 自定义 cfg 标志路径。通过 axbuild 注入 arceos_std cfg + linux-musl JSON target spec + fake libc.a/libunwind.a,替代旧的 target_os 分支逻辑。144 个文件变更,+5759/-2498 行。

主要改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64)
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature
  • USB fs 改为运行时探测 USB host
  • Linker scripts 补充 TLS phdrs、.got.init_array
  • scope-local 改为 Once<ItemBox> 延迟初始化
  • ax-std 扩展依赖并新增 libc_compat.rs(3066 行),覆盖 musl std 弱引用的 libc ABI 符号
  • RISC-V image header 改为 trampoline 跳转避免 JAL 越界
  • loongarch64 std 链接过滤 -lgcc_s,非动态平台注入 static relocation-model
  • 修复 fake std libs 归档工具查找逻辑(rust-ar → sysroot llvm-ar → 系统 ar
  • Linker wrapper 由 plat_dyn 显式决定 PIE/no-PIE,不再因发现 axplat.x 误判
  • 移除旧 std = true/false 配置字段,替换为统一 std-aware 路径

实现逻辑评估

架构设计合理:arceos_std 区分「ArceOS unikernel 运行时」与「编译目标 OS」,比旧的 Hermit 或 target_os = "none" 判断更干净。USB 后端 feature 化避免 std-aware target 下误选 host/user backend。usbfs 运行时探测比编译期条件更灵活。scope-localOnce<ItemBox> 延迟初始化是正确的优化,避免了未使用 scope-local item 的初始化开销。libc compat 层覆盖了 musl std 会弱引用的符号(malloc/free、pthread、futex、文件系统操作等),__cxa_thread_atexit_impl 的实现与 TLS 析构调用链完整。RISC-V trampoline 跳转方案正确解决了 std-aware 下 image header 中短 JAL 不够用的问题。

本地验证结果

命令 结果
cargo test -p scope-local ✅ 10 tests pass(含新增 scope_init_is_per_item_lazy
cargo test -p axbuild std ✅ 34 tests pass
cargo test -p axbuild build ✅ 136 tests pass
[patch.crates-io] 检查 ✅ 未发现 crates.io patch

CI 状态

CI 所有 QEMU host runner 测试均为 skipped 状态,self-hosted board 测试为 cancelled 状态。这是 CI 工作流条件触发问题,非 PR 本身导致的失败。本次 PR 未引入新的 CI 失败。

发现的问题

1. percpu read_percpu_reg/write_percpu_reg 中存在死代码(非阻塞)

components/percpu/percpu/src/imp.rsread_percpu_reg()write_percpu_reg() 中,x86_64 分支的 cfg! 判断链中,第一个 if cfg!(arceos_std) 已匹配所有 arceos_std 情况,第三个分支 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 部分是死代码。不影响正确性(两个分支做了相同的事),但冗余代码增加阅读负担。此问题已被前一位 reviewer 指出。

重复/重叠分析

检查了当前 open PR 列表,未发现与本 PR 功能重叠的 PR。PR #1076(QEMU 内自编译)是无关的功能扩展。

结论

架构方向正确,实现质量良好,无阻塞性问题。建议清理 percpu 死代码后合入。

Powered by mimo-v2.5-pro

Comment thread components/percpu/percpu/src/imp.rs Outdated
tp = if cfg!(target_os = "linux") {
tp = if cfg!(arceos_std) {
x86::msr::rdmsr(x86::msr::IA32_GS_BASE) as usize
} else if cfg!(target_os = "linux") {

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.

此处 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 是死代码——第一个 if cfg!(arceos_std) 已经匹配了所有 arceos_std 情况。建议改为 cfg!(target_os = "none") 以消除冗余。

同样的问题也存在于 write_percpu_reg() 中(约第 179 行的 else if cfg!(any(target_os = "none", arceos_std)) 分支)。

(此问题已被前一位 reviewer 指出,此处仅确认。)

@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 #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口从 target_os = "none" / Hermit 分支判断统一迁移到 arceos_std 自定义 cfg 标志路径。通过 axbuild 注入 arceos_std cfg + linux-musl JSON target spec + fake libc.a/libunwind.a,替代旧的 target_os 分支逻辑。148 个文件变更,+5850/-2510 行,16 个 commit。

关键改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64),riscv64 固定 tls-model = "initial-exec"
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature,usbfs 改为运行时探测
  • 新增 libc_compat.rs(3066 行),覆盖 musl std 弱引用的 libc ABI 符号
  • scope-local 改为 Once<ItemSlot> 延迟初始化,避免未使用 item 的初始化开销
  • RISC-V image header 改为 trampoline 跳转(j 1flla/jr)避免 JAL 越界
  • Linker wrapper 由 plat_dyn 显式决定 PIE/no-PIE,按 static/dynamic 拆分文件名避免互相覆盖
  • loongarch64 非动态平台注入 -C relocation-model=static,wrapper 过滤 -lgcc_s/-lgcc
  • 修复 fake std libs 归档工具查找逻辑:rust-ar → sysroot llvm-ar → 系统 ar
  • Axvisor 统一改用 ax_std::os::arceos,不再通过 std::os::arceos 访问

实现逻辑评估

架构设计合理且完整:arceos_std 作为 axbuild 注入的 cfg 标志,区分「ArceOS unikernel 运行时」与「编译目标 OS」,比旧的 Hermit 或 target_os = "none" 判断更干净。fake staticlib 仅满足编译器固定库名查找,真实 libc ABI symbols 由 app 对 ax-std 的直接依赖进入同一构建图。

libc compat 层覆盖了完整的 libc ABI(malloc/free、pthread、futex、文件系统、dir 操作等),__cxa_thread_atexit_impl 实现与 TLS 析构调用链完整。RISC-V trampoline 方案正确解决了 std-aware 下 image header 中短 JAL 不够用的问题。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
cargo check -p crab-usb --no-default-features ✅ 通过
cargo check -p crab-usb --no-default-features --features umod ✅ 通过
cargo check -p crab-usb --no-default-features --features libusb ✅ 通过
cargo test -p scope-local ✅ 10 tests pass(8 unit + 2 doc-tests)
cargo test -p axbuild std ✅ 37 tests pass
cargo test -p axbuild build ✅ 139 tests pass
git merge-tree origin/dev HEAD ✅ 无冲突(mergeable: true)

CI 状态

CI 所有 QEMU host runner 和 self-hosted board 测试均为 skipped 状态。这是 CI 工作流条件触发问题(可能由 fork 推送或 paths filter 导致),非 PR 本身导致的失败。本次 PR 未引入新的 CI 失败。

已知问题

1. percpu read_percpu_reg/write_percpu_reg 中存在死代码(非阻塞)

components/percpu/percpu/src/imp.rs 的 x86_64 分支中,第一个 if cfg!(arceos_std) 已匹配所有 arceos_std 情况,第三个分支 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 部分是死代码。不影响正确性(两个分支做了相同的事),但冗余代码增加阅读负担。此问题已被前两位 reviewer 指出,此处仅确认。

2. libc_compat.rs 中的 strerror 使用 static mut buffer

strerror 使用全局 static mutable buffer,非线程安全。但此行为与 musl 的 strerror 一致(musl 也使用 static buffer),属于 POSIX 传统行为,可接受。

重复/重叠分析

当前仅有 2 个 open PR:#1080(本 PR)和 #1083(release-plz 自动发布 PR)。无功能重叠。

结论

架构方向正确,实现质量良好,无阻塞性问题。当前 HEAD (effaca10e) 已与 dev 无合并冲突。建议合入。

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.

PR #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口从 target_os = "none" / Hermit 分支判断统一迁移到 arceos_std 自定义 cfg 标志路径。通过 axbuild 注入 arceos_std cfg + linux-musl JSON target spec + fake libc.a/libunwind.a,替代旧的 target_os 分支逻辑。163 个文件变更,+5906/-5546 行,17 个 commit。

关键改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64),riscv64 固定 tls-model = "initial-exec"
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature,usbfs 改为运行时探测
  • 新增 libc_compat.rs(3112 行),覆盖 musl std 弱引用的完整 libc ABI 符号
  • RISC-V image header 改为 trampoline 跳转避免 JAL 越界
  • Linker wrapper 由 plat_dyn 显式决定 PIE/no-PIE,按 static/dynamic 拆分文件名避免互相覆盖
  • loongarch64 非动态平台注入 -C relocation-model=static,wrapper 过滤 -lgcc_s/-lgcc
  • 修复 fake std libs 归档工具查找逻辑:rust-ar → sysroot llvm-ar → 系统 ar
  • scope-local 改为 Once<ItemSlot> 延迟初始化,避免未使用 item 的初始化开销
  • Axvisor 统一改用 ax_std::os::arceos,不再通过 std::os::arceos 访问

实现逻辑评估

架构设计合理:arceos_std 作为 axbuild 注入的 cfg 标志区分「ArceOS unikernel 运行时」与「编译目标 OS」,比旧的 Hermit 或 target_os = "none" 判断更干净。fake staticlib 仅满足编译器固定库名查找,真实 libc ABI symbols 由 app 对 ax-std 的直接依赖进入同一构建图。libc compat 层覆盖完整 libc ABI(malloc/free、pthread、futex、文件系统操作等),__cxa_thread_atexit_impl 实现与 TLS 析构调用链完整。RISC-V trampoline 方案正确解决了 std-aware 下 image header 中短 JAL 不够用的问题。USB 后端 feature 化和 usbfs 运行时探测设计合理。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
cargo test -p axbuild std ✅ 37 passed
cargo test -p axbuild build ✅ 139 passed
cargo test -p scope-local ✅ 10 passed(8 unit + 2 doc-tests,含新增 scope_init_is_per_item_lazy
cargo check -p crab-usb --no-default-features ✅ 通过
[patch.crates-io] 检查 ✅ 未发现 crates.io patch
git merge-tree origin/dev HEAD os/StarryOS/kernel/Cargo.toml 存在冲突

CI 状态

CI QEMU host runner 和 self-hosted board 测试均为 skipped/cancelled 状态,属 CI 工作流条件触发问题,非 PR 本身导致。

重复/重叠分析

当前仅有 2 个 open PR:#1080(本 PR)和 #1083(release-plz 自动发布 PR)。无功能重叠。

阻塞问题

1. 与 dev 分支存在合并冲突(阻塞)

os/StarryOS/kernel/Cargo.toml 存在合并冲突。PR 将 ax-driver 改为非 optional(features = ["usb"]),crab-usb/rdrive 改为非 optional,移除了 k230-kpuaxklib。而 dev 分支仍保留这些为 optional 依赖。maintainer_can_modify=true,需要作者 rebase 到最新 dev 后重新验证。

非阻塞问题

2. percpu read_percpu_reg/write_percpu_reg 中存在死代码

components/percpu/percpu/src/imp.rs 的 x86_64 分支中,第一个 if cfg!(arceos_std) 已匹配所有 arceos_std 情况,第三个分支 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 部分是死代码。不影响正确性,但建议简化为 cfg!(target_os = "none")。此问题已被前两位 reviewer 指出。

结论

架构方向正确,实现质量良好。合并冲突为阻塞问题,需 rebase 到最新 dev 后重新验证。percpu 死代码建议一并清理。

Powered by mimo-v2.5-pro

Comment thread components/percpu/percpu/src/imp.rs Outdated
SELF_PTR.read_current_raw()
} else if cfg!(target_os = "none") {
} else if cfg!(any(target_os = "none", arceos_std)) {
x86::msr::rdmsr(x86::msr::IA32_GS_BASE) as usize

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.

此处 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 是死代码——第 119 行的第一个 if cfg!(arceos_std) 已经匹配了所有 arceos_std 情况。建议简化为 cfg!(target_os = "none") 以消除冗余。此问题已被前一位 reviewer 指出,此处仅确认仍然存在。

@@ -173,7 +177,7 @@ pub unsafe fn write_percpu_reg(tp: usize) {
in("edi") ARCH_SET_GS,
in("rsi") tp,
);

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.

同上,此处 cfg!(any(target_os = "none", arceos_std)) 中的 arceos_std 是死代码——第 172 行的 if cfg!(arceos_std) 已经匹配了所有 arceos_std 情况。建议简化为 cfg!(target_os = "none")。此问题已被前一位 reviewer 指出。

@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 #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口统一迁移到 arceos_std 自定义 cfg 标志 + linux-musl JSON target spec + fake libc.a/libunwind.a 路径,替代旧的 target_os = "none" / Hermit 分支判断。164 个文件变更,17 个 commit。

CI 状态

CI 全部通过(workflow conclusion: success)。20 个活跃 job 全部 success,16 个 _container 变体正常 skipped(与 _host 变体互斥)。

关键通过的 CI job 包括:

  • Check formatting / Run sync-lint / Run clippy
  • Test starry riscv64/aarch64/loongarch64/x86_64 QEMU
  • Test arceos loongarch64/x86_64 QEMU
  • Test axvisor x86_64 svm hosted / loongarch64 QEMU
  • Test axvisor self-hosted x86_64 / x86_64 UEFI
  • Test axvisor self-hosted board roc-rk3568-pc-linux / orangepi-5-plus-linux
  • Test starry self-hosted board orangepi-5-plus / licheerv-nano-sg2002
  • Test with std

合并冲突

git merge-tree 确认与 dev 分支无冲突(0 conflicts)。

实现逻辑评估

架构设计合理且完整:

  1. arceos_std cfg 注入:axbuild 通过 rustflags 注入 --cfg arceos_std,比旧的 target_os 判断更干净,不会误匹配宿主构建路径。

  2. Mutex unlock 修复RawMutex::unlock() 从 handoff 模式改为「先清 owner、再唤醒 waiter」,被唤醒任务通过正常 CAS 路径重新获取 mutex,避免了 owner id 提前指向尚未持有 guard 的 waiter 的竞态。此修复解决了 loongarch64 SMP4 affinity 用例的 owner mismatch 问题。

  3. ax-alloc 全局分配器#[global_allocator] 注册条件从 target_os = "none" 扩展为 any(target_os = "none", arceos_std),确保 std-aware 构建使用同一 ArceOS allocator。

  4. Linker scripts:loongarch64/x86_64 的 .tdata 段纳入 _edata/__kernel_load_end 之前,loongarch64 BSS 清零改为完整循环(原先只清零一个机器字),x86_64/aarch64 补充了 tls PHDR。

  5. host-test feature:percpu、kernel_guard、kspin 等组件统一使用 host-test feature 控制宿主测试路径,彻底替代了旧的 target_os = "linux" 三路分支,消除了前几次 review 中指出的死代码问题。

  6. C ABI flags:axbuild 在 std 构建环境中注入与 Rust target JSON 匹配的 C/CXX/bindgen flags(loongarch64 使用 -mabi=lp64s -msoft-float),修复了 lwprintf-rs 等 C 依赖 ABI 不一致问题。

  7. libc compat 层libc_compat.rs 覆盖完整的 musl 弱引用 libc ABI(malloc/free、pthread、futex、文件系统操作、dir 操作等),__cxa_thread_atexit_impl 与 TLS 析构调用链完整。

本地验证

  • git merge-tree origin/dev HEAD:✅ 无冲突
  • git diff --check:✅ 无 whitespace 错误
  • 代码审查:percpu 死代码已修复,mutex 修复正确,allocator cfg 正确,linker scripts 正确

结论

架构方向正确,实现质量良好,CI 全部通过,无阻塞性问题。建议合入。

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.

PR #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口统一迁移到 arceos_std 自定义 cfg 标志 + linux-musl JSON target spec + fake libc.a/libunwind.a 路径,替代旧的 target_os = "none" / Hermit 分支判断。164 个文件变更,17 个 commit。

CI 状态

CI 工作流 Run #26947653417 结论为 success。20 个活跃 host job 全部 success,16 个 _container 变体正常 skipped(与 _host 互斥)。关键通过的 CI job 包括:

  • ✅ Check formatting / Run sync-lint / Run clippy
  • ✅ Test starry riscv64/aarch64/loongarch64/x86_64 QEMU
  • ✅ Test arceos loongarch64/x86_64 QEMU
  • ✅ Test axvisor x86_64 svm hosted / loongarch64 QEMU
  • ✅ Test axvisor self-hosted x86_64 / x86_64 UEFI
  • ✅ Test axvisor self-hosted board roc-rk3568-pc-linux / orangepi-5-plus-linux
  • ✅ Test starry self-hosted board orangepi-5-plus / licheerv-nano-sg2002
  • ✅ Test with std
  • ✅ Run clippy

本地验证结果

验证项 结果
cargo fmt --check ✅ 通过
git diff --check ✅ 无 whitespace 错误
[patch.crates-io] 检查 ✅ 未发现
git merge-tree origin/dev HEAD ⚠️ 一处小冲突(test-futex-clone-thread)

关键代码验证

  1. percpu read_percpu_reg/write_percpu_reg 死代码已修复:已改用 host-test feature 控制,消除了之前 review 指出的 cfg!(any(target_os = "none", arceos_std)) 三路分支死代码问题。现在只有两路:cfg!(feature = "host-test") vs 默认内核路径。

  2. Mutex unlock 修复正确RawMutex::unlock()owner_id.store(0, Release) 清空 owner,再 wq.notify_one(true) 唤醒 waiter。被唤醒任务通过 compare_exchange_weak(0, current_id) CAS 路径重新获取,避免了 owner id 提前指向尚未持有 guard 的 waiter 的竞态。

  3. ax-alloc global_allocator 正确:注册条件为 any(target_os = "none", arceos_std),配合 not(test) 防止影响 host unit test。

  4. kernel_guard host-test noop 实现IrqSave/NoPreempt/NoPreemptIrqSave 不再使用 cfg_if 三路切换,改为统一 struct + host-test feature 选择 noop arch 实现。

  5. scope-local 延迟初始化ItemSlot 包装 Once<ItemBox>,未使用的 scope-local item 不会被初始化,测试 scope_init_is_per_item_lazy 验证了这一点。

合并冲突状态

git merge-tree 显示 test-suit/starryos/normal/qemu-smp4/test-futex-clone-thread/c/src/main.c 存在一处小冲突。该冲突位于测试文件的 C 源码中,不影响核心 Rust 构建。建议作者 rebase 后简单解决。

重复/重叠分析

当前 open PR 仅有 #1080#1083(release-plz 自动发布)。无功能重叠。

结论

架构方向正确,实现质量良好,CI 全部通过,无阻塞性问题。建议合入。

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.

PR #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口统一迁移到 arceos_std 自定义 cfg 标志 + linux-musl JSON target spec + fake libc.a/libunwind.a 路径,替代旧的 target_os = "none" / Hermit 分支判断。161 个文件变更,16 个 commit,+6473/-2831 行。

关键改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64)
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature,usbfs 改为运行时探测
  • 新增 libc_compat.rs(~3100 行),覆盖 musl std 弱引用的完整 libc ABI 符号
  • RISC-V image header 改为 trampoline 跳转避免 JAL 越界
  • ax-sync mutex unlock 修复:先清 owner、再唤醒 waiter
  • ax-alloc global_allocator 扩展为 arceos_std 可用
  • ax-plat-x86-qemu-q35 cfg 扩展为 arceos_std 可用
  • Starry RKNPU devfs cfg 扩展为 arceos_std 可用
  • someboot loongarch64 BSS 清零改为完整循环,linker 脚本 .tdata 纳入 _edata 之前
  • Smoke test timeout 放宽至 15-30s

实现逻辑评估

架构设计合理且完整:arceos_std 作为 axbuild 注入的 cfg 标志区分「ArceOS unikernel 运行时」与「编译目标 OS」,比旧的 Hermit 或 target_os = "none" 判断更干净。

关键修复均正确:

  • Mutex unlock:先 owner_id.store(0, Release) 清空 owner,再 wq.notify_one(true) 唤醒 waiter,被唤醒任务通过 CAS 路径重新获取,避免了 owner id 提前指向尚未持有 guard 的 waiter 的竞态。
  • ax-alloc global_allocatorcfg_attr(all(any(target_os = "none", arceos_std), not(test)), global_allocator) 确保 std-aware 构建使用同一 ArceOS allocator。
  • percpu host-test feature:消除了之前 review 指出的 cfg!(any(target_os = "none", arceos_std)) 三路分支死代码问题。
  • someboot BSS/TLS:loongarch64 从 __bss_start 循环清零到 __bss_stop,linker 脚本 .tdata 纳入 _edata/__kernel_load_end 之前并 8 字节对齐。
  • libc compat 层:覆盖完整 libc ABI(malloc/free、pthread、futex、文件系统操作等)。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
git diff --check ✅ 无 whitespace 错误
cargo test -p scope-local ✅ 10 tests pass(8 unit + 2 doc-tests)
cargo test -p axbuild std ✅ 43 tests pass
cargo test -p axbuild build ✅ 165 tests pass
[patch.crates-io] 检查 ✅ 未发现 crates.io patch
percpu 死代码检查 ✅ 已修复,使用 host-test feature

CI 状态

注意:最新 commit (bad6290dd) 的 CI Run #26990013080 被取消(conclusion: cancelled)。Check formatting / run_host 通过,Detect changed paths 成功,但 Run sync-lint / run_host 和其他 QEMU 测试未执行。

前一个 commit (eca18300ca24) 的 CI Run #26947653417 全部通过(conclusion: success),包括所有 QEMU 测试。最新 commit 仅新增 someboot BSS/TLS 修复,建议 rebase 后重新触发 CI 确认全量测试通过。

合并冲突

git merge-tree origin/dev HEAD 显示 test-suit/starryos/normal/qemu-smp4/test-futex-clone-thread/c/src/main.c 存在合并冲突。mergeable_state: dirtymaintainer_can_modify: true。该冲突为测试文件,不影响核心 Rust 构建,建议 rebase 到最新 dev 后简单解决。

重复/重叠分析

检查了当前 open PR 列表,仅 #1080#1083(release-plz 自动发布 PR)。无功能重叠。

之前 review 评论处理

之前 6 轮 bot review 指出的问题均已解决:

  • percpu 死代码:已改用 host-test feature 控制,消除三路分支
  • 合并冲突:多次 review 时冲突位置不同,当前冲突在测试文件
  • CI 状态:前一个 commit CI 全部通过,最新 commit CI 被取消

结论

架构方向正确,实现质量良好,无代码层面阻塞性问题。合并冲突和 CI 被取消需要处理:建议 rebase 到最新 dev 解决测试文件冲突,重新触发 CI 确认全量测试通过后合入。

Powered by mimo-v2.5-pro

Test User and others added 18 commits June 8, 2026 17:57
- Updated Cargo.toml files to remove deprecated lints related to `arceos_std` and added `std-compat` where necessary.
- Simplified conditional compilation in `axruntime` block module by removing redundant checks for `arceos_std`.
- Adjusted device probing functions to eliminate unnecessary OS checks, focusing on initialization states instead.
- Renamed functions and variables in test scripts to reflect the new `std-compat` feature instead of `arceos_std`.
- Modified build scripts to remove `arceos_std` configurations and ensure compatibility with the new feature structure.
- Enhanced Clippy checks to include `std-compat` in feature sets, ensuring proper validation across architectures.
- Updated test cases to reflect changes in feature handling and ensure no reliance on deprecated configurations.
- Deleted hermit_types.rs and mod.rs to streamline the API.
- Removed conditional compilation for Hermit-specific types in fs.rs and poll.rs.
- Updated sys_getdents64 implementation to eliminate Hermit-specific logic.
- Cleaned up unused configurations and examples related to Hermit target.
- Adjusted imports and references across the codebase to reflect the removal of Hermit-specific types.
…nd remove obsolete files

- Renamed `load_bare_cargo_config` to `load_c_app_cargo_config` for clarity.
- Updated target paths in various build scripts to point to standard targets.
- Removed obsolete target JSON files for no-pie and pie configurations.
- Adjusted tests to reflect changes in target specifications.

@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 #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口统一迁移到 arceos_std 自定义 cfg 标志 + linux-musl JSON target spec + fake libc.a/libunwind.a 路径,替代旧的 target_os = "none" / Hermit 分支判断。217 个文件变更,32 个 commit,+7233/-5051 行。

关键改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec
  • 全局替换 target_os = "none"any(target_os = "none", arceos_std)
  • USB 后端选择从 target cfg 切换到 crate feature,usbfs 改为运行时探测
  • 新增 libc_compat.rs(3249 行),覆盖 musl std 弱引用的完整 libc ABI 符号
  • RISC-V image header 改为 trampoline 跳转避免 JAL 越界
  • ax-sync mutex unlock 修复:先清 owner、再唤醒 waiter
  • ax-alloc global_allocator 扩展为 arceos_std 可用
  • scope-local 改为 Once<ItemSlot> 延迟初始化
  • percpu/kernel_guard/kspin 组件统一使用 host-test feature 控制宿主测试路径
  • 清理 legacy bare target JSON(scripts/targets/pie/no-pie),仅保留 std 版本
  • ArceOS C app 新增 app-c 显式构建模式
  • clone/fork 继承 signal mask
  • AIO raw syscall 负数参数显式 (long)-1 转换

CI 状态

CI Run #5674(attempt 2)结论:success。所有 20+ 个活跃 job 全部通过,包括:

  • ✅ Check formatting / Run sync-lint / Run clippy
  • ✅ Test starry riscv64/aarch64/x86_64 QEMU
  • ✅ Test arceos loongarch64/x86_64/riscv64 QEMU
  • ✅ Test axvisor x86_64 svm hosted / aarch64/loongarch64 QEMU
  • ✅ Test axvisor self-hosted x86_64
  • ✅ Test axvisor self-hosted board orangepi-5-plus-linux / phytiumpi-linux
  • ✅ Test starry self-hosted board orangepi-5-plus
  • ✅ Test with std

_container 变体正常 skipped(与 _host 互斥)。

合并冲突

git merge-tree origin/dev fork/feat/std 确认无冲突(0 conflicts),Cargo.lock 自动合并。

本地验证结果

验证项 结果
cargo fmt --check ✅ 通过
git diff --check ✅ 无 whitespace 错误
[patch.crates-io] 检查 ✅ 未发现
cargo test -p scope-local ✅ 10 tests pass(8 unit + 2 doc-tests,含 scope_init_is_per_item_lazy
cargo test -p axbuild std ✅ 48 tests pass
cargo test -p axbuild build ✅ 173 tests pass

关键代码验证

  1. percpu host-test feature 已统一components/percpu/percpu/src/imp.rs 不再使用 target_os = "none"target_os = "linux" 判断,全部改用 cfg!(feature = "host-test") 二路分支。之前 review 指出的死代码问题已彻底解决。

  2. kernel_guard host-test noop 实现components/kernel_guard/src/arch/mod.rs 新增 host-test 分支使用 noop 模块,IrqSave/NoPreempt/NoPreemptIrqSave 不再使用 cfg_if 三路切换。

  3. Mutex unlock 修复正确RawMutex::unlock()owner_id.store(0, Release) 清空 owner,再 wq.notify_one(true) 唤醒 waiter,避免 owner id 提前指向尚未持有 guard 的 waiter 的竞态。

  4. ax-alloc global_allocator 正确cfg_attr(all(any(target_os = "none", feature = "global-allocator"), not(test)), global_allocator) 确保 std-aware 构建使用同一 ArceOS allocator,test 构建不受影响。

  5. scripts/targets 清理完成:仅保留 std 目录,无遗留 pie/no-pie

  6. std 字段拒绝load_target_from_build_config_rejects_removed_std_field 测试验证旧 std = true/false 字段被正确报错。

重复/重叠分析

当前 open PR 包括 #1080(本 PR)、#1083(release-plz)、#1173(RSS accounting)、#1168(TUI procfs ioctl 修复)等。无与本 PR 功能重叠的 PR。

结论

架构方向正确,实现质量良好,CI 全部通过,无阻塞性问题。之前 review 指出的所有问题均已解决(percpu 死代码、合并冲突、CI 状态等)。建议合入。

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.

PR #1080 Review:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS/Rust app/test/example、StarryOS、Axvisor 统一到官方 Rust std-aware 构建路径,使用 arceos_std cfg 标志 + linux-musl JSON target spec + fake libc.a/libunwind.a 承载 ArceOS runtime,替代旧的 target_os = "none" / Hermit 分支判断。189 个文件变更,+7264/-5022 行,33 个 commit。

实现逻辑评估

架构设计合理且完整:

  1. arceos_std cfg 注入:axbuild 通过 rustflags 注入 --cfg arceos_std,比旧的 target_os 判断更干净,不会误匹配宿主构建路径。
  2. Mutex unlock 修复RawMutex::unlock()owner_id.store(0, Release) 清空 owner,再 wq.notify_one(true) 唤醒 waiter,被唤醒任务通过 CAS 路径重新获取,避免了 owner id 提前指向尚未持有 guard 的 waiter 的竞态。
  3. percpu host-test feature:消除了之前 review 指出的 cfg!(any(target_os = "none", arceos_std)) 三路分支死代码问题。
  4. ax-alloc global_allocator:注册条件为 any(target_os = "none", feature = "global-allocator"),配合 not(test) 防止影响 host unit test。
  5. someboot BSS/TLS:loongarch64 从 __bss_start 循环清零到 __bss_stop,linker 脚本 .tdata 纳入 _edata 之前。
  6. clone signal mask 继承:新线程创建时继承当前线程的 blocked signal mask,符合 POSIX/Linux 线程 signal mask 继承语义。
  7. C ABI flags:axbuild 在 std C toolchain 环境中注入与 Rust target JSON 匹配的 C/CXX/bindgen flags。
  8. libc compat 层:覆盖完整 libc ABI(malloc/free、pthread、futex、文件系统操作等)。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
git diff --check ✅ 无 whitespace 错误
cargo test -p axbuild ✅ 562 tests pass
cargo test -p scope-local ✅ 10 tests pass
git merge-tree origin/dev HEAD ✅ 无冲突
[patch.crates-io] 检查 ✅ 未发现

CI 状态

CI Run #27131402479 仍在进行中(in_progress),但已完成的 15+ 个 job 全部 success:

  • ✅ Detect changed paths / Check formatting / Run sync-lint
  • ✅ Test arceos x86_64/riscv64/aarch64/loongarch64 QEMU
  • ✅ Test axvisor x86_64 svm hosted / loongarch64 QEMU
  • ✅ Test axvisor self-hosted x86_64 / UEFI
  • ✅ Test axvisor self-hosted board roc-rk3568-pc / orangepi-5-plus / phytiumpi
  • 3 个 job 仍在运行中(Starry QEMU x86_64/loongarch64 container, Run clippy)
  • 16 个 _container 变体正常 skipped(与 _host 互斥)

之前 review 评论处理

之前 7 轮 bot review 指出的问题均已解决:

  • percpu 死代码:已改用 host-test feature 控制
  • 合并冲突:当前 HEAD 与 dev 无冲突
  • CI 状态:进行中,已完成部分全部通过

非阻塞性建议

apps/arceos/std/qemu-smp1/io_test/src/main.rs:352thread_test/src/main.rs:170arce_agent/src/lineedit.rs:11 中仍有 "Hermit" 文案残留,cfg 条件已正确迁移到 feature = "arceos",但用户可见消息/注释未同步更新。建议后续清理。

重复/重叠分析

当前 open PR 仅有 #1080(本 PR)和 #1083(release-plz 自动发布 PR)。无功能重叠。

结论

架构方向正确,实现质量良好,无阻塞性问题。建议合入。

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.

PR #1080 审查:feat(std): unify std-aware ArceOS builds

变更概述

本 PR 将 ArceOS 构建入口统一迁移到 arceos_std 自定义 cfg 标志 + linux-musl JSON target spec + fake libc.a/libunwind.a 路径,替代旧的 target_os = "none" / Hermit 分支判断。189 个文件变更,34 个 commit,+7269/-5024 行。

关键改动:

  • 移除 arceos-rust/arceos-rust-interface crate,迁移所有依赖到 ax-std
  • 全架构新增 linux-musl JSON target spec(x86_64/aarch64/riscv64/loongarch64)
  • arceos_std cfg 注入替代 target_os 判断,host-test feature 替代三路分支
  • USB 后端改用 crate feature 选择(umod/kmod/libusb),usbfs 运行时探测
  • 新增 libc_compat.rs(~3100 行),覆盖 musl std 弱引用的完整 libc ABI 符号
  • ax-sync mutex unlock 修复:先清 owner、再唤醒 waiter,CAS 路径重新获取
  • ax-alloc global_allocator 扩展为 arceos_std 可用
  • Starry RKNPU devfs cfg 改为仅由 rknpu feature 控制
  • clone/fork 继承信号 mask(POSIX/Linux 线程语义)
  • migrate_entry 补齐 kick_remote_cpu 远端 CPU 唤醒
  • someboot BSS/TLS 修复(loongarch64 完整清零、x86_64 EFI raw data size)
  • axbuild 统一 std-aware 路径,删除旧 std = true/false 配置字段
  • app-c 字段显式区分 ArceOS C app 构建模式

实现逻辑评估

架构设计合理且完整:

  1. arceos_std cfg 注入:axbuild 通过 rustflags 注入 --cfg arceos_std,比旧的 target_os 判断更干净,不会误匹配宿主构建路径。host-test feature 彻底消除了 percpu/kernel_guard 等组件的三路 cfg 分支。

  2. Mutex unlock 修复正确owner_id.store(0, Release) 先清空 owner,wq.notify_one(true) 再唤醒 waiter,被唤醒任务通过 compare_exchange_weak(0, current_id) CAS 路径重新获取,避免了 owner id 提前指向尚未持有 guard 的 waiter 的竞态。

  3. 信号 mask 继承:clone/fork/vfork/pthread 创建路径在构造新 Thread 时继承当前线程的 blocked signal mask,符合 POSIX/Linux 语义。

  4. affinity migration 唤醒migrate_entry 记录目标 run queue CPU id 后调用 kick_remote_cpu(cpu_id),与 add_task/unblock_task 保持一致的远端 CPU 唤醒语义。

  5. libc compat 层覆盖完整 libc ABI(malloc/free、pthread、futex、文件系统、dir 操作等),__cxa_thread_atexit_impl 与 TLS 析构调用链完整。

CI 状态

CI 工作流 Run #27133236287 结论为 success。20 个活跃 _host job 全部 success,16 个 _container 变体正常 skipped(与 _host 互斥)。

关键通过的 CI job:Check formatting、Run sync-lint、Run clippy、Test starry riscv64/aarch64/loongarch64/x86_64 QEMU、Test arceos riscv64/loongarch64/x86_64 QEMU、Test axvisor(含 x86_64 SVM hosted、x86_64 UEFI、loongarch64 QEMU)、Test axvisor self-hosted board(phytiumpi/orangepi-5-plus/roc-rk3568-pc-linux)、Test starry self-hosted board(orangepi-5-plus/licheerv-nano-sg2002)、Test with std。

本地验证结果

命令 结果
cargo fmt --check ✅ 通过
git diff --check ✅ 无 whitespace 错误
cargo test -p axbuild ✅ 562 passed,0 failed
cargo clippy -p ax-percpu --all-features -- -D warnings ✅ 通过
cargo test -p scope-local ✅ 通过(含 doc-tests)
[patch.crates-io] 检查 ✅ 未发现
percpu host-test feature 代码审查 ✅ 死代码已消除

之前 review 评论处理

之前 8 轮 bot review 指出的问题均已解决:

  • percpu 死代码:已改用 host-test feature 控制,消除了三路 cfg!(any(target_os = "none", arceos_std)) 分支
  • 合并冲突:已解决,当前 mergeable_state: clean
  • CI 状态:最新 run 全部通过

重复/重叠分析

检查了当前 open PR 列表(#1173 RSS accounting、#1168 TUI fix、#1166 等),无与本 PR 功能重叠的 PR。本 PR 专注于 std-aware 构建统一,不与其他 PR 产生冲突。

结论

架构方向正确,实现质量良好,CI 全部通过,本地验证通过,无阻塞性问题。建议合入。

LGTM 👍

Powered by mimo-v2.5-pro

@ZR233
ZR233 merged commit c1522b7 into rcore-os:dev Jun 9, 2026
49 checks passed
@ZR233
ZR233 deleted the feat/std branch June 9, 2026 00:55
This was referenced Jun 9, 2026
aptacc2421 pushed a commit to aptacc2421/tgoskits that referenced this pull request Jun 14, 2026
* feat(std): unify Rust std-aware builds

* fix(axbuild): propagate std target C ABI flags

* fix(axvisor): link x86 platform symbols in std builds

* fix(starry-kernel): keep rknpu devfs in std builds

* fix(ax-alloc): register global allocator for std builds

* refactor(asm): simplify IRQ handling by removing unnecessary conditionals

* refactor(kernel_guard): simplify guard struct definitions and remove unnecessary conditional compilation

* feat(percpu): add host-test feature for Linux user-space fallback and update tests

* fix(task): improve wait queue notification logic and timeout handling

* refactor(someboot): remove arceos_std conditional checks and related code

* feat: add host-test feature to multiple components for improved testing support

* fix(ax-sync): release mutex before waking waiters

* feat(targets): update linker arguments and add eh-frame-header configuration for multiple architectures

* feat(futex): enhance wait/wake logic with readiness checks for improved synchronization

* feat(axtask): add host-test feature for unit testing with host-safe fallbacks

* fix(someboot): correct bss and tls boundaries

* refactor(axhal): simplify platform feature checks and remove redundant configurations

* refactor(ax-driver): simplify conditional compilation for network features

* feat(clippy): add support for ax-hal platform features and target architecture filtering

* refactor(axalloc): simplify global allocator configuration by removing arceos_std checks

* Refactor feature flags and compatibility handling across the project

- Updated Cargo.toml files to remove deprecated lints related to `arceos_std` and added `std-compat` where necessary.
- Simplified conditional compilation in `axruntime` block module by removing redundant checks for `arceos_std`.
- Adjusted device probing functions to eliminate unnecessary OS checks, focusing on initialization states instead.
- Renamed functions and variables in test scripts to reflect the new `std-compat` feature instead of `arceos_std`.
- Modified build scripts to remove `arceos_std` configurations and ensure compatibility with the new feature structure.
- Enhanced Clippy checks to include `std-compat` in feature sets, ensuring proper validation across architectures.
- Updated test cases to reflect changes in feature handling and ensure no reliance on deprecated configurations.

* feat(axalloc, axhal): add global allocator feature and update dependencies

* fix(starry-kernel): keep rknpu devfs in std builds

* feat(build): add support for x86_64-unknown-linux-musl target with kernel PIE link style

* Refactor ArceOS POSIX API: Remove hermit_types and related code

- Deleted hermit_types.rs and mod.rs to streamline the API.
- Removed conditional compilation for Hermit-specific types in fs.rs and poll.rs.
- Updated sys_getdents64 implementation to eliminate Hermit-specific logic.
- Cleaned up unused configurations and examples related to Hermit target.
- Adjusted imports and references across the codebase to reflect the removal of Hermit-specific types.

* fix(starry-kernel): gate rknpu devfs by feature

* fix(ax-task): avoid panicking after affinity migration

* fix(someboot): correct x86_64 EFI raw data size

* fix(starry-kernel): inherit signal mask on clone

* refactor(build): update cargo configuration to use standard targets and remove obsolete files

- Renamed `load_bare_cargo_config` to `load_c_app_cargo_config` for clarity.
- Updated target paths in various build scripts to point to standard targets.
- Removed obsolete target JSON files for no-pie and pie configurations.
- Adjusted tests to reflect changes in target specifications.

* fix(starry-tests): pass signed aio syscall counts

* refactor(axbuild): select ArceOS C apps via app-c

* fix(axbuild): align std branch with consolidated ArceOS tests

* fix(axtask): wake CPUs after affinity migration

---------

Co-authored-by: Test User <test@example.com>
luodeb pushed a commit that referenced this pull request Jun 30, 2026
* feat(std): unify Rust std-aware builds

* fix(axbuild): propagate std target C ABI flags

* fix(axvisor): link x86 platform symbols in std builds

* fix(starry-kernel): keep rknpu devfs in std builds

* fix(ax-alloc): register global allocator for std builds

* refactor(asm): simplify IRQ handling by removing unnecessary conditionals

* refactor(kernel_guard): simplify guard struct definitions and remove unnecessary conditional compilation

* feat(percpu): add host-test feature for Linux user-space fallback and update tests

* fix(task): improve wait queue notification logic and timeout handling

* refactor(someboot): remove arceos_std conditional checks and related code

* feat: add host-test feature to multiple components for improved testing support

* fix(ax-sync): release mutex before waking waiters

* feat(targets): update linker arguments and add eh-frame-header configuration for multiple architectures

* feat(futex): enhance wait/wake logic with readiness checks for improved synchronization

* feat(axtask): add host-test feature for unit testing with host-safe fallbacks

* fix(someboot): correct bss and tls boundaries

* refactor(axhal): simplify platform feature checks and remove redundant configurations

* refactor(ax-driver): simplify conditional compilation for network features

* feat(clippy): add support for ax-hal platform features and target architecture filtering

* refactor(axalloc): simplify global allocator configuration by removing arceos_std checks

* Refactor feature flags and compatibility handling across the project

- Updated Cargo.toml files to remove deprecated lints related to `arceos_std` and added `std-compat` where necessary.
- Simplified conditional compilation in `axruntime` block module by removing redundant checks for `arceos_std`.
- Adjusted device probing functions to eliminate unnecessary OS checks, focusing on initialization states instead.
- Renamed functions and variables in test scripts to reflect the new `std-compat` feature instead of `arceos_std`.
- Modified build scripts to remove `arceos_std` configurations and ensure compatibility with the new feature structure.
- Enhanced Clippy checks to include `std-compat` in feature sets, ensuring proper validation across architectures.
- Updated test cases to reflect changes in feature handling and ensure no reliance on deprecated configurations.

* feat(axalloc, axhal): add global allocator feature and update dependencies

* fix(starry-kernel): keep rknpu devfs in std builds

* feat(build): add support for x86_64-unknown-linux-musl target with kernel PIE link style

* Refactor ArceOS POSIX API: Remove hermit_types and related code

- Deleted hermit_types.rs and mod.rs to streamline the API.
- Removed conditional compilation for Hermit-specific types in fs.rs and poll.rs.
- Updated sys_getdents64 implementation to eliminate Hermit-specific logic.
- Cleaned up unused configurations and examples related to Hermit target.
- Adjusted imports and references across the codebase to reflect the removal of Hermit-specific types.

* fix(starry-kernel): gate rknpu devfs by feature

* fix(ax-task): avoid panicking after affinity migration

* fix(someboot): correct x86_64 EFI raw data size

* fix(starry-kernel): inherit signal mask on clone

* refactor(build): update cargo configuration to use standard targets and remove obsolete files

- Renamed `load_bare_cargo_config` to `load_c_app_cargo_config` for clarity.
- Updated target paths in various build scripts to point to standard targets.
- Removed obsolete target JSON files for no-pie and pie configurations.
- Adjusted tests to reflect changes in target specifications.

* fix(starry-tests): pass signed aio syscall counts

* refactor(axbuild): select ArceOS C apps via app-c

* fix(axbuild): align std branch with consolidated ArceOS tests

* fix(axtask): wake CPUs after affinity migration

---------

Co-authored-by: Test User <test@example.com>
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