From ad3dbfe928a746e65fa97af97853f0583fe85fec Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Thu, 24 Sep 2026 18:57:25 +0800 Subject: [PATCH] ci: refresh ffmpeg-sys-next after a cache-miss FFmpeg build cargo does not track the static archives ffmpeg-sys-next bundled into its rlib, so a target/ cache restored from an older run keeps linking the previous FFmpeg even after .cache/ffmpeg was rebuilt. The Build FFmpeg step now flags a rebuild and a small step drops just that package before the build; cache hits and the Windows prebuilt path are untouched. --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a19dbd64..305ad22c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -325,6 +325,10 @@ jobs: else rm -rf .cache/ffmpeg tooling/ffmpeg/build-ffmpeg.sh + # The cargo cache may hold ffmpeg-sys-next rlibs that bundled + # the previous archives (cargo does not track archive + # changes); flag a refresh so the build relinks the new one. + echo "FFMPEG_REBUILT=1" >> "$GITHUB_ENV" fi - name: Save FFmpeg (WarpCache) @@ -414,6 +418,14 @@ jobs: shared-key: oak-ci-${{ matrix.distro }}-${{ matrix.arch }} cache-on-failure: true + # A freshly built FFmpeg must not keep linking the archives the + # cargo cache bundled in ffmpeg-sys-next's rlib (cargo does not + # track them); drop just that package so the link picks up the new + # .cache/ffmpeg. Skipped on cache hits and on Windows (prebuilt). + - name: Refresh the FFmpeg binding + if: matrix.platform != 'windows' && env.FFMPEG_REBUILT == '1' + run: cargo clean -p ffmpeg-sys-next + # ------------------------------------------------------------------ # Build & test # ------------------------------------------------------------------