diff --git a/.github/workflows/build-sudachipy.yml b/.github/workflows/build-sudachipy.yml index d2455d309fd..2ae87b6c1ed 100644 --- a/.github/workflows/build-sudachipy.yml +++ b/.github/workflows/build-sudachipy.yml @@ -2,7 +2,12 @@ # SPDX-License-Identifier: MIT --- # Based on the `build-wheels` job of -# https://github.com/WorksApplications/sudachi.rs/blob/v0.6.11/.github/workflows/build-python-wheels.yml +# https://github.com/WorksApplications/sudachi.rs/blob/v0.7.0/.github/workflows/build-python-wheels.yml +# 0.7.0 switched the python/ build from setuptools-rust to maturin, whose +# pyo3 dependency now enables the "abi3-py310" feature (python/Cargo.toml): +# one cp310 wheel loads on every newer non-free-threaded CPython, so the +# matrix collapses to it plus the separate free-threaded cp314t build +# (CLAUDE.md gotcha 11), same shape as build-apache-tvm-ffi.yml. name: Build sudachipy wheels (riscv64) on: @@ -52,8 +57,7 @@ jobs: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - # No abi3: pyo3's abi3 feature isn't enabled in python/Cargo.toml. - python: ["cp312", "cp313", "cp314", "cp314t"] + python: ["cp310", "cp314t"] include: # tokenizers has no free-threaded wheel anywhere (abi3-only); its sdist # build is unproven here, so drop just the one test module that needs it. @@ -84,12 +88,16 @@ jobs: - name: Build and test wheel uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: - package-dir: python + package-dir: . env: CIBW_ARCHS: riscv64 CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 CIBW_SKIP: '*-musllinux_*' # rustup.rs has no riscv64 musl toolchain CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # cibuildwheel's audit step needs a host `uv`, which the self-hosted + # runner doesn't have; override upstream's build-frontend = "build[uv]" + # (CLAUDE.md gotcha 13). + CIBW_BUILD_FRONTEND: build # No Rust in the manylinux image; install it and put cargo on PATH. Skips # upstream's PGO before-all (external corpus download + release build of # sudachi-cli), which would otherwise re-run once per matrix leg here. @@ -102,7 +110,7 @@ jobs: # Upstream's own build_and_test.sh test command, run against {package} # (gotcha 5) since cibuildwheel tests from an empty scratch directory. CIBW_TEST_COMMAND: >- - bash -c "cd {package} && ${{ matrix.drop_pretokenizer_test }} python -m unittest discover -s tests -v" + bash -c "cd {package}/python && ${{ matrix.drop_pretokenizer_test }} python -m unittest discover -s tests -v" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: diff --git a/docs/packages/sudachipy.yaml b/docs/packages/sudachipy.yaml index c2724569dab..0508f1fd5e5 100644 --- a/docs/packages/sudachipy.yaml +++ b/docs/packages/sudachipy.yaml @@ -14,3 +14,4 @@ versions: sha256: 5c976451fe7fefc0ab69c34ba47154c63a0a4e6813ac8af55a55b1352676ee46 - filename: sudachipy-0.6.11-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl sha256: 0757c41309f227cd1abee6c8e6ab6c780492b94fa3785c8adbb5ab1f34df4c0b +- version: 0.7.0 diff --git a/patches/sudachipy/0.7.0/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch b/patches/sudachipy/0.7.0/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch new file mode 100644 index 00000000000..99cc9397673 --- /dev/null +++ b/patches/sudachipy/0.7.0/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 24 Sep 2026 11:00:00 +0200 +Subject: [PATCH] pyproject: drop the removed cpython-freethreading enable + group + +cibuildwheel 4.2.0 (the version this repo pins for riscv64 builds) no +longer recognises "cpython-freethreading" as an enable group -- it +errors "Failed to parse enable group" before any build starts, on +every interpreter, since [tool.cibuildwheel] is parsed as a whole +(same failure as patches/pi-heif/1.4.0 and the prior +patches/sudachipy/0.6.11 patch). Free-threaded builds (cp314t) no +longer need an opt-in. + +0.7.0 moved the whole cibuildwheel/maturin config from +python/pyproject.toml (setuptools-rust) to a root pyproject.toml +(maturin), so the file this patch touches moved too; the fix itself is +unchanged. + +Upstream-Status: To upstream [not yet submitted; sudachi.rs's develop branch (checked at 3b68eb904870e89d3571363eb05a1fe556ae1bd7, past the v0.7.0 tag) still carries the same enable list, so there is no existing upstream fix to backport] +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 0d61a4f2..887464de 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -44,7 +44,7 @@ manifest-path = "python/Cargo.toml" + [tool.cibuildwheel] + build = "cp310-* cp314t-*" + skip = "*t-win* *-win32 *-musllinux_*" +-enable = ["cpython-prerelease", "cpython-freethreading"] ++enable = ["cpython-prerelease"] + build-frontend = "build[uv]" + test-requires = [ + "sudachidict_core", +-- +2.43.0