fix(emulator): diagnose a spawn failure instead of blaming the toolchain - #1391
Merged
Conversation
|
Warning Review limit reachedNext included review available in 59 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 |
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
force-pushed
the
fix/1390-spawn-error-diagnosis
branch
from
August 23, 2026 21:07
83c5bc3 to
86cc220
Compare
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.
Closes #1390.
The message was wrong for every case it fired on
Every failure to spawn the emulator went through
build_linux_macos_qemu_hint: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 a missing.sosurfaces as exit code 127, which themonitor already detects thirty lines below and already words correctly:
So on the spawn path the runtime-deps text was never the right answer for
anything. A reader whose real problem was a missing binary got sent to
reinstall five libraries that were never involved.
Not hypothetical — it cost a debugging session in this repo. A CI failure read
failed to launch QEMU at sh: No such file or directoryfollowed by adviceabout pixman and SDL2; the actual defect was one bare program name in a test
helper (#1389), and nothing about QEMU or system libraries was wrong.
What it says now
The spawn site branches on
io::Error::kind():NotFoundPermissionDeniednoexecmountsbuild_linux_macos_qemu_hintis untouched and still used by the exit-127 path,which is the one place it is correct.
Tests
Three, and the first one asserts a negative — that a missing binary's message
contains none of
libgcrypt,glib2,pixman,SDL2,libslirp. That is theactual regression to guard: the failure here was never a crash, it was
confidently wrong advice, and only an assertion about what the message must
not say can catch it coming back.
soldr cargo test -p fbuild-daemon --lib— 246 passed. clippy-D warningsclean.