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.
What happened
A test-harness PATH miss surfaced as:
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 notresolve through PATH. #1389 fixes that particular caller by naming
/bin/shoutright.
The part #1389 does not fix
The error message is wrong for a whole class of failures, not just this one.
os error 2on spawn means the program was not found. The message respondsto 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:
NotFound(2)PermissionDenied(13)libgcrypt/glib2/pixman/SDL2/libslirpbelongsOnly the third case justifies the current text, and it is the one case the
current text cannot actually detect — a missing
.sodoes not surface asos error 2.Suggested shape
Branch on
std::io::Error::kind()at the spawn site and say what was actuallyobserved, 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.