Skip to content

Commit ab3bc7e

Browse files
dcaballeDavidSpickett
authored andcommitted
[mlir][cmake] Add missing MLIRTestDialect dependencies
This cherry picks [mlir][cmake] Add missing MLIRTestDialect dependency (#125004) (72b73c9) and [mlir] Fix build race condition in Pass Manager tests (d906da5) to the 20.x release branch. Both of these are addressing issues that started with #123910, which is already on the 20.x branch. In each case the cherry-picked changes correct problems that would otherwise be a race condition in certain builds. Linaro noticed this on our flang dylib (shared library) build bot. Failures look like: In file included from /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/mlir/test/lib/Pass/TestPassManager.cpp:10: /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/mlir/test/lib/Pass/../Dialect/Test/TestOps.h:148:10: fatal error: 'TestOps.h.inc' file not found 148 | #include "TestOps.h.inc" | ^~~~~~~~~~~~~~~ We have tested these changes on the buildbot for the last 2 days and had no problems. Whereas before it was failing maybe 1 in 10 builds, enough that multiple people in the community noticed it. Reported in #124485 and #124335. Co-authored-by: Diego Caballero <[email protected]>
1 parent d185bd9 commit ab3bc7e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mlir/test/lib/IR/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ add_mlir_library(MLIRTestIR
2727
TestVisitorsGeneric.cpp
2828

2929
EXCLUDE_FROM_LIBMLIR
30+
31+
DEPENDS
32+
MLIRTestDialect
3033
)
34+
3135
mlir_target_link_libraries(MLIRTestIR PUBLIC
3236
MLIRPass
3337
MLIRBytecodeReader

mlir/test/lib/Pass/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ add_mlir_library(MLIRTestPass
1010

1111
ADDITIONAL_HEADER_DIRS
1212
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass
13+
14+
LINK_LIBS PUBLIC
15+
MLIRTestDialect
1316
)
1417
mlir_target_link_libraries(MLIRTestPass PUBLIC
1518
${conversion_libs}
1619
MLIRIR
1720
MLIRPass
18-
MLIRTestDialect
1921
)
2022

2123
target_include_directories(MLIRTestPass

0 commit comments

Comments
 (0)