Page MenuHomeFreeBSD

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

Authored by michaelo on Sat, Aug 15, 4:56 PM.
Tags
None
Referenced Files
F171608324: D58860.id184757.diff
Sat, Sep 12, 3:19 AM
Unknown Object (File)
Thu, Sep 10, 11:09 AM
Unknown Object (File)
Thu, Sep 10, 8:50 AM
Unknown Object (File)
Thu, Sep 10, 5:33 AM
Unknown Object (File)
Tue, Sep 8, 8:02 PM
Unknown Object (File)
Mon, Sep 7, 9:30 PM
Unknown Object (File)
Mon, Sep 7, 8:47 PM
Unknown Object (File)
Mon, Sep 7, 2:07 AM
Subscribers
None

Details

Summary

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.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michaelo created this revision.

Found this completely by incident while working on python.mk improvements. At least setup.py changes could be upstream. They are straight forward.

This revision was not accepted when it landed; it landed in state Needs Review.Sat, Aug 22, 10:42 PM
This revision was automatically updated to reflect the committed changes.