-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-1413: [C++] Add include-what-you-use configuration #1016
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
|
I don't think it's necessary to run this on every build in Travis as it will primarily inflate our build times, only that we do a manual cleanup periodically (e.g. a couple times a release cycle) |
|
@fjetter can you capitalize the "Arrow" in the PR title (and add hyphen so it reads "ARROW-1413:")? I will take this for a spin when I can and then merge, sometime in the next couple days |
|
I took this for a spin and I'm not really sure this produces the expected results. At least we need to tune the |
|
We definitely should not be applying automated changes. iwyu does require a ton of tuning |
|
@wesm I'd remove the travis stuff again or do you want to keep it? Currently it doesn't do anything. |
|
Can you remove it ("ninja iwyu", etc.) from the Travis scripts for now? |
Change-Id: I02fe6a8a44dfcbb829ac16e61164b3d5d7ad436b
Change-Id: Ic739f49a3578c1cd04ae98c1b8f456383fb7b4e0
|
Forgot I have push permissions on your fork, I can take it from here |
Change-Id: Ib6cc65a8e86968c4b60c25144b4def8225e1412c
Change-Id: Ic7b3968999571974619b25d75d600f2c7ddcb486
|
+1. I will wait for the build to pass |
|
@wesm if you want to invoke it on the whole code base you can simply add c.f. https://cmake.org/cmake/help/v3.9/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.html?highlight=include For including it in the build chain, though, I would've preferred a partial check. |
|
I see. I wanted an easy option to run with the filters and suppressions. The option to do a partial run as with Kudu is still there (omit the "all" option from iwyu.sh). We can continue to tweak this as we venture forward, this is by no means final. Just want to get us all in the habit of keeping our includes clean |
This adds
iwyumake target to runinclude-what-you-useon all changed files of the current branch. As suggested in the ticket https://issues.apache.org/jira/browse/ARROW-1413 I took the code ofapache-kuduas a starting point and added a few modifications.While it works fine locally, I'm struggling to get it to work (i.e. build is failing) on travis. Somehow the check isn't performed without raising an error. I expect that clang doesn't have the iwyu properly installed but I couldn't verify it, yet.
Also, the tool requires a
compile_commands.jsonto be present including all the files to be checked which is why I added theexport CMAKE_EXPORT_COMPILE_COMMANDS=1to thetravis_env_common.shThis may be an issue since we are partially compiling multiple times but never the full codebase which is why I included the make/ninja iwyu twice.