You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c7a3944
Browse filesBrowse the repository at this point in the historyBrowse files
Thales
committed
Catch a wrong-architecture FFmpeg, and say what it is
An Apple Silicon Mac reported "Bad CPU type in executable (os error 86)" on
install, and the same machine later reported it again from inside a job, this
time naming ffprobe (#637).
The trigger is that the macOS FFmpeg fallback is architecture-blind. The primary
source publishes per-architecture builds and is picked by std::env::consts::ARCH.
The fallback, evermeet.cx, is one URL and one hash for both architectures, and
publishes Intel builds. So when the primary is unreachable, which is the
reporter's situation, an Apple Silicon Mac is handed a binary it cannot execute
unless Rosetta happens to be installed. A bare exec() never triggers Rosetta's
install-on-demand prompt, so it just fails.
That source gap is not fixed here; it needs an arm64 build to point at, and
pinning one means verifying its hashes first. What is fixed is everything that
turned it into a dead end.
ffprobe is now executed, not stat'd. Verification ran ffmpeg and only checked
that ffprobe existed, so a pair that disagreed about architecture passed setup
and failed later inside Python as "Could not read file duration: [Errno 86]".
That is why the issue title names ffprobe. The data directory is prepended to
every child's PATH, so a stale wrong-arch ffprobe there also shadows a working
system one. ffprobeReady now reports whether it runs rather than whether the
file is present, which had both cases backwards: a wrong-arch binary counted as
ready, and a working ffprobe found on PATH did not.
A present-but-unusable binary no longer ends the search. resolve_existing_ffmpeg
only asks whether the file exists, so a bad download failed identically on every
launch afterwards with nothing to do but delete the folder by hand. It now falls
through to the system PATH and the download paths, which can replace it. An
explicit STEMDECK_FFMPEG override is exempt: that file is the user's choice and
replacing it is not ours to make.
The setup wizard stops calling it a network problem. The hint was attached to
every failure of the step, so an architecture mismatch was reported as a
firewall block. It now recognises EBADARCH and gives the two things that
actually work: install Rosetta, or point STEMDECK_FFMPEG_URL at a matching
build.
ffprobe_beside replaces a .parent().unwrap_or_else() whose fallback was
unreachable, since parent() on a bare file name is Some("") rather than None. It
reached the right answer by accident and the fallback it named was wrong; the
test pins the behaviour so a cleanup does not "fix" it into a bug.
Verified: cargo fmt, clippy --tests -D warnings and test on Windows (96) and on
the Linux target via WSL (105). The macOS cfg blocks do not compile on either
host and are left to PR CI.
0 commit comments