Skip to content

spike: matrix snapshot capture (linux + macosx) for multi-platform co… #3

spike: matrix snapshot capture (linux + macosx) for multi-platform co…

spike: matrix snapshot capture (linux + macosx) for multi-platform co… #3

# TEMP: capture FFmpeg 8.1.2 config snapshots (config headers + *_list.c +
# sources.txt) on ubuntu (linux-x86_64) AND macos-15 (macosx-arm64), matching
# the hermetic profile. Raw material for the multi-platform compat.ffmpeg.
name: snapshot-macos-ffmpeg
on:
push:
branches: ['spike/ffmpeg-macos-snapshot']
workflow_dispatch:
jobs:
capture:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, plat: linux }
- { os: macos-15, plat: macosx }
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Install nasm (linux only — x86 NASM)
if: matrix.plat == 'linux'
run: sudo apt-get update && sudo apt-get install -y nasm
- name: Fetch FFmpeg 8.1.2
run: |
curl -L -fsS -o ffmpeg.tar.gz "https://ffmpeg.org/releases/ffmpeg-8.1.2.tar.gz"
tar -xzf ffmpeg.tar.gz
- name: configure + make -n
run: |
mkdir build && cd build
../ffmpeg-8.1.2/configure --cc=clang --disable-autodetect --disable-programs --disable-doc >configure.log 2>&1 || { echo "CONFIGURE FAILED"; tail -60 configure.log; exit 1; }
echo "=== ${{ matrix.plat }} config.h facts ==="
grep -E '#define (OS_NAME|ARCH_AARCH64|ARCH_X86_64|HAVE_NEON |HAVE_MMX |HAVE_PTHREADS |HAVE_W32THREADS )' config.h
make -n >make-n.log 2>/dev/null || true
echo ".c=$(grep -oE '[^ ]+\.c\b' make-n.log|sort -u|wc -l) .S=$(grep -oE '[^ ]+\.S\b' make-n.log|sort -u|wc -l) .asm=$(grep -oE '[^ ]+\.asm\b' make-n.log|sort -u|wc -l)"
mkdir -p ../snap/libavutil ../snap/libavcodec ../snap/libavformat ../snap/libavfilter ../snap/libavdevice
cp config.h config_components.h configure.log make-n.log ../snap/ 2>/dev/null || true
# config.asm only exists on x86 (NASM)
cp config.asm config_components.asm ../snap/ 2>/dev/null || true
cp libavutil/avconfig.h libavutil/ffversion.h ../snap/libavutil/ 2>/dev/null || true
cp libavcodec/codec_list.c libavcodec/parser_list.c libavcodec/bsf_list.c ../snap/libavcodec/ 2>/dev/null || true
cp libavformat/demuxer_list.c libavformat/muxer_list.c libavformat/protocol_list.c ../snap/libavformat/ 2>/dev/null || true
cp libavfilter/filter_list.c ../snap/libavfilter/ 2>/dev/null || true
cp libavdevice/indev_list.c libavdevice/outdev_list.c ../snap/libavdevice/ 2>/dev/null || true
grep -oE '\S+\.(c|S|asm)\b' make-n.log | sed 's|^|src/|; s|src/src/|src/|' | sort -u > ../snap/sources.txt
echo "sources.txt: $(wc -l < ../snap/sources.txt)"
- uses: actions/upload-artifact@v4
with:
name: ffmpeg-${{ matrix.plat }}-snapshot
path: snap/