[Mlir-commits] [mlir] [mlir][python] Make test stubgen depend on _mlirRegisterEverything (PR #235462)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Oct 25 16:30:40 PDT 2026


aidint wrote:

Agreed, it's a pretty weird edge case.

>  Is it because you've only tried rebuilding the tests between bumps?

No, I was building the whole tree. I hit it by chance: nothing makes the stub wait for `_mlirRegisterEverything`, so ninja happened to run stubgen before rebuilding it, and stubgen loaded the stale copy. If ninja built `_mlirRegisterEverything` first, there would have been no error.

> Why does this only affect `_mlirPythonTestNanobind`?

It is the only module that stubgen imports through the `mlir._mlir_libs` package, so it's the only one that runs `mlir/_mlir_libs/__init__.py` and imports `_mlirRegisterEverything` if it is built before the stubgen. The other modules are:
   - `_mlir` which doesn't import `mlir._mlir_libs`
   - The standalone `_standaloneDialectsNanobind` that is in `mlir_standalone._mlir_libs`, which doesn't build `_mlirRegisterEverything`, so the import takes the graceful fail path.

https://github.com/llvm/llvm-project/pull/235462


More information about the Mlir-commits mailing list