Page MenuHomePhabricator

[CI] Update the clang-tidy build
ClosedPublic

Authored by Fabien on Sep 23 2020, 11:59.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC7626847ab713: [CI] Update the clang-tidy build
Summary

The current build is relying on the clang-tidy-diff.py script to detect
issues from the current revision diff. This has the advantage to run
fast, since the check is only applied to the changed files and lines,
but it can fail [
https://build.bitcoinabc.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=62036&guest=1#footer
](under some circumstances).

Due to the limited information from the diff, clang-tidy has to guess
the files language, which it does primarly by looking at the extension.
This method can fail for header files with a .h extension: if there is
not enough context to determine if the file is a C or C++ header
clang-tidy will default to C which is likely to fail on our codebase: in
the example above a C++ header (mutex) is included but this header
doesn't exist in C, and clang-tidy fails.

This diff removes this class of errors by running clang-tidy as part of
the cmake build. It achieves the same goal at the expense of an
increased run time on CI.

Depends on D7536, D7537, D7538.

Test Plan
./contrib/teamcity/build-configurations.py build-clang-tidy

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ci_clang_tidy_build
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12883
Build 25833: Build Diffbuild-without-wallet · build-diff · build-clang-tidy · build-clang-10
Build 25832: arc lint + arc unit