Skip to content
Draft
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
1 change: 1 addition & 0 deletions docs/packages/pillow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,4 @@ versions:
- filename: pillow-12.3.0-cp314-cp314t-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl
sha256: cfc9e1d7cdb6d5e7a3a87d0b4e2fa666300bdca0f685ac50c03c8fc987771c34
requires-python: '>=3.10'
- version: 13.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 1bbab6afa8f1bf6d64d3db7b977975e45235c80d Mon Sep 17 00:00:00 2001
From: Trevor Gamblin <tgamblin@baylibre.com>
Date: Thu, 23 Jul 2026 13:20:47 -0400
Subject: [PATCH] .ci: test.sh: skip test_grabclipboard_wl_clipboard

This test depends on a Wayland server and XDG_RUNTIME_DIR to be set. We
don't want to rely on a graphical configuration on the runners, so skip
it.

Upstream-Status: Inappropriate [workaround for RISC-V runner builds]

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
.ci/test.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.ci/test.sh b/.ci/test.sh
index 2b2e39c..9fa46b0 100755
--- a/.ci/test.sh
+++ b/.ci/test.sh
@@ -4,4 +4,4 @@ set -e

python3 -c "from PIL import Image"

-python3 -bb -m pytest -vv -x -W always --numprocesses=logical --dist=worksteal --cov PIL --cov Tests --cov-report term --cov-report xml Tests
+python3 -bb -m pytest -vv -x -k "not test_grabclipboard_wl_clipboard" -W always --numprocesses=logical --dist=worksteal --cov PIL --cov Tests --cov-report term --cov-report xml Tests
--
2.55.0

45 changes: 45 additions & 0 deletions patches/pillow/13.0.0/0001-Pillow-.ci-use-uv-pip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From de055b09de48b863c8c779fa6ac9cca59cbba07f Mon Sep 17 00:00:00 2001
From: Trevor Gamblin <tgamblin@baylibre.com>
Date: Thu, 23 Jul 2026 08:54:31 -0400
Subject: [PATCH] Pillow: .ci: use 'uv pip'

We use uv in our workflows, so replace 'python3 -m pip' with 'uv pip' in
the .ci scripts run by the Pillow pipelines.

Upstream-Status: Inappropriate [different Python management tooling]

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
.ci/install.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/.ci/install.sh b/.ci/install.sh
index 516b310..a01d699 100755
--- a/.ci/install.sh
+++ b/.ci/install.sh
@@ -36,17 +36,17 @@ packages=(
)
sudo apt-get -qq install --no-install-recommends "${packages[@]}"

-python3 -m pip install --upgrade pip
-python3 -m pip install --upgrade ipython
+uv pip install --upgrade pip
+uv pip install --upgrade ipython

# optional test dependencies, only install if there's a binary package.
-python3 -m pip install --only-binary=:all: numpy || true
-python3 -m pip install --only-binary=:all: pyarrow || true
+uv pip install --only-binary=:all: numpy || true
+uv pip install --only-binary=:all: pyarrow || true

# PyQt6 doesn't support PyPy3
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
# pyqt6 doesn't yet support free-threading; only install if a wheel is available
- python3 -m pip install --only-binary=:all: pyqt6 || true
+ uv pip install --only-binary=:all: pyqt6 || true
fi

# webp
--
2.55.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From 672262c8715b24485f82e18580fe33786dbce2b9 Mon Sep 17 00:00:00 2001
From: Trevor Gamblin <tgamblin@baylibre.com>
Date: Thu, 23 Jul 2026 10:57:00 -0400
Subject: [PATCH] depends: install_libavif.sh: fix cache LIBDIR for non-x86_64
hosts

The GitHub Actions cache restore/save paths hardcode
LIBDIR=/usr/lib/x86_64-linux-gnu, but on riscv64 the multiarch install
path is /usr/lib/riscv64-linux-gnu. The cache-save cp then fails:

cp: cannot stat '/usr/lib/x86_64-linux-gnu/libavif.so*': No such file or directory

