Skip to content

Commit 82fcffa

Browse files
authored
iwyu.yml: use Qt 6.7.0 for include-what-you-use (#6218)
Starting with Qt 6.7.0 we no longer require the Qt mappings because IWYU annotations have been added to the headers upstream (see https://bugreports.qt.io/browse/QTBUG-119505).
1 parent 087fd79 commit 82fcffa

1 file changed

Lines changed: 31 additions & 29 deletions

File tree

.github/workflows/iwyu.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
image: ["opensuse/tumbleweed:latest"] # "opensuse/tumbleweed:latest" / "fedora:latest" / "debian:unstable" / "archlinux:latest"
18+
image: ["archlinux:latest"] # "opensuse/tumbleweed:latest" / "fedora:latest" / "debian:unstable" / "archlinux:latest"
1919

2020
runs-on: ubuntu-22.04
2121
if: ${{ github.repository_owner == 'danmar' }}
2222

2323
container:
2424
image: ${{ matrix.image }}
2525

26+
env:
27+
QT_VERSION: 6.7.0
28+
2629
steps:
2730
- uses: actions/checkout@v3
2831

@@ -31,19 +34,16 @@ jobs:
3134
run: |
3235
apt-get update
3336
apt-get install -y cmake clang make libpcre3-dev
34-
apt-get install -y qt6-base-dev qt6-tools-dev qt6-charts-dev
35-
apt-get install -y wget iwyu
36-
ln -s x86_64-linux-gnu/qt6 /usr/include/qt
37+
apt-get install -y libgl-dev # fixes missing dependency for Qt in CMake
38+
apt-get install -y iwyu
3739
38-
# TODO: fails with /usr/lib/qt6/bin/lupdate: symbol lookup error: /usr/lib/libproxy/libpxbackend-1.0.so: undefined symbol: g_once_init_leave_pointer
3940
- name: Install missing software on archlinux
4041
if: contains(matrix.image, 'archlinux')
4142
run: |
4243
set -x
4344
pacman -Sy
4445
pacman -S cmake make clang pcre --noconfirm
45-
pacman -S qt6-base qt6-tools qt6-charts --noconfirm
46-
pacman -S wget --noconfirm
46+
pacman -S libglvnd --noconfirm # fixes missing dependency for Qt in CMake
4747
pacman-key --init
4848
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
4949
pacman-key --lsign-key 3056513887B78AEB
@@ -53,25 +53,36 @@ jobs:
5353
pacman -Sy
5454
pacman -S include-what-you-use --noconfirm
5555
ln -s iwyu-tool /usr/sbin/iwyu_tool
56-
ln -s qt6 /usr/include/qt
5756
5857
- name: Install missing software on Fedora
5958
if: contains(matrix.image, 'fedora')
6059
run: |
6160
dnf install -y cmake clang pcre-devel
62-
dnf install -y qt6-qtbase-devel qt6-qttools-devel qt6-qtcharts-devel
63-
dnf install -y wget iwyu
61+
dnf install -y libglvnd-devel # fixes missing dependency for Qt in CMake
62+
dnf install -y iwyu
6463
ln -s iwyu_tool.py /usr/bin/iwyu_tool
65-
ln -s qt6 /usr/include/qt
6664
6765
- name: Install missing software on OpenSUSE
6866
if: contains(matrix.image, 'opensuse')
6967
run: |
7068
zypper install -y cmake clang pcre-devel
71-
zypper install -y qt6-base-common-devel qt6-core-devel qt6-gui-devel qt6-widgets-devel qt6-printsupport-devel qt6-linguist-devel qt6-help-devel qt6-charts-devel qt6-test-devel
72-
zypper install -y wget include-what-you-use-tools
69+
zypper install -y include-what-you-use-tools
70+
# fixes error during Qt installation
71+
# /__w/cppcheck/Qt/6.7.0/gcc_64/bin/qmake: error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
72+
zypper install -y libgthread-2_0-0
7373
ln -s iwyu_tool.py /usr/bin/iwyu_tool
74-
ln -s qt6 /usr/include/qt
74+
75+
# Fails on OpenSUSE:
76+
# Warning: Failed to restore: Tar failed with error: Unable to locate executable file: tar. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
77+
# Also the shell is broken afterwards:
78+
# OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown
79+
- name: Install Qt ${{ env.QT_VERSION }}
80+
uses: jurplel/install-qt-action@v3
81+
with:
82+
version: ${{ env.QT_VERSION }}
83+
modules: 'qtcharts'
84+
install-deps: false
85+
cache: true
7586

7687
- name: Prepare CMake
7788
run: |
@@ -80,6 +91,8 @@ jobs:
8091
CC: clang
8192
CXX: clang++
8293

94+
# Fails on Debian:
95+
# /__w/cppcheck/Qt/6.7.0/gcc_64/libexec/rcc: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory
8396
- name: Prepare CMake dependencies
8497
run: |
8598
# make sure the precompiled headers exist
@@ -93,29 +106,18 @@ jobs:
93106
make -C cmake.output gui-build-deps
94107
make -C cmake.output triage-build-ui-deps
95108
96-
- name: Build Qt mappings
97-
run: |
98-
wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-qt.py
99-
python3 iwyu-mapgen-qt.py /usr/include/qt/ > qt.imp
100-
101109
- name: iwyu_tool
102110
run: |
103111
PWD=$(pwd)
104112
# -isystem/usr/lib/clang/17/include
105-
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -Xiwyu --mapping_file=$PWD/qt.imp > iwyu.log
113+
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments > iwyu.log
106114
107115
- uses: actions/upload-artifact@v3
108116
if: success() || failure()
109117
with:
110118
name: Compilation Database
111119
path: ./cmake.output/compile_commands.json
112120

113-
- uses: actions/upload-artifact@v3
114-
if: success() || failure()
115-
with:
116-
name: Qt Mappings
117-
path: ./qt.imp
118-
119121
- uses: actions/upload-artifact@v3
120122
if: success() || failure()
121123
with:
@@ -136,9 +138,8 @@ jobs:
136138
- name: Install missing software
137139
run: |
138140
sudo apt-get update
139-
sudo apt-get install -y cmake make
140-
sudo apt-get install -y libpcre3-dev
141-
sudo apt-get install -y libffi7 # work around missing dependency for Qt install step
141+
sudo apt-get install -y cmake make libpcre3-dev
142+
sudo apt-get install -y libgl-dev # missing dependency for using Qt in CMake
142143
143144
- name: Install clang
144145
run: |
@@ -153,6 +154,7 @@ jobs:
153154
with:
154155
version: ${{ env.QT_VERSION }}
155156
modules: 'qtcharts'
157+
install-deps: false
156158
cache: true
157159

158160
- name: Prepare CMake

0 commit comments

Comments
 (0)