Skip to content

lib3mf: Add version 2.5.0 - #2173

Merged
luhenry merged 2 commits into
mainfrom
lib3mf
Sep 21, 2026
Merged

luhenry merged 2 commits into
mainfrom
lib3mf

Conversation

@luhenry

@luhenry luhenry commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Compiles lib3mf, the 3MF Consortium's C++ implementation of the 3D Manufacturing Format, and ships it beside the ACT-generated ctypes wrapper. Upstream publishes no riscv64 wheel.

Mirrors upstream's python-package.yml.

Differs from upstream

  • Builds lib3mf.so from 3MFConsortium/lib3mf at the matching tag - the packaging repo commits an x86_64 binary taken from the SDK release asset, which exists for x86_64 only.
  • Runs the build in the manylinux_riscv64 image instead of ubuntu-latest.
  • LIB3MF_TESTS=OFF - the default target also builds the C++ suite and the libressl it links, neither of which reaches the wheel.

Matrix: one py3-none wheel, as upstream - the package ships no extension module.

Testing

  • Adds the packaging repo's create_cube example, a read-back of the 3MF it writes, and its interpreter-shutdown regression test to upstream's import check.

License: Wheel bundles zlib, libzip, cpp-base64 and fast_float (all permissive); upstream ships no licence text for them, so the build adds it.

Patches

  • 0001-Support-building-the-wheel-on-linux-riscv64.patch - Upstream-Status: To upstream. Without it setup.py refuses to run off x86_64 and the wheel is tagged manylinux2014_x86_64. Reproduces on any non-x86_64 host.

Built on cp312; 4 tests passed.

lib3mf publishes one Linux wheel, py3-none-manylinux2014_x86_64. The tag
has no ABI half because the package ships no extension module: the whole
API is the ACT-generated ctypes wrapper Lib3MF.py driving lib3mf.so, a
5.3 MB C++ shared library. The platform half is load-bearing all the
same, so riscv64 needs a real build rather than a retag.

The distribution is cut from 3MFConsortium/lib3mf_python, a packaging
repo the source tree never references; the workflow mirrors its
python-package.yml. That repo commits lib3mf.so as an x86_64 binary,
lifted by prepare_pypi_release.py out of the lib3mf_sdk_v<version>.zip
release asset, and the SDK is published for x86_64 Linux only. The
library is BSD-3-Clause C++ with a plain CMake build and no architecture
gates, so the job builds it from 3MFConsortium/lib3mf at the matching
tag with upstream's own cmake/GenerateMake.sh, drops the result over the
committed binary and then runs upstream's build_wheels.py unchanged.

The patch adds riscv64 to the two hardcoded x86_64 tables that stop that
working: setup.py's SUPPORTED_PLATFORMS gate, and get_platform_tag(),
which returns the glibc 2.17 manylinux2014 baseline for every Linux host
where riscv64's oldest profile is glibc 2.39.

zlib, libzip and cpp-base64 are compiled into lib3mf.so and fast_float
is inlined into it, so their licences are staged at the project root for
setuptools' default glob to ship - upstream's own wheels carry only the
binding's BSD licence. Nothing GPL is vendored: the library links
libstdc++, libgcc_s, libm and libc and nothing else, exactly as the
released x86_64 binary does.

Tests are the packaging repo's own: the import and wrapper handshake its
CI runs, plus its create_cube example (a full mesh build and 3MF write)
and its interpreter-shutdown regression test.
luhenry added a commit that referenced this pull request Sep 21, 2026
cmake --build's default target also builds the C++ test suite, which
links the vendored libressl in Libraries/ - several thousand extra
translation units that never reach the wheel. LIB3MF_TESTS=OFF is the
project's own switch for that and leaves lib3mf.so byte-for-byte the
library the wheel needs.

Cover what the C++ suite would have covered on the reader side by
reading the example's cube.3mf back and checking its geometry, instead
of only writing it.
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-21 14:41 UTC

luhenry added a commit that referenced this pull request Sep 21, 2026
@luhenry
luhenry marked this pull request as ready for review September 21, 2026 14:29
@luhenry
luhenry merged commit a7d48c2 into main Sep 21, 2026
9 checks passed
@luhenry
luhenry deleted the lib3mf branch September 21, 2026 14:36
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