Because that cp isn't the last command in an && list, `set -e`
doesn't stop the script there either, so it falls through with a
stale working directory and breaks the next dependency's `pushd
depends` in .ci/install.sh:

.ci/install.sh: line 58: pushd: depends: No such file or directory

Derive LIBDIR from `uname -m` instead of hardcoding the triplet.

Upstream-Status: To upstream [relevant for non-x86_64 CI runners]

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
depends/install_libavif.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/depends/install_libavif.sh b/depends/install_libavif.sh
index b837f6d65..ae4d7f87a 100755
--- a/depends/install_libavif.sh
+++ b/depends/install_libavif.sh
@@ -5,7 +5,7 @@ version=1.4.2

if [[ "$GHA_LIBAVIF_CACHE_HIT" == "true" ]]; then

- LIBDIR=/usr/lib/x86_64-linux-gnu
+ LIBDIR=/usr/lib/$(uname -m)-linux-gnu

# Copy cached files into place
sudo cp ~/cache-libavif/lib/* $LIBDIR/
@@ -80,7 +80,7 @@ else

if [ -n "$GITHUB_ACTIONS" ] && [ "$(uname)" != "Darwin" ]; then
# Copy to cache
- LIBDIR=/usr/lib/x86_64-linux-gnu
+ LIBDIR=/usr/lib/$(uname -m)-linux-gnu
rm -rf ~/cache-libavif
mkdir -p ~/cache-libavif/lib
mkdir -p ~/cache-libavif/include
--
2.55.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From c675d64ec296f1f72c81a1c00e03448fde380589 Mon Sep 17 00:00:00 2001
From: Trevor Gamblin <tgamblin@baylibre.com>
Date: Thu, 23 Jul 2026 09:41:00 -0400
Subject: [PATCH] depends: install_libavif.sh: force generic aom target on
riscv64

aom's riscv RVV intrinsics (av1/common/riscv/convolve_rvv.c) use the
explicit vxrm rounding-mode argument added in the finalized RVV C
intrinsics spec, which the riscv64 runner's GCC 13.3.0 doesn't
implement yet. That breaks the local aom build FetchContent pulls in
when no system aom is available:

error: '__RISCV_VXRM_RNU' undeclared
error: too many arguments to function '__riscv_vnclipu_wx_u8mf2'

Force AOM_TARGET_CPU=generic on riscv64 so aom skips its
arch-specific SIMD/intrinsics codepaths entirely and builds portable
C instead.

Upstream-Status: Inappropriate [riscv64 runners have gcc 13]

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
depends/install_libavif.sh | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/depends/install_libavif.sh b/depends/install_libavif.sh
index b1a337d7b..b837f6d65 100755
--- a/depends/install_libavif.sh
+++ b/depends/install_libavif.sh
@@ -59,6 +59,13 @@ else
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=LOCAL)
fi

+ if [ "$(uname -m)" == "riscv64" ]; then
+ # aom's riscv RVV intrinsics require a newer GCC than what's
+ # available on our riscv64 runner; force the portable-C target
+ # so the local aom build skips that codepath.
+ LIBAVIF_CMAKE_FLAGS+=(-DAOM_TARGET_CPU=generic)
+ fi
+
cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_INSTALL_NAME_DIR=$PREFIX/lib \
--
2.55.0

33 changes: 33 additions & 0 deletions patches/pillow/13.0.0/0001-disable-lto-when-building-libavif.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From e16f5961f165ce43fe4bcdb7eb167d2714f2b116 Mon Sep 17 00:00:00 2001
From: Mark Ryan <markdryan@rivosinc.com>
Date: Wed, 23 Jul 2025 16:50:28 +0000
Subject: [PATCH] disable lto when building libavif

This is due to a gcc bug

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110812

Upstream-Status: Inappropriate [It's a GCC bug]

Signed-off-by: Mark Ryan <markdryan@rivosinc.com>

Refresh the patch to apply on 12.3.0.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
.github/workflows/wheels-dependencies.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh
index 76d4ce22f..8b1c2f3a1 100755
--- a/.github/workflows/wheels-dependencies.sh
+++ b/.github/workflows/wheels-dependencies.sh
@@ -181,7 +181,7 @@ function build_libavif {
fi

local build_shared=ON
- local lto=ON
+ local lto=OFF

local libavif_cmake_flags

Loading