diff options
author | Maksim Levental <maksim.levental@gmail.com> | 2025-09-30 01:37:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-30 05:37:54 +0000 |
commit | e911eba3ef6990da2c4620c573b99a4f20f53da4 (patch) | |
tree | 10c26635e8bf89c19cea799f56e23f2ffa4a3fe2 /clang/lib/Serialization/ModuleCache.cpp | |
parent | 46ea03997da6b07dda451be7e15ec7f13ebbe3ea (diff) | |
download | llvm-e911eba3ef6990da2c4620c573b99a4f20f53da4.zip llvm-e911eba3ef6990da2c4620c573b99a4f20f53da4.tar.gz llvm-e911eba3ef6990da2c4620c573b99a4f20f53da4.tar.bz2 |
[MLIR][Python] Fix stubgen/PYTHONPATH collision/bug (#161307)
If `PYTHONPATH` is set and points to the build location of the python
bindings package then when stubgen runs, `_mlir` will get imported twice
and bad things will happen (e.g., `Assertion !instance && “PyGlobals
already constructed”’`). This happens because `mlir` is a namespace
package and the importer/loader can't distinguish between
`mlir._mlir_libs._mlir` and `_mlir_libs._mlir` imported from `CWD`. Or
something like that. The fix is to filter out any entries in
`PYTHONPATH` that end in `MLIR_BINDINGS_PYTHON_INSTALL_PREFIX/..` (e.g.,
`python_packages/mlir_core/`).
Diffstat (limited to 'clang/lib/Serialization/ModuleCache.cpp')
0 files changed, 0 insertions, 0 deletions