Skip to content

Comments

Allow packaging of wheels for riscv64 architecture#147

Closed
ffgan wants to merge 6 commits intocrate-py:mainfrom
ffgan:main
Closed

Allow packaging of wheels for riscv64 architecture#147
ffgan wants to merge 6 commits intocrate-py:mainfrom
ffgan:main

Conversation

@ffgan
Copy link
Contributor

@ffgan ffgan commented Jul 21, 2025

For manylinux (gnu/glibc, not musl), after testing, it is possible to package a wheel for the riscv64 architecture. After testing with the riscv64 virtual machine, the test result is passed.

Here is the CI Result, https://github.com/ffgan/rpds/actions/runs/16413208054

The following is the test script and the output of the test script run

1. test script

The test script runs on ubuntu22 riscv64.

(u22 rv64 can be used through the qemu virtual machine, reference link)

#! /bin/bash
set -e

uname -m
uname -a


git clone https://github.com/ffgan/rpds.git

# this file is not in rpds,please put it in rpds.
# you can get it from this link, https://github.com/ffgan/rpds/actions/runs/16413208054 , Scroll down the page, see  Artifacts
cp dist-manylinux-riscv64gc-unknown-linux-gnu.zip rpds/dist-manylinux-riscv64gc-unknown-linux-gnu.zip
cd rpds
unzip dist-manylinux-riscv64gc-unknown-linux-gnu.zip -d .


python3 --version
python3 -m venv venv
source ./venv/bin/activate


pip install --upgrade pip

pip install rpds_py-0.26.0-cp310-cp310-manylinux_2_31_riscv64.whl


# please make sure you already install uv global
uvx nox --list-sessions --json | jq '[.[].session]'

uvx nox -s "tests-3.10" --

2. test output

root@u22:~/new_ceph/rpds# ./test_rpds_riscv.sh
riscv64
Linux u22 6.8.0-64-generic #67~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul  3 01:39:30 UTC 2 riscv64 riscv64 riscv64 GNU/Linux
Cloning into 'rpds'...
remote: Enumerating objects: 1686, done.
remote: Counting objects: 100% (482/482), done.
remote: Compressing objects: 100% (134/134), done.
remote: Total 1686 (delta 412), reused 352 (delta 348), pack-reused 1204 (from 2)
Receiving objects: 100% (1686/1686), 356.00 KiB | 433.00 KiB/s, done.
Resolving deltas: 100% (1019/1019), done.
Archive:  dist-manylinux-riscv64gc-unknown-linux-gnu.zip
  inflating: ./rpds_py-0.26.0-cp310-cp310-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp312-cp312-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp311-cp311-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp313-cp313-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp313-cp313t-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp314-cp314-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp314-cp314t-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-cp39-cp39-manylinux_2_31_riscv64.whl
  inflating: ./rpds_py-0.26.0-pp310-pypy310_pp73-manylinux_2_31_riscv64.whl
  "tests-3.14t",
  "audit",
  "build",
  "style",
  "typing",
  "docs(dirhtml)",
  "docs(doctest)",
  "docs(linkcheck)",
  "docs(man)",
  "docs(spelling)",
  "docs(style)"
]
nox > Running session tests-3.10
nox > Creating virtual environment (uv) using python3.10 in .nox/tests-3-10
nox > /root/.local/bin/uv pip install --config-settings build-args=--profile=dev --no-cache -r /root/new_ceph/rpds/rpds/tests/requirements.txt
nox > pytest --parallel-threads=10 /root/new_ceph/rpds/rpds/tests
================================================= test session starts =================================================
platform linux -- Python 3.10.12, pytest-8.4.1, pluggy-1.6.0
rootdir: /root/new_ceph/rpds/rpds
configfile: pyproject.toml
plugins: run-parallel-0.4.4
collected 116 items
Collected 116 items to run in parallel

tests/test_hash_trie_map.py ···························································                         [ 50%]
tests/test_hash_trie_set.py ·····················                                                               [ 68%]
tests/test_list.py ···················                                                                          [ 85%]
tests/test_queue.py ·················                                                                           [100%]

********************************************* pytest-run-parallel report **********************************************
All tests were run in parallel! 🎉
=========================================== 116 passed in 136.95s (0:02:16) ===========================================
nox > Session tests-3.10 was successful.

Therefore, for manylinux, it is possible to package a wheel for riscv64. However, for Linux using musl, after preliminary testing, I have not yet obtained satisfactory results. I will submit a new PR if there are new results later.

Co-authored-by: nijincheng@iscas.ac.cn

Co-authored-by: <nijincheng@iscas.ac.cn>;
@Julian
Copy link
Member

Julian commented Jul 21, 2025

Hi there, thanks for the PR.

Besides the small CI failure the other important thing to check is whether these actually upload to PyPI.

I haven't stayed on top of RISC support but it seems like they still may not.

You could try uploading your output to TestPyPI perhaps so we could see.

@ffgan
Copy link
Contributor Author

ffgan commented Jul 21, 2025

Bad news, I can’t actually upload the package to TestPyPI

root@u22:~/new_ceph/rpds# twine upload --verbose --repository testpypi dist/*
INFO     Using configuration from /root/.pypirc
Uploading distributions to https://test.pypi.org/legacy/
INFO     dist/rpds_py-0.26.0-cp310-cp310-manylinux_2_34_riscv64.whl (391.7 KB)
INFO     username set by command options
INFO     password set from config file
INFO     username: __token__
INFO     password: <hidden>
Uploading rpds_py-0.26.0-cp310-cp310-manylinux_2_34_riscv64.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 408.8/408.8 kB • 00:01 • 5.6 MB/s
INFO     Response from https://test.pypi.org/legacy/:
         400 Bad Request
INFO     <html>
          <head>
           <title>400 Binary wheel 'rpds_py-0.26.0-cp310-cp310-manylinux_2_34_riscv64.whl' has an unsupported platform tag
         'manylinux_2_34_riscv64'.</title>
          </head>
          <body>
           <h1>400 Binary wheel 'rpds_py-0.26.0-cp310-cp310-manylinux_2_34_riscv64.whl' has an unsupported platform tag
         'manylinux_2_34_riscv64'.</h1>
           The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
         Binary wheel &#x27;rpds_py-0.26.0-cp310-cp310-manylinux_2_34_riscv64.whl&#x27; has an unsupported platform tag
         &#x27;manylinux_2_34_riscv64&#x27;.


          </body>
         </html>
ERROR    HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
         Bad Request

OK, I will find a solution to this problem as soon as possible. I will let you know if there is any new information.

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.

2 participants