Commit d02c7ae
authored
[MLIR][Python] fix stubgen (llvm#157583)
In llvm#155741 I broke the cardinal
rule of CMake: nothing happens when you think it happens 🤷. Meaning:
`declare_mlir_python_sources(SOURCES_GLOB
"_mlir_libs/${_module_name}/**/*.pyi")` wasn't picking up any sources
_because they aren't generated yet_. This of course makes sense in
retrospect (the stubs are generated as part of the build process, post
extension compile, rather than the configure process).
Thus, the API needs to be:
```
GENERATE_TYPE_STUBS: List of generated type stubs expected from stubgen, relative to _mlir_libs.
```
Partially as a result of this omission, the stubs weren't being
installed into either the build dir nor the install dir. That is also
fixed now:
**Source dir (for easy reference):**
<img width="300" height="674" alt="image"
src="https://github.com/user-attachments/assets/a569f066-c2bd-4361-91f3-1c75181e51da"
/>
**Build dir (for forthcoming typechecker tests):**
<img width="398" height="551" alt="image"
src="https://github.com/user-attachments/assets/017859f9-fddb-49ee-85e5-915f5b5f7377"
/>
**Install dir:**
<img width="456" height="884" alt="image"
src="https://github.com/user-attachments/assets/8051be7e-898c-4ec8-a11e-e2408b241a56"
/>1 parent 7d04e37 commit d02c7ae
File tree
3 files changed
+48
-11
lines changed- mlir
- cmake/modules
- python
- mlir/_mlir_libs
3 files changed
+48
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | | - | |
| 143 | + | |
139 | 144 | | |
140 | | - | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
149 | | - | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| |||
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
169 | | - | |
| 174 | + | |
170 | 175 | | |
171 | 176 | | |
172 | | - | |
| 177 | + | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
302 | 307 | | |
303 | 308 | | |
304 | 309 | | |
305 | | - | |
| 310 | + | |
| 311 | + | |
306 | 312 | | |
| 313 | + | |
| 314 | + | |
307 | 315 | | |
308 | | - | |
309 | | - | |
| 316 | + | |
| 317 | + | |
310 | 318 | | |
311 | | - | |
| 319 | + | |
312 | 320 | | |
313 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
314 | 329 | | |
315 | 330 | | |
316 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
509 | 513 | | |
510 | 514 | | |
511 | 515 | | |
| |||
528 | 532 | | |
529 | 533 | | |
530 | 534 | | |
| 535 | + | |
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| |||
543 | 548 | | |
544 | 549 | | |
545 | 550 | | |
| 551 | + | |
546 | 552 | | |
547 | 553 | | |
548 | 554 | | |
| |||
558 | 564 | | |
559 | 565 | | |
560 | 566 | | |
| 567 | + | |
561 | 568 | | |
562 | 569 | | |
563 | 570 | | |
| |||
573 | 580 | | |
574 | 581 | | |
575 | 582 | | |
| 583 | + | |
576 | 584 | | |
577 | 585 | | |
578 | 586 | | |
| |||
588 | 596 | | |
589 | 597 | | |
590 | 598 | | |
| 599 | + | |
591 | 600 | | |
592 | 601 | | |
593 | 602 | | |
| |||
603 | 612 | | |
604 | 613 | | |
605 | 614 | | |
| 615 | + | |
606 | 616 | | |
607 | 617 | | |
608 | 618 | | |
| |||
618 | 628 | | |
619 | 629 | | |
620 | 630 | | |
| 631 | + | |
621 | 632 | | |
622 | 633 | | |
623 | 634 | | |
| |||
633 | 644 | | |
634 | 645 | | |
635 | 646 | | |
| 647 | + | |
636 | 648 | | |
637 | 649 | | |
638 | 650 | | |
| |||
648 | 660 | | |
649 | 661 | | |
650 | 662 | | |
| 663 | + | |
651 | 664 | | |
652 | 665 | | |
653 | 666 | | |
| |||
662 | 675 | | |
663 | 676 | | |
664 | 677 | | |
| 678 | + | |
665 | 679 | | |
666 | 680 | | |
667 | 681 | | |
| |||
677 | 691 | | |
678 | 692 | | |
679 | 693 | | |
| 694 | + | |
680 | 695 | | |
681 | 696 | | |
682 | 697 | | |
| |||
692 | 707 | | |
693 | 708 | | |
694 | 709 | | |
| 710 | + | |
695 | 711 | | |
696 | 712 | | |
697 | 713 | | |
| |||
706 | 722 | | |
707 | 723 | | |
708 | 724 | | |
| 725 | + | |
709 | 726 | | |
710 | 727 | | |
711 | 728 | | |
| |||
724 | 741 | | |
725 | 742 | | |
726 | 743 | | |
| 744 | + | |
727 | 745 | | |
728 | 746 | | |
729 | 747 | | |
| |||
738 | 756 | | |
739 | 757 | | |
740 | 758 | | |
| 759 | + | |
741 | 760 | | |
742 | 761 | | |
743 | 762 | | |
| |||
752 | 771 | | |
753 | 772 | | |
754 | 773 | | |
| 774 | + | |
755 | 775 | | |
756 | 776 | | |
757 | 777 | | |
| |||
811 | 831 | | |
812 | 832 | | |
813 | 833 | | |
| 834 | + | |
814 | 835 | | |
815 | 836 | | |
816 | 837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
0 commit comments