-
Notifications
You must be signed in to change notification settings - Fork 58
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
include: remove config.h from headers #752
Conversation
Header files shouldn't include `config.h` Signed-off-by: Eric Raut <[email protected]>
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.
We're probably solving the wrong problem here, but this also isn't wrong, so approved.
I'm somewhat against this. Some of these are just unnecessary, but some are not, eg: I don't see any good reason why it should be possible to include nccl_ofi_mr.h without that being defined. We've been bit by this before. The cleanest way to do this IMO is just to get rid of config.h entirely by removing So as long as we have config.h, and it needs to be included by someone (either the TU itself, where every header relies on a transitive previous inclusion of There's an argument to be made that project public headers should be stateless and not have any configuration, but that's not the state of the project and removing the include from the header doesn't change that, it just means that there's a transitive* inclusion of config.h that must occur instead. |
Nick convinced me that this is not sufficient to deal with our benchmark code properly, so I will come up with something else that doesn't require this patch. I think right now we're a bit inconsistent with whether we include |
A portion of this commit was fine with me (just in terms of removing totally unnecessary If there's buy in from both of you, I'd like to just get iwyu running in github actions on every commit similar to other compile-time checks we have. There's a million ways to solve header consistency, but at least this would be automatic and consistent, and we wouldn't ever have to think about it again. I'd actually proposed this previously in #351 (0e2d51d and f34a7ae) |
Unless we need a ton of workaround pragmas, I'm fine adding IWYU in the list of compile time checkers we run on every PR. I did try it with the version included in U20 without success, but didn't put a lot of time into it. |
Header files shouldn't include
config.h
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.