fix(test): spawn the emulator test harness via an absolute /bin/sh - #1389
Merged
Conversation
An ubuntu runner failed with:
called `Result::unwrap()` on an `Err` value: DeployFailed(
"failed to launch QEMU at sh: No such file or directory (os error 2).
The cached QEMU toolchain may be incomplete or corrupt. On Linux/macOS,
also ensure runtime deps are installed: libgcrypt, glib2, pixman,
SDL2, and libslirp.")
No QEMU is involved. `test_process_command` builds a fake process that just
prints canned lines, and on Unix it returned a bare `sh` for the runtime to
resolve through PATH. When that lookup misses, the spawn error is reported by
the QEMU launch path — so a PATH problem in the test harness reads as a
corrupt emulator toolchain, complete with advice about installing pixman.
The Windows branch of the same function already builds an absolute path
(`%SystemRoot%\System32\cmd.exe`); this side just never did. POSIX requires
`/bin/sh`, so naming it outright takes the runner's environment out of the
equation rather than hoping PATH is well-formed.
This is the only bare-program spawn of its kind in the workspace.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 32 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 23, 2026
zackees
added a commit
that referenced
this pull request
Aug 23, 2026
Closes #1390. Every failure to spawn the emulator was reported through `build_linux_macos_qemu_hint`, which asserts the cached QEMU toolchain is incomplete or corrupt and lists five system libraries to install. That advice fits exactly one failure mode — a missing shared library — and that mode cannot reach this code path: the dynamic loader runs *after* a successful `execve`, so it surfaces as exit code 127, which the monitor already detects and already words correctly a few lines below. So on the spawn path the runtime-deps text was never the right answer. A reader whose actual problem was a missing binary got sent to reinstall libgcrypt, glib2, pixman, SDL2 and libslirp — none of which were involved. That is not hypothetical: it cost a CI debugging session here, where the real defect was one bare program name in a test helper (#1389) and the message pointed at the emulator toolchain. The spawn site now branches on `io::Error::kind()`: - `NotFound` — names the path that was tried, says nothing ran, and says outright that reinstalling runtime libraries will not help. - `PermissionDenied` — present but not executable; check the exec bit and `noexec` mounts. - anything else — the path plus the OS error verbatim, rather than a guess at the cause. `build_linux_macos_qemu_hint` is unchanged and still used by the exit-127 path, which is where it belongs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
zackees
added a commit
that referenced
this pull request
Aug 23, 2026
…ain (#1391) Closes #1390. Every failure to spawn the emulator was reported through `build_linux_macos_qemu_hint`, which asserts the cached QEMU toolchain is incomplete or corrupt and lists five system libraries to install. That advice fits exactly one failure mode — a missing shared library — and that mode cannot reach this code path: the dynamic loader runs *after* a successful `execve`, so it surfaces as exit code 127, which the monitor already detects and already words correctly a few lines below. So on the spawn path the runtime-deps text was never the right answer. A reader whose actual problem was a missing binary got sent to reinstall libgcrypt, glib2, pixman, SDL2 and libslirp — none of which were involved. That is not hypothetical: it cost a CI debugging session here, where the real defect was one bare program name in a test helper (#1389) and the message pointed at the emulator toolchain. The spawn site now branches on `io::Error::kind()`: - `NotFound` — names the path that was tried, says nothing ran, and says outright that reinstalling runtime libraries will not help. - `PermissionDenied` — present but not executable; check the exec bit and `noexec` mounts. - anything else — the path plus the OS error verbatim, rather than a guess at the cause. `build_linux_macos_qemu_hint` is unchanged and still used by the exit-127 path, which is where it belongs. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
Check (ubuntu-latest)failed on #1384 — a PR that touches none of this:No QEMU is involved
test_process_commandbuilds a fake process that prints canned lines, so themonitor logic can be tested without an emulator. On Unix it returned a bare
sh, left for the runtime to resolve through PATH:When that lookup misses, the spawn failure surfaces through the QEMU launch
path — so a PATH problem in the test harness is reported as a corrupt emulator
toolchain, complete with advice to install pixman and SDL2. Anyone debugging
this from the message alone would go a long way in the wrong direction.
Fix
The Windows branch of the same function already builds an absolute path:
The Unix branch just never did. POSIX requires
/bin/sh, so naming it outrightremoves the runner's environment from the equation rather than hoping PATH is
well-formed in whatever context the test binary runs.
Grepped the workspace: this was the only bare-program spawn of its kind.
Scope
Deliberately narrow. The misleading error message — a spawn failure reported
as "the cached QEMU toolchain may be incomplete or corrupt" — is a real
separate problem worth fixing, since it will mislead on genuine spawn failures
too. It belongs in its own change against the deploy error path, not bundled
into a one-line test-harness fix.
Verified:
soldr cargo test -p fbuild-daemon --lib tests_process— 9 passed,clippy
-D warningsclean. I cannot reproduce the PATH miss locally (Windowshost), so the argument here is that the fix removes the dependency the failure
was on, not that I watched it go from red to green.