ci, iwyu: Treat warnings as errors for specific targets

Currently, this applies only to the `bitcoin_clientversion` and
`bitcoin_crypto` targets.
This commit is contained in:
Hennadii Stepanov 2024-11-18 00:11:12 +00:00
parent 6df1a0ce23
commit d838f1bac6
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -170,6 +170,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
echo "^^^ ⚠️ Failure generated from clang-tidy"
false
fi
# Filter out:
# * qt qrc and moc generated files
jq 'map(select(.file | test("src/qt/qrc_.*\\.cpp$|/moc_.*\\.cpp$") | not))' "${BASE_BUILD_DIR}/compile_commands.json" > tmp.json
@ -180,6 +181,13 @@ if [ "${RUN_TIDY}" = "true" ]; then
-- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
-Xiwyu --max_line_length=160 \
2>&1 | tee /tmp/iwyu_ci.out
# TODO: Expand the following list to all targets.
TARGETS_WITH_FORCED_IWYU="bitcoin_clientversion bitcoin_crypto"
cd "${BASE_BUILD_DIR}"
bash -c "cmake -S ${BASE_ROOT_DIR} -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=\"include-what-you-use;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp;-Xiwyu;--error\""
bash -c "cmake --build . ${MAKEJOBS} --clean-first --target ${TARGETS_WITH_FORCED_IWYU}"
cd "${BASE_ROOT_DIR}/src"
python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out
git --no-pager diff