HomeFreeBSD

misc/py-onnxruntime: Fix wheel missing the compiled pybind extension

Description

misc/py-onnxruntime: Fix wheel missing the compiled pybind extension

setup.py's per-platform "libs" list decides which capi/ files get bundled
into the wheel as package data. It has dedicated branches for Linux
(manylinux and non-manylinux), Darwin, and Windows, but none for FreeBSD --
which silently fell through to the Windows-oriented default, whose *.dll/
*.pyd glob patterns never match anything here. The wheel built without
error, but ended up missing onnxruntime_pybind11_state.so entirely, along
with libonnxruntime_providers_shared.so and the versioned libonnxruntime.so;
the port previously worked around this with a manual post-install step that
copied the pybind extension in from the raw build tree afterward.

Add a FreeBSD branch to setup.py's libs list, mirroring the already-working
Darwin one (plain package-data entries, no ext_modules), so the wheel now
includes the same compiled artifacts on FreeBSD as it does on every other
supported platform. The now-redundant post-install workaround is removed.

Separately, tools/ci_build/build.py's own bdist_wheel invocation never
exposed a way to control the wheel's output directory, leaving it at
setup.py's undocumented default (a "dist" directory relative to the CMake
build tree). Add a small env-var pass-through (ORT_DIST_DIR) so the port
can redirect it to a predictable, WRKSRC-relative location instead,
matching the location PEP517_INSTALL_CMD/PEP517_BUILD_DEPEND now expect.

PR: 297774
Approved by: yuri (maintainer)
Differential Revision: https://reviews.freebsd.org/D58860

Details

Provenance
michaeloAuthored on Aug 15 2026, 4:56 PM
Differential Revision
D58860: misc/py-onnxruntime: Fix wheel missing the compiled pybind extension
Parents
R11:096369a791fb: lang/gcc17-devel: fix build after base d08296c7ab0d
Branches
Unknown
Tags
Unknown