Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@ jobs:
- {os: ubuntu-24.04, python: "3.14", ffmpeg: "9.0.1", extras: true}
- {os: ubuntu-24.04, python: "3.12", ffmpeg: "8.1.2"}
- {os: ubuntu-24.04, python: "3.13", ffmpeg: "9.0.1"}
- {os: ubuntu-24.04-riscv, python: "3.14", ffmpeg: "9.0.1"}
- {os: macos-14, python: "3.12", ffmpeg: "8.1.2"}
- {os: macos-14, python: "3.14", ffmpeg: "9.0.1"}

env:
PYAV_PYTHON: python${{ matrix.config.python }}
PYAV_LIBRARY: ffmpeg-${{ matrix.config.ffmpeg }}
# riscv64 wheels (e.g. Pillow) are often missing on PyPI; RISE mirrors
# prebuilt wheels for it so uv doesn't have to build them from source.
# unsafe-best-match is needed so uv still falls back to PyPI for
# packages/versions RISE doesn't happen to carry.
UV_INDEX: ${{ matrix.config.os == 'ubuntu-24.04-riscv' && 'https://pypi.riseproject.dev/simple/' || '' }}
UV_INDEX_STRATEGY: ${{ matrix.config.os == 'ubuntu-24.04-riscv' && 'unsafe-best-match' || 'first-index' }}

steps:
- uses: actions/checkout@v7
Expand All @@ -66,9 +73,9 @@ jobs:
- name: OS Packages
run: |
case ${{ matrix.config.os }} in
ubuntu-24.04)
ubuntu-24.04|ubuntu-24.04-riscv)
sudo apt-get update
sudo apt-get install \
sudo apt-get install -y \
autoconf \
automake \
build-essential \
Expand All @@ -79,7 +86,7 @@ jobs:
pkg-config \
zlib1g-dev
if [[ "${{ matrix.config.extras }}" ]]; then
sudo apt-get install doxygen
sudo apt-get install -y doxygen
fi
;;
macos-14)
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
arch: arm64
- os: macos-15-intel
arch: x86_64
- os: ubuntu-24.04-riscv
arch: riscv64
- os: ubuntu-24.04-arm
arch: aarch64
- os: ubuntu-24.04
Expand Down Expand Up @@ -61,7 +63,10 @@ jobs:
CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor
CIBW_BEFORE_BUILD_MACOS: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor
CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py --config-file scripts\ffmpeg-latest.json C:\cibw\vendor
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig
# riscv64 wheels (e.g. numpy, for CIBW_TEST_REQUIRES) are often missing on
# PyPI; RISE mirrors prebuilt wheels for it. unsafe-best-match is needed so
# uv still falls back to PyPI for packages/versions RISE doesn't carry.
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig${{ matrix.arch == 'riscv64' && ' UV_INDEX=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match' || '' }}
CIBW_ENVIRONMENT_MACOS: PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig LDFLAGS=-headerpad_max_install_names
CIBW_ENVIRONMENT_WINDOWS: INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib PYAV_SKIP_TESTS=unicode_filename
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel}
Expand Down
15 changes: 15 additions & 0 deletions scripts/build-deps
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ else
echo " Building without NVIDIA NVENC/NVDEC support"
fi

# Some riscv64 toolchains include the Zbb extension by default. FFmpeg's runtime
# CPU feature checks then get compiled away, causing SIGILL on hardware (like
# the RISE RISC-V Runners) that doesn't actually implement Zbb
# (https://trac.ffmpeg.org/ticket/11251). Being explicit about -march=riscv64gc
# isn't enough to work around this, so also disable FFmpeg's riscv-specific
# (scalar Zbb + vector) code paths. rv_zicbop's configure dependency is only on
# "riscv", not "rv", so we have to disable all of the related vector options.
# This is a temporary fix that should be removed once RISC-V Runners support
# RVA23.
CONFFLAGS_RISCV=""
if [[ "$(uname -m)" == "riscv64" ]]; then
CONFFLAGS_RISCV="--extra-cflags=-march=rv64gc --disable-rv --disable-rvv --disable-rv_zicbop --disable-rv_zvbb"
fi

cd "$PYAV_LIBRARY_ROOT"

# Download and expand the source.
Expand Down Expand Up @@ -72,6 +86,7 @@ echo ./configure
--enable-filter=abuffer,abuffersink,aformat,aresample,atempo,buffer,buffersink,bwdif,color,ebur128,loudnorm,lutrgb,overlay,palettegen,scale,testsrc,vflip,volume \
--disable-avx512 \
$CONFFLAGS_NVIDIA \
$CONFFLAGS_RISCV \
--prefix="$PYAV_LIBRARY_PREFIX" \
|| exit 2
echo
Expand Down
Loading