Skip to content

Fix macOS FFmpeg download reliability (mirror, timeout, retry, errors) - #390

Merged
thcp merged 6 commits into
mainfrom
fix-macos-ffmpeg-reliability
Aug 17, 2026
Merged

Fix macOS FFmpeg download reliability (mirror, timeout, retry, errors)#390
thcp merged 6 commits into
mainfrom
fix-macos-ffmpeg-reliability

Conversation

@thcp

@thcp thcp commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two commits:

  • The fix: evermeet.cx was macOS's single FFmpeg source, hardcoded with no fallback, no connect-timeout (curl fell back to the OS default, ~60-130s), and produced an unreadable, mislabeled raw curl error on failure ([Bug]: Checking FFmpeg #388 is a direct hit of this). Now: a faster/clearer/retrying download path shared with Linux, plus - macOS specifically - a real second source (shaka-project's GitHub-Releases-hosted static builds) with evermeet.cx demoted to fallback. Closes [Bug]: Checking FFmpeg #388. Closes Setup wizard: FFmpeg download has no fallback, hangs ~75s, and gives an unreadable error on failure #389.
  • A way to actually verify it: added macos-check.yml, an on-demand (workflow_dispatch) build/clippy/test job on the org's self-hosted macOS runner. ci.yml is 100% ubuntu-latest, so #[cfg(target_os = "macos")] code has never had a real compiler pass before merging - this fills that gap without changing what runs on every PR.

Test plan

  • cargo fmt --check / cargo clippy -- -D warnings clean for the #[cfg(unix)] shared code, verified via WSL (real compile - Linux counts as unix)
  • All 4 new pinned SHA256 hashes independently verified: downloaded fresh, hashed locally, cross-checked against the release notes' own MD5s (exact match), confirmed valid Mach-O 64-bit binaries via magic bytes
  • Real macOS compiler pass - not yet run. Plan to trigger macos-check.yml against this branch before merging; will report results here.
  • Manual test of the fallback path actually triggering (e.g. temporarily pointing the primary at a URL that 404s) - not yet done, macOS-only

Thales added 2 commits August 17, 2026 21:53
…led error

Root cause of the setup wizard's "Checking FFmpeg" failures (#388): a single
hardcoded source (evermeet.cx) with no fallback, no connect-timeout (curl
fell back to the OS default, ~60-130s, before giving up), an unreadable raw
curl error, and a shared error-message helper that hardcoded "runtime pack"
regardless of what was actually being downloaded.

download_file (#[cfg(unix)], compiler-verified via WSL):
- label parameter replaces the hardcoded "runtime pack" text
- --connect-timeout 20 added, so an unreachable host fails in ~20s
- retry with backoff (3 attempts, 2s/5s) on connection-class curl exit codes
  only (6/7/28 - resolve/connect/timeout), never on a failure retrying can't
  fix, like a checksum mismatch
- a clear, actionable message replaces the raw curl dump

setup.js: the FFmpeg step now surfaces a hint pointing at the (previously
undocumented-in-UI) STEMDECK_FFMPEG_URL override on failure.

download_macos_ffmpeg (#[cfg(target_os = "macos")]): primary source is now
shaka-project/static-ffmpeg-binaries - built from source via GitHub Actions,
served from GitHub Releases (GitHub's global CDN), per-architecture raw
static binaries. evermeet.cx becomes the fallback, tried only if the primary
fails outright. An explicit STEMDECK_FFMPEG_URL override still bypasses both,
unchanged from before. All four new pinned hashes were independently
verified before pinning: downloaded fresh, sha256 computed locally,
cross-checked against the release notes' own published MD5s, and confirmed
as valid Mach-O 64-bit binaries via magic bytes.

Verification note: the macOS-specific dispatch code could not be
compiler-verified on this Linux dev machine (cfg-gated code is stripped
before semantic analysis on a non-matching target, and cross-compiling to
macOS fails without Apple's toolchain). Syntax-valid per cargo fmt and
carefully hand-traced, but needs a real macOS compiler pass - see the
companion macos-check.yml workflow.

Closes #388, #389
ci.yml (PR-triggered) is 100% ubuntu-latest, so code behind
#[cfg(target_os = "macos")] has never had a real compiler pass before
merging - that cfg-gated code is stripped before semantic analysis even
starts on a non-matching target, not just skipped at test time.
macos-release.yml already has a real macOS runner, but only fires on
release: published and does the full signed/packaged build.

This is deliberately narrow: build/clippy/test only, workflow_dispatch only
(not on every PR/push, so the runner's load and cost don't change from
today), never touches signing, packaging, or uploads.
thcp added a commit that referenced this pull request Aug 17, 2026
## Summary

Bootstrapping commit split out of #390 - GitHub only allows dispatching
a `workflow_dispatch` workflow that already exists on the default
branch, so this needs to land on `main` before it can be used to
actually verify #390's macOS-specific changes.

`ci.yml` (PR-triggered) is 100% `ubuntu-latest`, so code behind
`#[cfg(target_os = "macos")]` has never had a real compiler pass before
merging - that cfg-gated code is stripped before semantic analysis even
starts on a non-matching target, not just skipped at test time.
`macos-release.yml` already has a real macOS runner, but only fires on
`release: published` and does the full signed/packaged build.

This is deliberately narrow: build/clippy/test only, `workflow_dispatch`
only (not on every PR/push, so the runner's load and cost don't change
from today), never touches signing, packaging, or uploads.

## Test plan

Purely additive CI config, inert until manually triggered. No app code
touched.
Thales added 4 commits August 17, 2026 22:01
This workflow's first run found unused_variables/dead_code in
ensure_torch_device, classify_cuda_install_error, and
child_output_with_timeout -- none touched by this branch. Nothing has ever
type-checked the macOS target before this workflow existed, so these predate
it rather than being caused by it. Suppressed the same way as the 3
pre-existing Linux-side clippy lints, so a real regression isn't lost in
known noise.
…:env

mod tests's existing imports are explicit (no glob), so std::env was never
in scope for a test written outside where it's actually used. Caught by the
new macos-check.yml workflow's first real run against this branch - Linux
never compiles this test at all (it's #[cfg(target_os = "macos")]), so WSL
had nothing to catch it with. The import itself is gated the same way so it
doesn't go unused on non-macOS builds, where nothing else in the test module
references env:: directly.
Matches the pattern of the actual last version-bump commit (b2379ed): only
templates/stemdeck.xml is hand-edited. 0.11.0 was never published (stayed a
draft), so 0.11.1 will be the first release carrying everything since 0.9.0 -
the template tracks that, not the skipped draft version.
@thcp
thcp merged commit a3e5473 into main Aug 17, 2026
10 checks passed
@thcp
thcp deleted the fix-macos-ffmpeg-reliability branch August 17, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup wizard: FFmpeg download has no fallback, hangs ~75s, and gives an unreadable error on failure [Bug]: Checking FFmpeg

1 participant