This allows out-of-tree users to derive PyConcreteType to bind custom
types.
The Type version of https://reviews.llvm.org/D101063/new/
Differential D101496
[mlir] Move PyConcreteType to header. NFC. jdd on Apr 28 2021, 3:40 PM. Authored by
Details This allows out-of-tree users to derive PyConcreteType to bind custom The Type version of https://reviews.llvm.org/D101063/new/
Diff Detail
Event TimelineComment Actions Works for me, but I will make the PSA that by expanding the public API in this way, we are heading in to really deep waters when it comes to linkage issues and bugs. We can run this forward a bit and see, but know that actually shipping a shared mlir python package in combination with other projects has a lot of sharp edges that will need resolution at some point. Comment Actions PSA noted. When I mentioned this on discourse, it seemed like this and the previous change for attributes were expansions we could get some mileage out of without totally going off the deep end. Are there immediate linkage concerns with deriving PyConcreteType out of tree, or just the general concerns we have been discussing? Comment Actions Thanks @stellaraccident. So I assume you'd be opposed to making this a real public API by moving some of the python headers into 'mlir/include'? I was going to do that next since as of now, it's quite awkward to #include in out-of-tree code. Comment Actions Generic concerns from me:
An answer that neatly side-steps this for projects like circt and npcomp, which merely want to use MLIR for their own ends, and have limited benefit from joining on a single shared installation, is to move the MLIR Python binding in a direction so that it can be *privately embedded* in such a project (i.e. as an circt.mlir private module vs a shared dependency on mlir). I've tried to keep the source tree in a rough shape to make such an evolution practical at some point, but it would be definite work. Comment Actions I'm not opposed, but I am advising caution: the distance between doing this and real, unsolvable problems, is really short. Comment Actions @stellaraccident do you mind replicating your comments in https://llvm.discourse.group/t/python-bindings-for-out-of-tree-projects/3339 so we don't spread the discussion? |