-
Notifications
You must be signed in to change notification settings - Fork 0
zstandard: build wheels for riscv64 #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| --- | ||
| name: Build zstandard wheels (riscv64) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'zstandard version to build (git tag, e.g. 0.25.0)' | ||
| required: true | ||
| default: '0.25.0' | ||
| pull_request: | ||
| paths: | ||
| - '.github/workflows/build-zstandard.yml' | ||
| - 'actions/publish-to-gitlab/**' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ inputs.version || '0.25.0' }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read # to fetch code (actions/checkout) | ||
|
|
||
| env: | ||
| # `inputs.version` is empty on pull_request events; default to 0.25.0 there. | ||
| ZSTANDARD_VERSION: ${{ inputs.version || '0.25.0' }} | ||
| UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ | ||
| UV_INDEX_STRATEGY: unsafe-best-match | ||
| UV_ONLY_BINARY: ':all:' | ||
|
|
||
| jobs: | ||
| build_wheels: | ||
| name: Build zstandard ${{ inputs.version || '0.25.0' }} ${{ matrix.python }}-manylinux_riscv64 | ||
| runs-on: ubuntu-24.04-riscv | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python: ["cp312", "cp313", "cp314", "cp314t"] | ||
|
|
||
| steps: | ||
| - name: Checkout python-wheels | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This checkout isn't used, feel free to remove it. It's a pattern I had placed in my numpy workflow and forgot to remove it after I got it working. |
||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| path: python-wheels-repo | ||
| persist-credentials: false | ||
|
|
||
| # zstandard vendors the zstd C library as a submodule and, unlike numpy, | ||
| # tags releases without a leading `v` (e.g. `0.25.0`), so the ref is the | ||
| # bare version. | ||
| - name: Checkout zstandard ${{ env.ZSTANDARD_VERSION }} | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| repository: indygreg/python-zstandard | ||
| ref: ${{ env.ZSTANDARD_VERSION }} | ||
| submodules: recursive | ||
| persist-credentials: false | ||
|
|
||
| - name: Build wheels | ||
| uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 | ||
| env: | ||
| CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 | ||
| # Upstream pins `build-frontend = "build[uv]"` in pyproject.toml, which | ||
| # fails on riscv64: uv is not present in the manylinux_riscv64 image, so | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this leftover from before our check for uv in the manylinux image? |
||
| # cibuildwheel aborts on `which uv`. Force the plain build frontend. | ||
| CIBW_BUILD_FRONTEND: build | ||
|
|
||
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: zstandard-${{ env.ZSTANDARD_VERSION }}-${{ matrix.python }}-manylinux_riscv64 | ||
| path: ./wheelhouse/*.whl | ||
| if-no-files-found: error | ||
|
|
||
| publish: | ||
| name: Publish zstandard ${{ inputs.version || '0.25.0' }} to GitLab | ||
| needs: build_wheels | ||
| # Only publish when the workflow was triggered from main with a specific | ||
| # version. Manual trigger is the only entry point, so checking the ref is | ||
| # enough to gate uploads. | ||
| if: github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-24.04-riscv | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was also a mistake on my end - we don't need to unnecessarily load up the RISC-V Runners here. Can you change it to ubuntu-latest? |
||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout python-wheels | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| path: python-wheels-repo | ||
| persist-credentials: false | ||
|
|
||
| - name: Download wheels | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: zstandard-${{ env.ZSTANDARD_VERSION }}-*-manylinux_riscv64 | ||
| path: dist | ||
| merge-multiple: true | ||
|
|
||
| - name: Publish to GitLab PyPI registry | ||
| uses: ./python-wheels-repo/actions/publish-to-gitlab | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As Ludovic suggested, you can instead use: in which case the |
||
| with: | ||
| gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }} | ||
| gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }} | ||
| gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }} | ||
| files: | | ||
| dist/*.whl | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,3 +50,4 @@ ujson | |
| uvloop | ||
| websockets | ||
| z3-solver | ||
| zstandard | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, have you tried the 3.11 build before? I've updated the draft dev guide to suggest that our full build matrix should be the following, until 3.15 is released:
["cp311", "cp312", "cp313", "cp314", "cp314t"]