Skip to content

cli/tests: Treat spawn exit 127 as not found - #564

Open
Xeonacid wants to merge 1 commit into
radicle-dev:masterfrom
Xeonacid:cli/tests-posix-spawn-exit-127
Open

cli/tests: Treat spawn exit 127 as not found#564
Xeonacid wants to merge 1 commit into
radicle-dev:masterfrom
Xeonacid:cli/tests-posix-spawn-exit-127

Conversation

@Xeonacid

@Xeonacid Xeonacid commented Sep 1, 2026

Copy link
Copy Markdown

program_reports_version is used so that tests which need optional tools such as jq and jj can skip when those tools are not installed. It currently treats only std::io::ErrorKind::NotFound from Command as absence.

Rust's Command uses glibc posix_spawn on Unix. POSIX requires that if execve fails after posix_spawn has already returned success, the child exits with status 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 a 127 status 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 posix_spawn(3) and POSIX.1 on the 127 spawn-error status.

`program_reports_version` skips optional tools such as `jq` and `jj`
when they are missing. It currently only treats `ErrorKind::NotFound`
from `Command` as absence.

Rust's `Command` uses glibc `posix_spawn` on Unix. When execve fails
after spawn has already returned, POSIX requires the child to exit 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 a 127 status 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 posix_spawn(3) and POSIX.1 on the 127 spawn-error status.

Signed-off-by: Xeonacid <h.dwwwwww@gmail.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