Skip to content

pillow-avif-plugin: add build-pillow-avif-plugin.yml for riscv64 wheels - #1030

Merged
luhenry merged 2 commits into
mainfrom
pillow-avif-plugin
Sep 6, 2026
Merged

pillow-avif-plugin: add build-pillow-avif-plugin.yml for riscv64 wheels#1030
luhenry merged 2 commits into
mainfrom
pillow-avif-plugin

Conversation

@luhenry

@luhenry luhenry commented Sep 6, 2026

Copy link
Copy Markdown
Member

Compiles a Pillow plugin that adds AVIF read/write support, vendoring aom and dav1d as static codecs inside libavif via CMake. Upstream publishes no riscv64 wheel.

Mirrors upstream's build-native-wheels job.

Differs from upstream

  • Replaces the multibuild-based before-all with a direct CMake invocation - multibuild's ccache/sccache/nasm helpers fetch prebuilt binaries with no riscv64 release.
  • Drops the rav1e encoder - it duplicates aom's encoder role and would need a whole Rust toolchain for no functional gain; the test suite already skips rav1e-specific cases.
  • Adds -DENABLE_RVV=0 to the vendored aom build: aom's av1.cmake unconditionally bundles highbd-only RVV convolve sources into its RVV object library (unlike the equivalent x86/NEON lists, which gate their highbd files on CONFIG_AV1_HIGHBITDEPTH), so with highbitdepth off - the same setting upstream's own wheelbuild/config.sh uses - those files call undeclared _c fallbacks and fail to compile on riscv64. Confirmed against both the pinned aom v3.14.1 tag and current aom main; not fixed upstream. aom is encoder-only in this build, so disabling its RVV path costs encode speed, not correctness.

Testing

  • Same as upstream (test-extras = tests, pytest via .github/workflows/wheels-test.sh).

License: Wheel bundles aom (BSD-2-Clause + AOM Patent License) and dav1d (BSD-2-Clause), statically linked into libavif.so; upstream's own dependency licence texts are appended to LICENSE the same way its release CI does.

Built on cp312 equivalent (aarch64, local): 104 passed, 11 skipped.

Vendors aom (encoder) and dav1d (decoder) via libavif's own CMake
FetchContent, mirroring wheelbuild/config.sh's build_libavif. rav1e is
dropped: it duplicates aom's encoder role and would pull in a Rust
toolchain for no functional gain.
…bitdepth gating bug

aom's av1.cmake unconditionally adds the highbd RVV convolve sources to
its RVV object library, unlike the equivalent x86/NEON lists which gate
their highbd files on CONFIG_AV1_HIGHBITDEPTH. With highbitdepth off
(as upstream's own wheelbuild/config.sh sets it), those files call
undeclared _c fallbacks. Confirmed against the pinned aom v3.14.1 tag
and current aom main; see gotcha 271. -DENABLE_RVV=0 removes the whole
broken RVV object library from the aom build instead of patching one
symbol; aom is encoder-only here so the cost is slower portable-C
encode, not a functional loss.

Verified with a QEMU riscv64 rehearsal of the exact cmake/ninja
invocation: the previous flags reproduce the CI failure verbatim, and
the fix links libavif.so cleanly end to end (aom + dav1d + libyuv).
@luhenry
luhenry merged commit fb5942f into main Sep 6, 2026
10 checks passed
@luhenry
luhenry deleted the pillow-avif-plugin branch September 6, 2026 13:31
@luhenry luhenry linked an issue Sep 6, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pillow-avif-plugin riscv64 support

1 participant