-
Notifications
You must be signed in to change notification settings - Fork 446
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
Ensure we are finding proper operator<<
during debug printing
#4860
Conversation
So it looks like this forces everyone to implement both |
Well, they indeed will require to do this after adding namespaces as "generic" For now, it will be enough to inherit from See some discussion in #4825 (comment) and #4698 (comment) |
BUILD.bazel
Outdated
@@ -253,6 +253,7 @@ cc_library( | |||
"@com_google_absl//absl/container:inlined_vector", | |||
"@com_google_absl//absl/strings", | |||
"@com_google_absl//absl/strings:str_format", | |||
"@com_google_absl//absl/strings:str_join", |
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.
The bazel CI failure is because there isn't a separate :str_join
target. str_join.h
is included in the :strings
target: https://github.com/abseil/abseil-cpp/blob/ac267be5cf9b722a89c0293ccaa7df1ecdb3a446/absl/strings/BUILD.bazel#L84. I think the "@com_google_absl//absl/strings"
line above should have included it already.
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.
Well, I also hoped so, but it failed being unable to find str_join
in https://github.com/p4lang/p4c/actions/runs/10330407855/job/28599406481
Need to check what's going on more... maybe some includes are missed.
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.
Something like
Lines 17 to 21 in 0e2a7d6
#emit | |
#include "backends/tc/tc_defines.h" | |
#include "absl/strings/str_cat.h" | |
#include "absl/strings/str_join.h" | |
#end |
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.
Yeah. I'm wondering why this is not required for non-bazel builds though :) Have not checked yet.
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.
Ah, didn't realize this. That's interesting 🤔
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 think this goes in the right direction.
Do I understand it correctly that for things what inherit IHasDbPrint
the operator gets found by ADL?
Yes. But this is an interim solution to not break |
Make bug_helper more robust Signed-off-by: Anton Korobeynikov <[email protected]>
Signed-off-by: Anton Korobeynikov <[email protected]>
Signed-off-by: Anton Korobeynikov <[email protected]>
Some cleanup while there
First step of #4698