diff --git a/.github/workflows/build-skia-python.yml b/.github/workflows/build-skia-python.yml index ba4f0875c088..fafecd6af62a 100644 --- a/.github/workflows/build-skia-python.yml +++ b/.github/workflows/build-skia-python.yml @@ -136,6 +136,13 @@ jobs: cd .. CIBW_BEFORE_BUILD: pip install pybind11 numpy CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + # The test stage's `pip install pillow` otherwise resolves to a PyPI + # release with no riscv64 wheel and compiles it from source, which + # fails for lack of jpeg headers in the image; take the registry's + # prebuilt riscv64 wheel instead. + CIBW_TEST_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=pillow CIBW_TEST_REQUIRES: pytest pillow glfw # moderngl (used only by test_GrDirectContext_MakeGL_EGL) has no riscv64 wheel; # test_GrDirectContext_MakeGL_GLX has no display-unavailable skip at all, unlike diff --git a/docs/packages/skia-python.yaml b/docs/packages/skia-python.yaml index d4e24a824f4c..a02e28581801 100644 --- a/docs/packages/skia-python.yaml +++ b/docs/packages/skia-python.yaml @@ -14,3 +14,4 @@ versions: sha256: 21dad398b1a73ce3b0ee4dc27564a13c1f01648290f7fea45ee1c9d23c1e5b92 - filename: skia_python-144.0.post2-cp314-cp314t-manylinux_2_39_riscv64.whl sha256: f1f7ef89b2adefd12eb23a8854a3428f5011c3ca77631a866d97b1b10986dacf +- version: '144.1' diff --git a/patches/skia-python/144.1/0001-Skip-GPU-context-tests-when-glfw.init-fails-not-just.patch b/patches/skia-python/144.1/0001-Skip-GPU-context-tests-when-glfw.init-fails-not-just.patch new file mode 100644 index 000000000000..16c8c2375410 --- /dev/null +++ b/patches/skia-python/144.1/0001-Skip-GPU-context-tests-when-glfw.init-fails-not-just.patch @@ -0,0 +1,43 @@ +From ba4f377e460a8611d1ca7ff6015306913bcfd714 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 10 Sep 2026 13:07:37 +0200 +Subject: [PATCH] Skip GPU-context tests when glfw.init() fails, not just when + glfw is missing + +opengl_context's try/except only catches ImportError (glfw not +installed) and UserWarning; glfw_context() raises a plain RuntimeError +when glfw.init() returns False, which happens whenever no display +server (X11/Wayland) is reachable, not only when glfw itself is +absent. That RuntimeError propagates uncaught, erroring every test +that depends on the 'gpu'-parametrized surface/context fixtures +instead of the graceful pytest.skip('OpenGL is not available') the +rest of this fixture already falls back to. + +Rocky Linux 10 (the riscv64 manylinux image's base) ships no virtual +X server at all: xorg-x11-server-Xvfb, tigervnc-server and weston are +all absent from BaseOS/AppStream/CRB/Extras on every architecture, not +just riscv64 (RHEL 10 dropped Xvfb outright, same shape as its SDL2 +removal) -- so no DISPLAY is ever available to build a real GL context +in that container, and every test using 'gpu' hits this exact path. + +Upstream-Status: Inappropriate [Rocky 10, this repo's riscv64 CI base image, ships no Xvfb/Xvnc/weston at all -- specific to our infra, not a defect other environments with a display server would hit] +--- + tests/conftest.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 0658d2a..af22987 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -46,7 +46,7 @@ def opengl_context(request): + return + except ImportError: + logger.warning('glfw not found') +- except UserWarning as e: ++ except (RuntimeError, UserWarning) as e: + logger.exception(e) + pytest.skip('GLFW error') + +-- +2.50.1 (Apple Git-155) + diff --git a/patches/skia-python/144.1/0002-Skip-the-CIPD-gn-download-when-a-gn-is-already-on-PA.patch b/patches/skia-python/144.1/0002-Skip-the-CIPD-gn-download-when-a-gn-is-already-on-PA.patch new file mode 100644 index 000000000000..5c75c0722834 --- /dev/null +++ b/patches/skia-python/144.1/0002-Skip-the-CIPD-gn-download-when-a-gn-is-already-on-PA.patch @@ -0,0 +1,37 @@ +From 7a8dff07c5fd64343665d6b7d17994d6ee3a5b87 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 10 Sep 2026 17:30:42 +0200 +Subject: [PATCH] Skip the CIPD gn download when a gn is already on PATH + +bin/fetch-gn's CPU map (platform.machine().lower() -> {aarch64, +amd64, arm64, x86_64}) has no riscv64 entry, and there's no prebuilt +gn published for riscv64 on Google's CIPD to add one for -- so this +KeyErrors outright on any riscv64 host, unconditionally, with no way +to opt out (tools/git-sync-deps calls it with no skip flag, unlike +its --skip-emsdk sibling). When a gn is already resolvable via PATH, +skip the download entirely instead of trying to fetch one: nothing +downstream of git-sync-deps reads skia/bin/gn or third_party/gn/gn +directly, they're only ever invoked through PATH. + +Upstream-Status: Inappropriate [riscv64 has no prebuilt gn published on Google's CIPD to add a CPU-map entry for; this only ever fires when PATH already resolves one, which is specific to how this repo builds skia-python for that architecture] +--- + bin/fetch-gn | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/skia/bin/fetch-gn b/skia/bin/fetch-gn +index ebdc31c4..c425d70e 100755 +--- a/skia/bin/fetch-gn ++++ b/skia/bin/fetch-gn +@@ -17,6 +17,9 @@ from urllib.request import urlopen + + os.chdir(os.path.join(os.path.dirname(__file__), os.pardir)) + ++if shutil.which('gn'): ++ sys.exit(0) ++ + gnzip = os.path.join(tempfile.mkdtemp(), 'gn.zip') + with open(gnzip, 'wb') as f: + OS = {'darwin': 'mac', 'linux': 'linux', 'linux2': 'linux', 'win32': 'windows'}[sys.platform] +-- +2.50.1 (Apple Git-155) +