Skip to content

Commit 2b8705f

Browse files
authored
Merge branch 'main' into fix/bcrypt-musllinux-riscv64
2 parents 13251d3 + 5978d92 commit 2b8705f

6 files changed

Lines changed: 239 additions & 17 deletions

File tree

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
4+
# This workflow follows upstream's own fiftyone-db release process:
5+
# https://github.com/voxel51/fiftyone/blob/main/.github/workflows/build-db.yml
6+
# which releases from db-v<version> tags and builds one wheel per platform
7+
# directly with `python -m build`, no interpreter matrix (the wheel is
8+
# tagged py3-none-<platform> and carries no compiled extension of its own).
9+
# Upstream's own workflow has no Linux leg at all - every Linux install
10+
# today builds the sdist locally, since the unpatched CustomBdistWheel
11+
# produces an invalid "linux-<arch>" tag for any arch it doesn't special-case.
12+
name: Build fiftyone-db wheels (riscv64)
13+
14+
on:
15+
workflow_dispatch:
16+
inputs:
17+
version:
18+
description: 'Version glob to (re)build; empty builds every version of docs/packages/fiftyone-db.yaml not released yet'
19+
required: false
20+
default: ''
21+
pull_request:
22+
branches: [main]
23+
paths:
24+
- '.github/workflows/build-fiftyone-db.yml'
25+
- 'docs/packages/fiftyone-db.yaml'
26+
- 'patches/fiftyone-db/**'
27+
push:
28+
branches: [main]
29+
paths:
30+
- '.github/workflows/build-fiftyone-db.yml'
31+
- 'docs/packages/fiftyone-db.yaml'
32+
- 'patches/fiftyone-db/**'
33+
34+
concurrency:
35+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
36+
cancel-in-progress: true
37+
38+
permissions:
39+
contents: read
40+
41+
env:
42+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
43+
44+
jobs:
45+
setup:
46+
uses: $/.github/workflows/_setup.yml
47+
with:
48+
package: fiftyone-db
49+
version: ${{ inputs.version }}
50+
51+
build_wheels:
52+
needs: [setup]
53+
if: needs.setup.outputs.versions != '[]'
54+
name: Build fiftyone-db ${{ matrix.version }} py3-none-manylinux_riscv64
55+
runs-on: ubuntu-24.04-riscv
56+
timeout-minutes: 60
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
61+
env:
62+
FIFTYONE_DB_VERSION: ${{ matrix.version }}
63+
64+
steps:
65+
- name: Checkout fiftyone db-v${{ env.FIFTYONE_DB_VERSION }}
66+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
67+
with:
68+
repository: voxel51/fiftyone
69+
ref: db-v${{ env.FIFTYONE_DB_VERSION }}
70+
path: fiftyone
71+
persist-credentials: false
72+
73+
- name: Checkout python-wheels
74+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
75+
with:
76+
path: python-wheels
77+
persist-credentials: false
78+
79+
- name: Apply patches
80+
# git -C changes git's own cwd, but the shell still expands this
81+
# glob relative to $GITHUB_WORKSPACE (where fiftyone/ and
82+
# python-wheels/ are siblings) before git ever sees it, so the
83+
# patch path is relative to there, not to -C's target.
84+
run: git -C fiftyone apply $PWD/python-wheels/patches/fiftyone-db/${{ env.FIFTYONE_DB_VERSION }}/*.patch
85+
86+
- name: Build wheel, check its tag/contents, and smoke-test install
87+
# All three steps run inside the manylinux image, not the bare
88+
# runner: the runner's own python/pip is a different glibc baseline
89+
# than manylinux_2_39, and pip's platform-tag compatibility check
90+
# rejects the wheel as "not a supported wheel on this platform"
91+
# outside the image it was tagged for.
92+
env:
93+
RELEASE_VERSION: ${{ env.FIFTYONE_DB_VERSION }}
94+
run: |
95+
set -eux
96+
mkdir -p wheelhouse
97+
docker run --rm -i \
98+
-v "${GITHUB_WORKSPACE}:/work" -w /work/fiftyone/package/db \
99+
-e RELEASE_VERSION \
100+
"${MANYLINUX_RISCV64_IMAGE}" \
101+
bash <<'SCRIPT'
102+
set -eux
103+
PYTHON_BIN=/opt/python/cp312-cp312/bin/python
104+
"${PYTHON_BIN}" -m pip install -q -U pip build
105+
"${PYTHON_BIN}" -Im build --wheel
106+
cp dist/*.whl /work/wheelhouse/
107+
108+
wheel=$(ls /work/wheelhouse/*.whl)
109+
case "$wheel" in
110+
*-py3-none-manylinux_2_39_riscv64.whl) ;;
111+
*) echo "unexpected wheel tag: $wheel"; exit 1 ;;
112+
esac
113+
"${PYTHON_BIN}" -m zipfile -l "$wheel"
114+
# MongoDB ships no riscv64 binary (gotcha: see patches/fiftyone-db's
115+
# Upstream-Status), so the wheel must NOT contain mongod - only the
116+
# empty bin/ dir fiftyone.db expects to find at runtime.
117+
if "${PYTHON_BIN}" -m zipfile -l "$wheel" | grep -q 'fiftyone/db/bin/mongod'; then
118+
echo "wheel unexpectedly bundles a mongod binary"
119+
exit 1
120+
fi
121+
122+
"${PYTHON_BIN}" -m venv /tmp/venv
123+
/tmp/venv/bin/pip install -q "$wheel"
124+
/tmp/venv/bin/python -c "
125+
import fiftyone.db
126+
print('fiftyone.db imports ok; bin dir:', fiftyone.db.FIFTYONE_DB_BIN_DIR)
127+
"
128+
SCRIPT
129+
130+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
131+
with:
132+
name: fiftyone-db-${{ env.FIFTYONE_DB_VERSION }}-py3-none-manylinux_riscv64
133+
path: wheelhouse/*.whl
134+
if-no-files-found: error
135+
136+
publish:
137+
name: Publish fiftyone-db ${{ matrix.version }}
138+
needs: [setup, build_wheels]
139+
if: needs.setup.outputs.versions != '[]'
140+
strategy:
141+
fail-fast: false
142+
matrix:
143+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
144+
permissions:
145+
contents: write
146+
pull-requests: write
147+
uses: $/.github/workflows/_publish-wheel.yml
148+
secrets:
149+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
150+
with:
151+
artifact-pattern: fiftyone-db-${{ matrix.version }}-py3-none-manylinux_riscv64

‎.github/workflows/build-tiktoken.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
build_wheels:
4242
needs: [setup]
4343
if: needs.setup.outputs.versions != '[]'
44-
name: py${{ matrix.python-version }} on ${{ matrix.os }}
44+
name: Build tiktoken ${{ matrix.version }}
4545
runs-on: ${{ matrix.os }}
4646
timeout-minutes: 60
4747
strategy:
@@ -73,8 +73,6 @@ jobs:
7373
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
7474
env:
7575
CIBW_BUILD: "cp${{ matrix.python-version}}-*"
76-
# skip musllinux for now, because rustup.rs does not have installer for riscv64gc-unknown-linux-musl
77-
CIBW_SKIP: "*-musllinux_*"
7876

7977
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
8078
with:

‎docs/packages/fiftyone-db.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package-name: fiftyone-db
2+
source-code: https://github.com/voxel51/fiftyone
3+
license: Apache-2.0
4+
versions:
5+
- version: 1.4.1

‎docs/packages/tiktoken.yaml‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,3 @@ versions:
9999
sha256: 067a20bdfc4fcad2ec10969f48d7fdbcefdc77d257c5fb7001221177c1aefbea
100100
requires-python: '>=3.9'
101101
- version: 0.14.0
102-
tag: tiktoken-v0.14.0-20260902125649
103-
files:
104-
- filename: tiktoken-0.14.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
105-
sha256: a98bd6bc4cf776afbd251838ad40dd3f75c7f82592c28c6c45bd305e0d9a4b4f
106-
requires-python: '>=3.9'
107-
- filename: tiktoken-0.14.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
108-
sha256: b65b79e748126303b750a1f96efd9d36f326d016a988fe2a72f45279482e4ecc
109-
requires-python: '>=3.9'
110-
- filename: tiktoken-0.14.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
111-
sha256: cf11bbc9118cd5a609fff233173513835d404d0d632b3b6cfe6a0244c88da25f
112-
requires-python: '>=3.9'
113-
- filename: tiktoken-0.14.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
114-
sha256: 0452cf3c0cba21d3770d6ad1330a0eb67bec072b9cbb9f27cc4a14816858a7f4
115-
requires-python: '>=3.9'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Fri, 2 Oct 2026 00:00:00 +0000
4+
Subject: [PATCH] package/db: normalize the platform tag in get_tag()
5+
6+
Upstream-Status: Submitted [https://github.com/voxel51/fiftyone/pull/8637]
7+
8+
CustomBdistWheel.get_tag() returns self.plat_name as-is. For platforms
9+
not explicitly handled in finalize_options() - riscv64 among them -
10+
plat_name keeps the sysconfig form (e.g. "linux-riscv64"), whose "-"
11+
is not valid in a wheel tag, so pip rejects the resulting filename.
12+
13+
Backported from the upstream PR linked above (not yet merged), which
14+
applies the same normalization bdist_wheel.get_tag() itself uses as of
15+
setuptools 84.0.0.
16+
---
17+
package/db/setup.py | 12 +++++++++++-
18+
1 file changed, 11 insertions(+), 1 deletion(-)
19+
20+
diff --git a/package/db/setup.py b/package/db/setup.py
21+
index e7ac56cf5e6..50092223882 100644
22+
--- a/package/db/setup.py
23+
+++ b/package/db/setup.py
24+
@@ -233,7 +233,17 @@ def finalize_options(self):
25+
def get_tag(self):
26+
impl = "py3"
27+
abi_tag = "none"
28+
- return impl, abi_tag, self.plat_name
29+
+ # same normalization as bdist_wheel.get_tag() does in current lastest
30+
+ # version (84.0.0) as of today (Octobre 2026), so that platforms not
31+
+ # handled above (e.g. "linux-riscv64") still yield a valid wheel tag see
32+
+ # https://github.com/pypa/setuptools/blob/72e919a8b10aaafc041205d4e3ae0e6a2e1e5f87/setuptools/command/bdist_wheel.py#L346
33+
+ plat_name = (
34+
+ self.plat_name.lower()
35+
+ .replace("-", "_")
36+
+ .replace(".", "_")
37+
+ .replace(" ", "_")
38+
+ )
39+
+ return impl, abi_tag, plat_name
40+
41+
def write_wheelfile(self, *args, **kwargs):
42+
bdist_wheel.write_wheelfile(self, *args, **kwargs)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Fri, 2 Oct 2026 00:00:00 +0000
4+
Subject: [PATCH] package/db: tag riscv64 wheels as manylinux_2_39_riscv64
5+
6+
Upstream-Status: Submitted [https://github.com/voxel51/fiftyone/pull/8637]
7+
8+
With the previous patch alone, riscv64 wheels get a valid but generic
9+
linux_riscv64 tag, which PyPI (and our own registry) rejects as not a
10+
recognized platform tag.
11+
12+
Add an explicit riscv64 branch in finalize_options(), matching the
13+
official manylinux riscv64 baseline (glibc 2.39), the same way the
14+
other Linux architectures are handled.
15+
16+
Backported from the upstream PR linked above (not yet merged). As that
17+
PR notes, MongoDB ships no riscv64 binary, so on this platform the
18+
wheel builds and installs cleanly but without a bundled mongod -
19+
_get_download() finds no riscv64 entry in LINUX_DOWNLOADS, returns
20+
None, and write_wheelfile() leaves fiftyone/db/bin/ empty instead of
21+
raising. Callers must point fiftyone at an external MongoDB via
22+
database_uri, exactly as fiftyone's own docs already describe for any
23+
platform lacking a bundled mongod.
24+
---
25+
package/db/setup.py | 2 ++
26+
1 file changed, 2 insertions(+)
27+
28+
diff --git a/package/db/setup.py b/package/db/setup.py
29+
index 50092223882..d37d33ceea9 100644
30+
--- a/package/db/setup.py
31+
+++ b/package/db/setup.py
32+
@@ -219,6 +219,8 @@ def finalize_options(self):
33+
self.plat_name = "manylinux1_i686"
34+
elif is_platform("Linux", "aarch64"):
35+
self.plat_name = "manylinux2014_aarch64"
36+
+ elif is_platform("Linux", "riscv64"):
37+
+ self.plat_name = "manylinux_2_39_riscv64"
38+
elif is_platform("Linux", "x86_64"):
39+
self.plat_name = "manylinux1_x86_64"
40+
elif is_platform("Darwin", "arm64"):

0 commit comments

Comments
 (0)