Skip to content

Commit f0ac248

Browse files
committed
Merge bitcoin#31928: ci: Fix filtering out Qt-generated files from compile_commands.json
d82dc10 ci: Fix filtering out Qt generated files from `compile_commands.json` (Hennadii Stepanov) Pull request description: This PR: 1. Adjusts the regex for Qt-generated files to match the CMake build directory structure. 2. Moves the filtering command to run before `clang-tidy`, ensuring that Qt-generated files are not needlessly processed. Fixes bitcoin#31801. ACKs for top commit: maflcko: ACK d82dc10 🚂 Tree-SHA512: 12ff40ffb134c56d848976e73aef7a8f895b856992b37b09ce27a1dcf6adef2cf148ba7e7d32b52ce1866c9bbeb165f9b6e6106c6c23b774d00d61bf379e13c9
2 parents 44bd315 + d82dc10 commit f0ac248

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ci/test/03_test_script.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,18 @@ if [ "${RUN_TIDY}" = "true" ]; then
164164
cmake --build /tidy-build --target bitcoin-tidy-tests "$MAKEJOBS"
165165

166166
set -eo pipefail
167+
# Filter out:
168+
# * qt qrc and moc generated files
169+
jq 'map(select(.file | test("src/qt/.*_autogen/.*\\.cpp$") | not))' "${BASE_BUILD_DIR}/compile_commands.json" > tmp.json
170+
mv tmp.json "${BASE_BUILD_DIR}/compile_commands.json"
171+
167172
cd "${BASE_BUILD_DIR}/src/"
168173
if ! ( run-clang-tidy-"${TIDY_LLVM_V}" -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then
169174
grep -C5 "error: " tmp.tidy-out.txt
170175
echo "^^^ ⚠️ Failure generated from clang-tidy"
171176
false
172177
fi
173-
# Filter out:
174-
# * qt qrc and moc generated files
175-
jq 'map(select(.file | test("src/qt/qrc_.*\\.cpp$|/moc_.*\\.cpp$") | not))' "${BASE_BUILD_DIR}/compile_commands.json" > tmp.json
176-
mv tmp.json "${BASE_BUILD_DIR}/compile_commands.json"
178+
177179
cd "${BASE_ROOT_DIR}"
178180
python3 "/include-what-you-use/iwyu_tool.py" \
179181
-p "${BASE_BUILD_DIR}" "${MAKEJOBS}" \

0 commit comments

Comments
 (0)