Skip to content

lancedb: add build-lancedb.yml for riscv64 wheels - #859

Open
luhenry wants to merge 4 commits into
mainfrom
lancedb
Open

lancedb: add build-lancedb.yml for riscv64 wheels#859
luhenry wants to merge 4 commits into
mainfrom
lancedb

Conversation

@luhenry

@luhenry luhenry commented Sep 3, 2026

Copy link
Copy Markdown
Member

Compiles LanceDB's Rust core (arrow, lance, datafusion, lance-index) into a pyo3 abi3 extension via maturin. Upstream publishes no riscv64 wheel.

Mirrors upstream's pypi-publish.yml.

Differs from upstream

  • Thin LTO, codegen-units=16, 2 build jobs - the shipped fat-LTO/codegen-units=1 profile is too slow/memory-heavy on this runner
  • protoc from Rocky 10's CRB repo, not the upstream release zip - same as build-statsig-python-core.yml
  • Skips the x86_64-only lancedb-compat package and fp16kernels feature - no riscv64 equivalent

Matrix: cp312 only - pyo3 carries abi3-py310 unconditionally, so one build covers every interpreter (as build-deltalake.yml does)

Testing

  • Same non-integration selection as run_tests/action.yml (-m "not slow and not s3_test")
  • Deselects test_table.py, test_util.py, test_embeddings.py, test_namespace_integration.py, docs/test_guide_tables.py, docs/test_python.py - unconditional import polars/import lance (pylance), neither has a riscv64 wheel

License: OK

Patches

  • 0001-cargo-redirect-lance-core-lance-linalg-to-a-riscv64.patch - Inappropriate. Redirects lance-core/lance-linalg to a patched sibling checkout; reproduces on riscv64 only.
  • 0002-lance-linalg-add-a-portable-riscv64-simd-fallback.patch - To upstream. Adds a portable fallback for SIMD types that only compile on x86_64/aarch64/loongarch64; reproduces on riscv64 only.

Built on cp312; TBD passed, TBD skipped.

Ports lancedb 0.37.1 (maturin/pyo3, abi3-py310) to riscv64. Builds one
cp310-abi3 wheel on cp312 with the same OOM/timeout mitigations
build-deltalake.yml uses for a comparably sized Cargo workspace (~750
resolved crates for riscv64gc-unknown-linux-gnu): swap space, thin
LTO/codegen-units=16 in place of the shipped fat-LTO release profile,
and CARGO_BUILD_JOBS=2. protoc comes from Rocky 10's CRB repo, same as
build-statsig-python-core.yml. Test suite mirrors run_tests/action.yml's
non-integration path, with six files excluded for unconditional
`import polars`/`import lance` (pylance) module-scope imports that have
no riscv64 wheel.
lance-core's SIMD_SUPPORT static and lance-linalg's f32x8/f32x16/i32x8/
f64x4/f64x8 SIMD types compile only for x86_64/aarch64/loongarch64
upstream, so the first CI run failed at lance-core with "expected
SimdSupport, found ()". Redirects both crates (pinned at =10.0.0) to a
sibling checkout of the same tag carrying a portable scalar fallback,
mirroring u8x16/u8x32's existing shape. Workflow clones that checkout
and applies both patches before invoking cibuildwheel.
\`git -C lance apply ../python-wheels/...\` resolves the patch file's own
path relative to lance/ once git changes into it, but bash still
expands the *shell glob* (0002*.patch) relative to its own cwd
($GITHUB_WORKSPACE) before git ever runs, so it never matches and the
literal, unexpanded path fails to open. \`cd lance &&\` makes both the
glob expansion and git's path resolution agree.
@luhenry luhenry changed the title build: Add lancedb riscv64 wheel workflow lancedb: add build-lancedb.yml for riscv64 wheels Sep 3, 2026
CI run 33791589510 built the wheel successfully but failed at test time:
12 tests in test_db.py/test_hybrid_query.py/test_permutation.py/test_query.py
import lance (pylance) or polars lazily inside the test body rather than at
module scope, so they collect fine (unlike the six files already excluded
via --ignore) but fail at runtime since neither package has a riscv64 wheel.
The 13th, test_package_metadata.py::test_pyo3_abi_matches_minimum_supported_python,
reads python/Cargo.toml relative to its own file path; CIBW_TEST_SOURCES only
stages pyproject.toml and python/tests, so it always FileNotFoundErrors
regardless of platform - it's a repo-metadata sanity check with nothing to
verify against an installed wheel, not a riscv64-specific failure.

Deselected individually rather than dropping the whole files, since each
file has other tests that already pass (726 passed, 39 skipped, 45
deselected in the same run).
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.

1 participant