Repository navigation
Description
What happened
A test-harness PATH miss surfaced as:
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.
There was no QEMU involved and no toolchain to be corrupt. The process being
spawned was sh, and the spawn failed because a bare program name did not
resolve through PATH. #1389 fixes that particular caller by naming /bin/sh
outright.
The part #1389 does not fix
The error message is wrong for a whole class of failures, not just this one.
os error 2 on spawn means the program was not found. The message responds
to that by asserting the cached toolchain is incomplete or corrupt and listing
five system libraries to install — advice that is unrelated to a missing
executable, and that sends the reader to reinstall things that were never the
problem.
The failure modes are distinguishable and want different messages:
| errno | what it means | useful advice |
|---|---|---|
NotFound (2) |
the binary is not at that path | name the path that was tried; is the toolchain extracted? is it a bare name that needs PATH? |
PermissionDenied (13) |
present, not executable | check the exec bit |
| shared-library load failure | present, deps missing | this is where libgcrypt/glib2/pixman/SDL2/libslirp belongs |
Only the third case justifies the current text, and it is the one case the
current text cannot actually detect — a missing .so does not surface as
os error 2.
Suggested shape
Branch on std::io::Error::kind() at the spawn site and say what was actually
observed, including the resolved path that was attempted. Keep the runtime-deps
list, but attach it to the case it explains.
Why it matters
This is the error a user meets when an emulator run fails on their machine. It
currently costs them a round of installing unrelated system packages before
they can discover the real cause. It also cost a CI debugging session here —
the message pointed at the emulator, and the defect was one bare program name
in a test helper.
Found while investigating an ubuntu CI failure on #1384; the narrow fix is
#1389.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
fix(emulator): diagnose a spawn failure instead of blaming the toolchain