Manifest-based binary resolution (glibc/musl aware, sha256-verified) + cross-platform encode tests#21
Merged
Conversation
…platform encode tests Implements the client-side half of issue #20 while guaranteeing existing installs are never disturbed. - add static_ffmpeg/manifest.py: platform-tuple detection (os/arch/libc, so glibc vs musl Linux builds are distinguished), zackees/manifest.json Catalog resolution, and sha256-verified downloads. Best-effort and disabled by default (opt in via STATIC_FFMPEG_MANIFEST_URL) until ffmpeg-bins2 + CDN are live. - run.py resolves via the manifest first and falls back to the frozen legacy ffmpeg_bins URLs on any failure; downloads are sha256-verified when the manifest supplies a hash. Current/old behavior is unchanged. - tests/test_encode.py: real end-to-end encode (lavfi -> H.264/AAC mp4) + probe, riding every existing per-platform test workflow. - tests/test_manifest.py: offline resolver unit tests + an 8-target contract test against manifest.example.json. - document the migration and backward-compat guarantee in README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Implements the client-side foundation of #20 and the cross-platform encode-test guarantee, without disturbing any existing install.
What this PR does
Backward compatibility (hard requirement)
ffmpeg_binsper-platform zip URLs are untouched and remain the default source. Old installs — which ship their ownrun.py— keep resolving to the exact same URLs. This PR only changes behavior for new/updated installs, and even then falls back to the legacy URL on any failure.Manifest-based resolution (
static_ffmpeg/manifest.py){os, arch, libc}. Linux distinguishes glibc vs musl (viaplatform.libc_ver()→ldd→ musl-loader probe), so we can ship both a glibc-2.17 baseline and a musl build per arch.zackees/manifest.jsonCatalog (channel → release → per-platform asset).sha256after download; a mismatch deletes the file and raises.None(→ legacy fallback) when the manifest is unset, unreachable, malformed, or missing the platform. Opt in withSTATIC_FFMPEG_MANIFEST_URL; flip the default onceffmpeg-bins2+ CDN are live.Tests
tests/test_encode.py: a real small encode — synthesizes 1s of video+audio via lavfi, encodes to H.264/AAC mp4, and probes it back asserting a video stream. Rides all five existing per-platform test workflows (Win x64, macOS x64/ARM, Ubuntu x64/ARM), so every platform is guaranteed to actually encode, not just print-version.tests/test_manifest.py: offline resolver unit tests (glibc/musl split, sha256 verify, disabled→None) + an 8-target contract test againstmanifest.example.json.Docs
manifest.example.jsondocuments the exact catalog contract for all 8 issue targets (win x64/arm, mac x64/arm, linux x64/arm × glibc/musl), with CDN-frontedurls[].Verified locally
pytest tests/→ 15 passed, 1 skipped (Windows-only permission test).flake8clean ·mypyclean ·pylint10.00/10.Out of scope (tracked follow-ups on #20)
These are operational/infra steps that can't be completed from a coding session and stay tracked on the issue:
zackees/forgefor all 8 targets.ffmpeg-bins2, storing binaries in LFS, and serving them via the CDN-frontedwwwsite.manifest.json(real versions/sizes/sha256/urls) and flippingDEFAULT_MANIFEST_URLon.Closes part of #20.
🤖 Generated with Claude Code