- Now that packaging has stabilized, removes old mechanisms for loading extensions, preferring direct importing.
- Removes _cext_loader.py, _dlloader.py as unnecessary.
- Fixes the path where the CAPI dll is written on Windows. This enables that path of least resistance loading behavior to work with no further drama (see: https://bugs.python.org/issue36085).
- With this patch, ninja check-mlir on Windows with Python bindings works for me, modulo some failures that are actually due to a couple of pre-existing Windows bugs. I think this is the first time the Windows Python bindings have worked upstream.
- Downstream changes needed:
- If downstreams are using the now removed load_extension, reexport_cext, etc, then those should be replaced with normal import statements as done in this patch.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm probably not the best person to review this (since I'm not aware of the full history), but everything here looks reasonable to me and significantly less hacky to boot! Thanks
Thanks - I'll wait for ftynse to have a look. He's got the history and visibility into some of the weirder things we've done with this code out of tree. The tl;dr on the history is that we used to have deps that spanned the python package and the main LLVM build/install tree, and there were a few different ways this was packaged in downstreams. Now everything has converged on hermetic with a namespaced, relative package layout, so all that extra gunk can go away. Probably makes tools (pytype, et al) happier too.
Looks good for the parts I worked on (all passes registration and sparse tensor dialect stuff)
Further simplify _mlir_libs.init by using the new MAKE_MLIR_PYTHON_QUALNAME in native code to properly initialize the search path internally.