11# SPDX-FileCopyrightText: 2026 The RISE Project
22# SPDX-License-Identifier: MIT
33---
4- # This workflow is based on: https://github.com/AntonKueltz/fastecdsa/blob/v3 .0.1 /.github/workflows/publish-to-prod.yaml
4+ # This workflow is based on: https://github.com/AntonKueltz/fastecdsa/blob/v4 .0.0 /.github/workflows/publish-to-prod.yaml
55name : Build fastecdsa wheels (riscv64)
66
77on :
4848 fail-fast : false
4949 matrix :
5050 version : ${{ fromJSON(needs.setup.outputs.versions) }}
51- # No cp314t: both extensions use single-phase init, so importing them
51+ # No cp314t: the pyo3 extension uses single-phase init, so importing it
5252 # re-enables the GIL, and upstream ships no free-threaded wheel.
5353 python : ["cp312", "cp313", "cp314"]
5454
@@ -70,33 +70,33 @@ jobs:
7070 only : ${{ matrix.python }}-manylinux_riscv64
7171 env :
7272 CIBW_MANYLINUX_RISCV64_IMAGE : ${{ env.MANYLINUX_RISCV64_IMAGE }}
73- # auditwheel vendors the image's libgmp, whose licences upstream's wheels do not carry.
73+ # v4.0.0 rewrote the extension in Rust (maturin, pyo3); it ships no
74+ # [tool.cibuildwheel], so the Rust toolchain its build backend needs is
75+ # installed in-container here and put on PATH for the build (same
76+ # pattern as build-fastuuid.yml). No more GMP: the new fastecdsa-rs-core
77+ # crate is pure Rust (crypto-bigint/num-bigint), so there is nothing left
78+ # to auditwheel-vendor and no extra CFLAGS/LDFLAGS to set.
7479 CIBW_BEFORE_ALL_LINUX : >-
75- dnf -y install gmp-devel &&
76- for f in /usr/share/licenses/gmp/COPYING*; do cp "$f" "{project}/LICENSE.gmp.$(basename "$f")"; done
77- CIBW_ENVIRONMENT_LINUX : CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
80+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
81+ CIBW_ENVIRONMENT_LINUX : ' PATH="$PATH:$HOME/.cargo/bin"'
7882 # pyproject.toml is deliberately left unstaged: its addopts demand pytest-cov
7983 # and its pythonpath would import the checkout instead of the wheel.
8084 CIBW_TEST_SOURCES : tests
81- CIBW_TEST_REQUIRES : pytest
85+ # tests/wycheproof/*.py and the point-at-infinity/ed25519/ed448 tests
86+ # import parameterized directly; upstream's own pyproject.toml test
87+ # extra lists it but CIBW_TEST_REQUIRES doesn't inherit extras.
88+ CIBW_TEST_REQUIRES : pytest parameterized
8289 CIBW_TEST_COMMAND : python -m pytest tests
8390
84- - name : Check the extensions and licences made it into the wheel
91+ - name : Check the extension and licence made it into the wheel
8592 run : |
8693 python3 - wheelhouse/*.whl <<'EOF'
8794 import sys, zipfile
8895 names = zipfile.ZipFile(sys.argv[1]).namelist()
8996 sos = {n.split("/")[-1].split(".", 1)[0] for n in names if n.endswith(".so")}
90- assert {"curvemath", "_ecdsa"} <= sos, sos
91- assert any(n.startswith("fastecdsa.libs/libgmp") for n in names), names
97+ assert {"rust"} <= sos, sos
9298 lic = {n.split("/")[-1] for n in names if ".dist-info/licenses/" in n and not n.endswith("/")}
93- assert lic == {
94- "LICENSE",
95- "LICENSE.gmp.COPYING",
96- "LICENSE.gmp.COPYING.LESSERv3",
97- "LICENSE.gmp.COPYINGv2",
98- "LICENSE.gmp.COPYINGv3",
99- }, lic
99+ assert lic == {"LICENSE"}, lic
100100 print(sorted(sos), sorted(lic))
101101 EOF
102102
@@ -106,40 +106,9 @@ jobs:
106106 path : wheelhouse/*.whl
107107 if-no-files-found : error
108108
109- gpl_sources :
110- needs : [setup]
111- if : needs.setup.outputs.versions != '[]'
112- name : Collect GPL sources for fastecdsa ${{ matrix.version }}
113- runs-on : ubuntu-24.04-riscv
114- strategy :
115- fail-fast : false
116- matrix :
117- version : ${{ fromJSON(needs.setup.outputs.versions) }}
118-
119- env :
120- FASTECDSA_VERSION : ${{ matrix.version }}
121-
122- steps :
123- - name : Checkout python-wheels
124- uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
125- with :
126- persist-credentials : false
127-
128- - uses : ./actions/collect-gpl-sources
129- with :
130- image : ${{ env.MANYLINUX_RISCV64_IMAGE }}
131- packages : gcc gmp
132- output : gpl-sources.tar
133-
134- - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
135- with :
136- name : fastecdsa-${{ env.FASTECDSA_VERSION }}-gpl-sources
137- path : gpl-sources.tar
138- if-no-files-found : error
139-
140109 publish :
141110 name : Publish fastecdsa ${{ matrix.version }}
142- needs : [setup, build_wheels, gpl_sources ]
111+ needs : [setup, build_wheels]
143112 if : needs.setup.outputs.versions != '[]'
144113 strategy :
145114 fail-fast : false
@@ -153,5 +122,3 @@ jobs:
153122 app-private-key : ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
154123 with :
155124 artifact-pattern : fastecdsa-${{ matrix.version }}-*-manylinux_riscv64
156- gpl-sources-artifact : fastecdsa-${{ matrix.version }}-gpl-sources
157- gpl-sources-description : gcc and the GMP library bundled in the wheel
0 commit comments