ingest: bundle ingestion script (pkg.tar.zst -> repo)#4
Conversation
|
Additional verification, independent of the ctypes/libzstd harness mentioned above: extracted the real committed bundle using Windows' built-in WSL-side, |
Replaces the manual "hand-copy bundle contents into FFmpeg/" seam that
caused a past stale-binary accident. Extracts the MINGW64 bundled
package into FFmpeg/{bin,include,lib,share} with clean-replace
semantics, dropping the ffplay/SDL2/openal trio PR InitialForce#1 already excludes
and reconstructing FFmpeg/bin/x64 (a load-bearing probe path used by
the CppSharpUnsafeGenerator and FFmpegBinariesHelper, not duplicate
cruft -- see build/README.md for the investigation). Runs sanity
checks (exe size, complete av*-if-* set, --disable-gpl build
configuration) before ever touching the working tree, and defaults to
a dry-run diff report; --apply is required to actually write.
Commit 9ea90b6 treated these as stale duplicate cruft left over from PR InitialForce#1's bin/ trio-drop. That premise was wrong: avdevice-if-61.dll, hard-imported by the slim ffmpeg.exe/ffprobe.exe, itself imports SDL2.dll and libopenal-1.dll. Dropping them from bin/x64 broke every spawned-exe code path with 0xC0000135 (regression found against DESKTOP-12084). Only ffplay.exe -- SDL2/openal's actual sole consumer -- stays excluded; SDL2/openal are load-bearing everywhere.
The trio-drop premise (ffplay.exe/SDL2.dll/libopenal-1.dll all share ffplay.exe as their only consumer) was wrong for SDL2/openal: a regression agent found avdevice-if-61.dll -- hard-imported by the packed ffmpeg.exe/ffprobe.exe -- itself imports both, and PR InitialForce#1 dropping them broke every spawned-exe code path with 0xC0000135. Narrow DROPPED_BIN_FILES to {ffplay.exe} and drop the now-incorrect bin/x64 SDL2/openal special-casing in the diff report and undocumented- removal check -- both DLLs flow through the existing bin/x64 *.dll mirror like anything else, no special handling needed once they're not excluded from bin/ in the first place. Re-verified against the real committed bundle: exactly one documented skip (ffplay.exe), with SDL2/openal correctly reported as pending additions to the currently stale committed tree.
4407f96 to
a3d9774
Compare
Summary
Adds
scripts/ingest_bundle.py, replacing the manual "hand-copy bundle contents intoFFmpeg/" seam that caused a past stale-binary accident.Given a local
mingw-w64-x86_64-ffmpeg-if-bundled-*.pkg.tar.zst(or--from-release <MINGW-packages tag>, downloaded viagh), the script extracts the MINGW64 bundled package payload (mingw64/{bin,include,lib,share}), runs sanity checks, prints an EOL-normalization-aware diff report against the committedFFmpeg/tree, and only writes (clean-replace) with an explicit--applyflag. Default is dry-run/report-only.FFmpeg/bin/x64/investigation (mandatory pre-work per bead)Confirmed via git history + code search that
FFmpeg/bin/x64/is not duplicate cruft -- it's a load-bearing legacy probe path:build/generate-bindings.ps1/.shresolve<BinariesPath>/x64and pass it toFFmpeg.AutoGen.CppSharpUnsafeGeneratorvia--bin.CliOptions.csdefaultsFFmpegBinDirto<FFmpegDir>/bin/x64.FFmpeg.AutoGen.Example/FFmpegBinariesHelper.csprobesFFmpeg/bin/x64at runtime forDynamicallyLoadedBindings.build/extract-ffmpeg.ps1already reconstructs it (copies all*.dllfrombin/intobin/x64/) "for generator compatibility".ingest_bundle.pyreproduces this same reconstruction on every ingest, inheriting the ffplay.exe exclusion applied to top-levelbin/(see "What gets excluded" below for why SDL2/openal are not excluded here despite an earlier version of this PR treating them the same as ffplay.exe).What gets excluded
ffplay.exeexists in upstream bundles but is intentionally not committed (PR #1) -- it isn't packed byFFmpeg.AutoGen.Redistand has no consumer in MotionCatalyst. The script drops it during ingest and reports it explicitly as "dropped during ingest" regardless of whether that produces a tree diff.Update, post-review: this PR originally also dropped
SDL2.dll/libopenal-1.dllalongsideffplay.exe, on PR #1's original premise thatffplay.exewas their only consumer. A regression agent (DESKTOP-12084) found that premise wrong:avdevice-if-61.dll, hard-imported by the packedffmpeg.exe/ffprobe.exe, itself imports bothSDL2.dllandlibopenal-1.dll, so dropping them broke every spawned-exe code path with0xC0000135. Narrowed the drop-list to{ffplay.exe}only, and removed the now-incorrectbin/x64SDL2/openal special-casing that had been added alongside the original (wrong) trio-drop -- see "Bug caught during review" below for that part of the history. This PR is held pending a separate fix PR (restoringSDL2.dll/libopenal-1.dllto top-levelbin/and repackaging as Redist 7.1.3) landing first; see Deviations.AC evidence
Ran the real script (dry-run, then
--apply) against the actual committedmingw-w64-x86_64-ffmpeg-if-bundled-7.1-1-any.pkg.tar.zst.Post scope-change (ffplay.exe-only drop-list), a fresh dry run against the still-current (pre-7.1.3) committed tree:
Exactly one documented skip (
ffplay.exe), andSDL2.dll/libopenal-1.dllnow correctly show as pending additions to the currently-stale committedbin/tree -- consistent with the regression finding above. (bin/x64/already carries both onmaster, unaffected by PR #1, which only ever touched top-levelbin/.)Earlier, pre-scope-change AC evidence (drop-list still included the trio,
--applyrun against the same bundle) showed thebin/x64stale-copy cleanup described in the investigation section above:That
--applyrun's two deletions were subsequently reverted (commitd31002f) once the regression finding above showed those "stale" x64 copies were in fact still load-bearing.Sanity checks verified against both a synthetic clean payload (built from the real committed, GPL-free binaries -- passes) and a doctored payload (
avutilbytes patched to include--enable-libx264) -- correctly fails withavutil-if-59.dll build configuration contains '--enable-libx264' -- a GPL codec appears enabledand exit code 1, without touchingFFmpeg/. The GPL check reads FFmpeg's own embedded./configurestring inavutilrather than naive cross-binary substring search, to avoid false positives from legitimate H.264 decoder-quirk strings, AVI/MOV fourcc tables, and CLI encoder-name tables that all containx264/x265bytes.Extraction was verified via two independent, off-the-shelf paths (
zstdCLI itself is not installed in the dev sandbox that produced this PR, see Deviations): a ctypes/libzstd streaming decompressor, and Windows' own built-intar.exe(bsdtar 3.8.4 with bundled libzstd 1.5.7, extracts.tar.zstnatively). Both produced byte-identical payloads (258 files, zerodiff -rqdeltas), and both independently reproduce the same ingest diff report above.Bug caught during review: content-hash diffing is blind to file mode
The first real
--applyrun against the real bundle silently changed the mode bits on 186 unrelated files with zero content change: every file already committed underFFmpeg/is100755uniformly (confirmed viagit ls-tree), but the upstream bundle's own payload extracts at644for headers/libs, andshutil.copy2/copytreewere preserving that. The diff logic (git hash-objecton file content) never caught this, because git blob hashes don't encode file mode at all -- a mode-only change is invisible to any diff that only compares blob content. Caught by manually inspectinggit diff --statafter--apply(it showed 186 "M" files with0 insertions(+), 0 deletions(-), i.e. mode-only changes). Fixed by forcing0o755on all staged files before diff/apply, mirroring the tree's existing convention regardless of what the upstream payload ships. Re-verified zero mode churn after the fix, using both extraction paths above.Deviations
zstdCLI is not installed in the dev sandbox this PR was built in. The shippedextract_bundle()still correctly shells out tozstd -dc | tar -xper spec -- unchanged, untouched. Verification used the two alternate extraction paths described above (ctypes/libzstd harness, Windowstar.exe) purely to unblock AC testing; neither is part of the shipped script.if/masterafter PR scripts: redist verification script (quality gates) #2 (verify_redist.py/redist-manifest.txt, a parallel bead) merged -- no file overlap, clean rebase.SDL2.dll/libopenal-1.dllto top-levelbin/and repackaging as Redist 7.1.3 (owned by a different agent/bead) needs to merge tomasterbefore this PR merges, so this PR's own AC evidence and this repo'smasterstay consistent about what's excluded. Will rebase onto that once it lands and re-confirmpack-and-verifyis green before self-merging.Test plan
python3 -m py_compile scripts/ingest_bundle.pyffplay.exe),SDL2.dll/libopenal-1.dllcorrectly reported as pending additions--applyagainst real bundle (pre-scope-change trio-drop list): working tree diff matched the dry-run report exactly, zero mode noise -- later reverted once the trio premise was found wrong for SDL2/openal--applyrefuses when undocumented removals are present (verified via code path + non-destructive dry-run reproduction of the warning)