Skip to content

pymongocrypt: add build-pymongocrypt.yml for riscv64 wheels - #1693

Merged
luhenry merged 3 commits into
mainfrom
pymongocrypt
Sep 10, 2026
Merged

pymongocrypt: add build-pymongocrypt.yml for riscv64 wheels#1693
luhenry merged 3 commits into
mainfrom
pymongocrypt

Conversation

@luhenry

@luhenry luhenry commented Sep 10, 2026

Copy link
Copy Markdown
Member

Compiles libmongocrypt, MongoDB's client-side field-level encryption library, and packages it as the native payload of pymongocrypt's cffi bindings. Upstream publishes no riscv64 wheel, and no riscv64 libmongocrypt binary exists on the release page either.

Mirrors upstream's release.sh (build_manylinux_wheel + auditwheel repair).

Differs from upstream

  • Builds libmongocrypt from source with CMake instead of downloading a release tarball - no riscv64 tarball is published.
  • Uses -DDISABLE_NATIVE_CRYPTO=ON, matching the "-nocrypto" tarball upstream already downloads for every other platform.

Testing

  • Installs the built wheel, then runs upstream's test_binding.py/test_crypto.py against it; test_mongocrypt.py is skipped - needs pymongo-auth-aws, not yet on the registry.

License: OK

Built on riscv64; wheel install, bindings import, crypto-hooks check, and 7 pytest tests all pass.

Builds libmongocrypt from source with CMake (DISABLE_NATIVE_CRYPTO, matching
upstream's own "-nocrypto" distribution, since pymongocrypt always supplies
its own crypto hooks via the cryptography package) and packages it with
pymongocrypt's own hatchling build hook, mirroring release.sh's
build_manylinux_wheel + auditwheel repair. No riscv64 libmongocrypt binary is
published upstream, so this is the only build shape that works here.
luhenry added a commit that referenced this pull request Sep 10, 2026
…ntainer

Without an explicit BUILD_VERSION, libmongocrypt's CMakeLists.txt falls back
to etc/calc_release_version.py, which runs git rev-parse inside /workspace
and fails with "detected dubious ownership" since the actions/checkout user
differs from the manylinux container's build user. Passing -DBUILD_VERSION
explicitly (from the same libmongocrypt-version.txt the wheel already reads)
skips that code path entirely, matching CMakeLists.txt's own
`if (BUILD_VERSION STREQUAL "0.0.0")` guard.

Also restores the upstream binding/crypto unit test step and asserts the
built .so reports the pinned version.
…he wheel

The host runner's apt packages don't include libffi-dev, so pip's default
attempt to build cffi from source (public PyPI has no riscv64 wheel for it)
fails with "ffi.h: No such file or directory". Both cffi and cryptography
already have riscv64 wheels on pypi.riseproject.dev; point pip there and
require binaries for the two of them.
@luhenry
luhenry merged commit 6a25c4d into main Sep 10, 2026
7 checks passed
@luhenry
luhenry deleted the pymongocrypt branch September 10, 2026 10:45
@luhenry luhenry linked an issue Sep 10, 2026 that may be closed by this pull request
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.

pymongocrypt riscv64 support

1 participant