-
Notifications
You must be signed in to change notification settings - Fork 13
Description
I am wrapping a Cxx library with python. That means using the cffi module (in my case), since it is very simple and reliable.
What I've found is while a traditional setup.py has integration with cffi and will build the cffi_modules during normal install, py-build-cmake does not.
Instead, I found a couple of problems:
py-build-cmakedid invokeinstalland did install to thedist-utils/libanddist-utils/includedirs
-- BUT -- there was no inherent mechanism for LD_LIBRARY_PATH/the linker to find the libs in that path.
- I had to run
python3 setup.py install, which is going to be deprecated soon, in order to generate thecffimodules.
With these two flaws, I had to abandon the use of py-build-cmake. I found no way to invoke setup.py reliably within the normal build process. I did find this kludge on stack overflow:
https://stackoverflow.com/questions/42585210/extending-setuptools-extension-to-use-cmake-in-setup-py
However, it is complex, costly to debug (in terms of time), doesn't work as-is, and will drive changes into my normal CMakeLists.txt.
With these flaws in mind, I had to abandon the pyproject.toml entirely -- cffi simply did not work, under any conditions, the way it does in a normal setup.py install. And I had to run cmake install independently, instead of as a packaged item along with the python package.
If py-project-toml was able to provide some direction to the linker when libs and includes are installed to the python3 distribution prefix, and was able to invoke cffi on the cffi modules I list in the pyproject.toml, it would have been able to "do all the things".
This seems like a pretty typical usecase for any Cxx/C/Cmake item I'd mix in with python. Hope there is a way to get this change through. Lmk if I can help.
Thanks.