-
Notifications
You must be signed in to change notification settings - Fork 1.6k
added an include-what-you-use GitHub Action #3759
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
| # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | ||
| name: include-what-you-use | ||
|
|
||
| on: workflow_dispatch | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-20.04 | ||
|
|
||
| container: | ||
| image: "kalilinux/kali-rolling" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| # TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image | ||
| - name: Install missing software | ||
| run: | | ||
| apt-get update | ||
| apt-get install -y cmake g++ make libz3-dev libpcre3-dev | ||
| apt-get install -y qtbase5-dev qttools5-dev libqt5charts5-dev | ||
| apt-get install -y wget iwyu | ||
|
|
||
| - name: Prepare CMake | ||
| run: | | ||
| mkdir cmake.output | ||
| cd cmake.output | ||
| cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off .. | ||
| cd .. | ||
|
|
||
| - name: Prepare CMake dependencies | ||
| run: | | ||
| # make sure the precompiled headers exist | ||
| #make -C cmake.output lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx | ||
| #make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx | ||
| # make sure the auto-generated GUI sources exist | ||
| make -C cmake.output autogen | ||
| # make sure the auto-generated GUI dependencies exist | ||
| make -C cmake.output gui-build-deps | ||
|
|
||
| - name: Build Qt mappings | ||
| run: | | ||
| wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-qt.py | ||
| python3 iwyu-mapgen-qt.py /usr/include/x86_64-linux-gnu/qt5/ > qt5.imp | ||
|
|
||
| # TODO: the mapping file causes a massive slowdown so we cannot use it at the moment. | ||
| # add "-Xiwyu --mapping_file=qt5.imp" at the end of the whole command if we can use them. | ||
| - name: iwyu_tool | ||
| run: | | ||
| # do not fail for now so the output is being saved | ||
| iwyu_tool -p cmake.output -j $(nproc) -- -w > iwyu.log || true | ||
|
|
||
| - uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: Qt Mappings | ||
| path: ./qt5.imp | ||
|
|
||
| - uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: Logs | ||
| path: ./*.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This change is incorrect. I've been improving the man-pages so that the correct includes are more clear; see syscall(2):
https://man7.org/linux/man-pages/man2/syscall.2.html
I opened an issue in iwyu(1) regarding that:
include-what-you-use/include-what-you-use#1036
The BSDs also use
<sys/syscall.h>:https://man.openbsd.org/man2/syscall.2
https://www.freebsd.org/cgi/man.cgi?query=syscall&apropos=0&sektion=0&manpath=FreeBSD+13.0-RELEASE+and+Ports&arch=default&format=html
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.
@alejandro-colomar
Thanks for pointing that out. I implicitly addressed this in the refactoring that is #4359.