Skip to content

Commit 9b0a13a

Browse files
committed
tidy: Add include-what-you-use
1 parent 74cd038 commit 9b0a13a

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

ci/test/00_setup_env_native_tidy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export DOCKER_NAME_TAG="ubuntu:22.04"
1010
export CONTAINER_NAME=ci_native_tidy
11-
export PACKAGES="clang llvm clang-tidy bear libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
11+
export PACKAGES="clang libclang-dev llvm-dev clang-tidy bear cmake libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
1212
export NO_DEPENDS=1
1313
export RUN_UNIT_TESTS=false
1414
export RUN_FUNCTIONAL_TESTS=false

ci/test/04_install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
111111
CI_EXEC "cd ${BASE_SCRATCH_DIR}/msan/build/ && make $MAKEJOBS cxx"
112112
fi
113113

114+
if [[ "${RUN_TIDY}" == "true" ]]; then
115+
CI_EXEC "mkdir -p ${BASE_SCRATCH_DIR}/iwyu/build/"
116+
CI_EXEC "git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_14 ${BASE_SCRATCH_DIR}/iwyu/include-what-you-use"
117+
CI_EXEC "cd ${BASE_SCRATCH_DIR}/iwyu/build && cmake -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 ../include-what-you-use"
118+
CI_EXEC "cd ${BASE_SCRATCH_DIR}/iwyu/build && make install $MAKEJOBS"
119+
fi
120+
114121
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
115122
echo "Create $BASE_ROOT_DIR"
116123
CI_EXEC rsync -a /ro_base/ "$BASE_ROOT_DIR"

ci/test/06_script_b.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ fi
3737
if [ "${RUN_TIDY}" = "true" ]; then
3838
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/src/"
3939
CI_EXEC run-clang-tidy "${MAKEJOBS}"
40+
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/"
41+
CI_EXEC "python3 ${BASE_SCRATCH_DIR}/iwyu/include-what-you-use/iwyu_tool.py src/compat src/init -p . ${MAKEJOBS} -- -Xiwyu --cxx17ns -Xiwyu --mapping_file=${BASE_BUILD_DIR}/bitcoin-$HOST/contrib/devtools/iwyu/bitcoin.core.imp"
4042
fi
4143

4244
if [ "$RUN_SECURITY_TESTS" = "true" ]; then

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,7 @@ AC_CONFIG_LINKS([contrib/devtools/security-check.py:contrib/devtools/security-ch
19341934
AC_CONFIG_LINKS([contrib/devtools/symbol-check.py:contrib/devtools/symbol-check.py])
19351935
AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-security-check.py])
19361936
AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py])
1937+
AC_CONFIG_LINKS([contrib/devtools/iwyu/bitcoin.core.imp:contrib/devtools/iwyu/bitcoin.core.imp])
19371938
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
19381939
AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff])
19391940
AC_CONFIG_LINKS([src/.clang-tidy:src/.clang-tidy])
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Fixups / upstreamed changes
2+
[
3+
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", public ] },
4+
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] },
5+
{ include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", public ] },
6+
]

0 commit comments

Comments
 (0)