-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
chore: update includes with include-what-you-use #1382
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines and check for the automated tests. |
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
I committed a merge so the runners can test. Not 100% sure on some of these, but seems like a win. With the Qt headers, we've generally gone with <QtCore/QList> for example, but it seems like iwyu is sticking to things like <qlist.h> .. do you know if there's any difference? |
But above all, thank you - I've been meaning to run I might not merge this until after the upcoming 1.98 release just out of superstition though. |
Looks like it's using |
Here are the build results |
Oh. Wow. I intended this as just a draft PR (hadn't had time to finish the notes and do all the checks). Thanks for moving this along. I can take a look at the issues, but may need some help (I don't have a Windows machine, for example). Thanks! |
I think you should be able to click on "Details" for any of the failing / skipped tests to see the results. Usually the Cmake builds are easier to understand than the Build Wheels (because the Python build actions hide the compile errors). |
I'm also happy to take a look at what's going on, e.g., my comments above. |
Finally had some time to get back to this. Apologies for the delay. I've added some include-what-you-use pragmas to the code to prevent inclusion of As for the Qt headers, I'm not sure why Just double checking everything still builds now, and hope to have a PR up sometime in the next 24 hours. |
Thanks. As I said, this has been hugely needed and something I put off myself. It sounds like the Qt-preferred option is what we've used, e.g.
I can think of two strategies:
I'm not sure which is easier, although I'd probably go for option 2 myself because it's probably faster to grep the list of |
Looks like |
It does? Sorry, I'm not seeing that. I'm fairly new to requesting PRs from forked repos, so maybe I missed something in the process of updating this PR. Am I looking in the wrong place? I'm looking at the file here. If you're using grep, it will report the string |
No, it looks like I saw old build results (i.e., the build error) because the runners didn't restart until just now. I think because you're a new contributor, I have to authorize every I will probably hold off on this PR for a bit to make a 1.98.1 release first. |
Here are the build results |
Hacktoberfest 2023
This PR updates the
include
directives in the avogadrolibs submodule using the include-what-you-use tool.Note: there were some build issues after running the tool; specifically with some missed includes of
fstream
andsstream
, so these were manually added back in where needed.The Process
The process was non-trivial and not particularly fun. I'm including an outline of the steps here for anyone in the future wishing to do the same.
openchemistry
projectavogadrolibs
)openchemistry
repo to your machine.gitmodules
) to point the submodule in question (avogadrolibs
) to your fork of the submoduleOnce you have all the code on your machine. Time to set-up the toolchain.
Now that you have your toolchain built, it's time to go through the process.
openchemistry-build
) next to the repo directory$ cmake ../openchemistry
cmake --build . --config Release
iwyu_tool
and redirect the output to a file$ iwyu_tool -p ./avogadrolibs/ >> fix_includes_input.txt
fix_include
script, directing the output file as input to the script. This will perform the code updates. Note: this can take a while. Like a really long time. Like. REALLY long. And there's no progress indicator. It may seem like the process is frozen. Just wait. Go get a snack. Watch some tv.$ fix_include --nocomments -p ./avogadrolibs/ < fix_includes_input.txt
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.