mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-02 01:40:28 +08:00
`fn program_reports_version` skips optional tools such as `jq` and `jj` when they are missing. It currently only treats an error returned by `std::process::Command::status` of kind `std::io::ErrorKind::NotFound` as absence. Rust's `std::command::Command` uses glibc's `posix_spawn` on Unix. When `execve` fails after `spawn` has already returned, POSIX requires the child to exit with code 127 rather than reporting `errno` to the parent. glibc usually copies that failure back through a `CLONE_VM|CLONE_VFORK` shared-stack channel, but not every implementation preserves it. qemu-user, OpenBSD, and HPPA surface a successful `spawn` and an exit code of 127 instead. On those platforms the helper panics, so tests that are meant to skip without `jq` or `jj` fail. Treat exit status 127 the same as `NotFound`. See `man:posix_spawn(3)` and POSIX.1. Signed-off-by: Xeonacid <h.dwwwwww@gmail.com>