Skip to content

Commit 8735e2c

Browse files
committed
ci: use LLVM/Clang 17 in tidy job
1 parent ce46b68 commit 8735e2c

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

ci/test/00_setup_env_native_tidy.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ export LC_ALL=C.UTF-8
88

99
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:23.10" # This version will reach EOL in Jul 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version).
1010
export CONTAINER_NAME=ci_native_tidy
11-
export PACKAGES="clang-16 libclang-16-dev llvm-16-dev libomp-16-dev clang-tidy-16 jq 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"
11+
export TIDY_LLVM_V="17"
12+
export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq 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"
1213
export NO_DEPENDS=1
1314
export RUN_UNIT_TESTS=false
1415
export RUN_FUNCTIONAL_TESTS=false
1516
export RUN_FUZZ_TESTS=false
1617
export RUN_TIDY=true
1718
export GOAL="install"
18-
export BITCOIN_CONFIG="CC=clang-16 CXX=clang++-16 --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -I/usr/lib/llvm-16/lib/clang/16/include'"
19+
export BITCOIN_CONFIG="CC=clang-${TIDY_LLVM_V} CXX=clang++-${TIDY_LLVM_V} --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -I/usr/lib/llvm-${TIDY_LLVM_V}/lib/clang/${TIDY_LLVM_V}/include'"
1920
export CCACHE_MAXSIZE=200M

ci/test/01_base_install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
7373
fi
7474

7575
if [[ "${RUN_TIDY}" == "true" ]]; then
76-
git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_16 /include-what-you-use
77-
cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-16 -S /include-what-you-use
76+
${CI_RETRY_EXE} git clone https://github.com/include-what-you-use/include-what-you-use -b master /include-what-you-use
77+
git -C /include-what-you-use checkout a138eaac254e5a472464e31d5ec418fe6e6f1fc7
78+
cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-"${TIDY_LLVM_V}" -S /include-what-you-use
7879
make -C /iwyu-build/ install "-j$( nproc )" # Use nproc, because MAKEJOBS is the default in docker image builds
7980
fi
8081

ci/test/06_script_b.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
175175
fi
176176

177177
if [ "${RUN_TIDY}" = "true" ]; then
178-
cmake -B /tidy-build -DLLVM_DIR=/usr/lib/llvm-16/cmake -DCMAKE_BUILD_TYPE=Release -S "${BASE_ROOT_DIR}"/contrib/devtools/bitcoin-tidy
178+
cmake -B /tidy-build -DLLVM_DIR=/usr/lib/llvm-"${TIDY_LLVM_V}"/cmake -DCMAKE_BUILD_TYPE=Release -S "${BASE_ROOT_DIR}"/contrib/devtools/bitcoin-tidy
179179
cmake --build /tidy-build "$MAKEJOBS"
180180
cmake --build /tidy-build --target bitcoin-tidy-tests "$MAKEJOBS"
181181

182182
set -eo pipefail
183183
cd "${BASE_BUILD_DIR}/bitcoin-$HOST/src/"
184-
( run-clang-tidy-16 -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" ) | grep -C5 "error"
184+
( run-clang-tidy-"${TIDY_LLVM_V}" -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" ) | grep -C5 "error"
185185
# Filter out files by regex here, because regex may not be
186186
# accepted in src/.bear-tidy-config
187187
# Filter out:

src/.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ modernize-use-default-member-init,
88
modernize-use-noexcept,
99
modernize-use-nullptr,
1010
performance-*,
11+
-performance-avoid-endl,
1112
-performance-inefficient-string-concatenation,
1213
-performance-no-int-to-ptr,
1314
-performance-noexcept-move-constructor,

0 commit comments

Comments
 (0)