Skip to content

Add libuuu riscv64 wheel build - #2348

Open
luhenry wants to merge 3 commits into
mainfrom
libuuu
Open

luhenry wants to merge 3 commits into
mainfrom
libuuu

Conversation

@luhenry

@luhenry luhenry commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Compiles libuuu.so, the C++ core of NXP's uuu flashing tool, into a py3-none wheel loaded through ctypes. Upstream publishes no riscv64 wheel.

Mirrors upstream's build_wrapper.yaml.

Differs from upstream

  • vcpkg dependencies replaced by dnf libusb1, bzip2, zstd, OpenSSL, zlib - vcpkg has no riscv64 binaries.
  • tinyxml2 10.0.0 built static from source - not packaged in Rocky 10.
  • setuptools-scm<10.2 - 10.2+ crashes egg_info on cp39 with an in-tree backend (any arch); 1.5.243 shipped with 9.2.2.

Matrix: one cp39 build, as upstream; the wheel is interpreter-agnostic.

Testing

  • test_get_platform_info deselected - it asserts the architecture is one of upstream's four.
  • Wheel also tested on cp310-cp314.

License: Wheel bundles libusb and libudev (LGPL-2.1), libcap, OpenSSL (Apache-2.0), zstd, bzip2 and a static tinyxml2 (Zlib); the build adds their licence texts.

Built on cp39; 25 passed, 1 deselected on each of cp39-cp314.

libuuu is NXP's ctypes wrapper around libuuu.so, the library half of
mfgtools' uuu flashing tool. Upstream's wheels are py3-none-<platform>
because the only native code is that shared library, compiled from the
mfgtools C++ sources by cibuildwheel's before-all.

Mirror upstream's build_wrapper.yaml, narrowed to riscv64: the same
cibuildwheel build of ./wrapper on cp39 from the uuu_<version> tag. The
vcpkg dependency build is replaced by the image's libusb1, bzip2, zstd,
OpenSSL and zlib packages plus a static tinyxml2 10.0.0 (the version
upstream's vcpkg baseline resolves; not packaged in Rocky 10).

The wheel ships the mfgtools and tinyxml2 licences and those of every
library auditwheel vendors, and the copyleft ones' sources are collected
for the release. Upstream's tests run on cp39 inside cibuildwheel and on
cp310-cp314 afterwards, minus test_get_platform_info, which asserts the
architecture is one of upstream's four.
luhenry added a commit that referenced this pull request Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2348/

Built to branch gh-pages at 2026-09-26 02:53 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

The cp39 wheel build crashes in egg_info with "TypeError: expected string
or bytes-like object" from importlib_metadata's normalize(). This is not
riscv64-specific: it reproduces on x86_64 CPython 3.9 with the same
sdist-less checkout.

setuptools-scm 10.2.0 (the first 10.x to allow Python 3.9 again) makes
its egg_info run() create libuuu.egg-info and write scm_*.json into it
before calling setuptools' run(), which is exactly the window setuptools
closed by preloading the egg_info.writers entry points
(pypa/pyproject-hooks#206). libuuu's in-tree backend declares
backend-path = ["."], so pyproject_hooks' _BackendPathFinder yields the
wrapper directory's distributions through the stdlib
importlib.metadata. On 3.9 a stdlib PathDistribution has no
_normalized_name and the half-written egg-info has no Name, so the
entry-point scan fails. Python 3.10+ derives the name from the
directory and builds fine; setuptools-scm 9.2.2 and 10.2.0-10.3.4 were
bisected on cp39 as good and bad respectively.

Upstream released 1.5.243 in December 2025 with setuptools-scm 9.2.2,
so constrain to <10.2 via PIP_CONSTRAINT and PIP_BUILD_CONSTRAINT.
A venv on the image's cp310 is seeded with pip 23.0.1, whose vendored
packaging lists no riscv64 in _have_compatible_abi, so it rejects the
manylinux_2_39_riscv64 wheel as unsupported on this platform.
luhenry added a commit that referenced this pull request Sep 26, 2026

This branch has not been deployed

No deployments
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