-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[bazel] Fix LLVM plugin tests under Analysis. #142999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Those tests were broken on bazel as a side effect of 8830e38. This commit is tested with this command on Linux: bazelisk test \ @llvm-project//llvm/unittests:analysis_tests \ @llvm-project//llvm/unittests:plugin_inline_advisor_analysis_test \ @llvm-project//llvm/unittests:plugin_inline_order_analysis_test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar w/ LLVM_ENABLE_PLUGINS, but if the tests pass, then sure?
FYI @chapuni who might know more about the failures
Thanks for the review. Since this only affects bazel and the tests were broken before, I feel this commit should be safe to submit. It is currently 2AM in Japan so I don't think @chapuni will be able to respond soon. Let me submit this commit now to avoid other issues being hidden under it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wecing Thanks and sorry for that. I was not aware of bazel cc_test
.
# These tests dynamically load Plugins which both pull in | ||
# llvm/lib/Analysis/ProfileSummaryInfo.cpp, which registers flags; | ||
# if built into the same cc_test target, those flags will be | ||
# registered twice and cause runtime failures. | ||
"Analysis/PluginInlineAdvisorAnalysisTest.cpp", | ||
"Analysis/PluginInlineOrderAnalysisTest.cpp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me investigate further later,
deps = [ | ||
"//llvm:Analysis", | ||
"//llvm:Core", | ||
"//llvm:Passes", | ||
"//llvm:Support", | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be handled as "interface libs". Plugins shouldn't link them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plugins shouldn't link them.
Actually, I just realized this is why I had to use separate targets for the plugin tests; if they are not linked into the plugins, there would be no duplicate flag registrations.
The right way to do this, is probably to introduce header-only versions of these four dependencies, and use them to build the plugin. But since these are just tests, I guess we are somewhat fine here...?
Those tests were broken on bazel as a side effect of 8830e38. This commit is tested with this command on Linux: bazelisk test \ @llvm-project//llvm/unittests:analysis_tests \ @llvm-project//llvm/unittests:plugin_inline_advisor_analysis_test \ @llvm-project//llvm/unittests:plugin_inline_order_analysis_test
Those tests were broken on bazel as a side effect of 8830e38. This commit is tested with this command on Linux: bazelisk test \ @llvm-project//llvm/unittests:analysis_tests \ @llvm-project//llvm/unittests:plugin_inline_advisor_analysis_test \ @llvm-project//llvm/unittests:plugin_inline_order_analysis_test
Those tests were broken on bazel as a side effect of 8830e38.
This commit is tested with this command on Linux: