Contributor Author
I think make checkall doesn't work for your workflow because it didn't detect installed clang-tidy
Closed
Member
@TheJJ kevin needs clang-tidy to be installed
Contributor Author
@heinezen Thank you for the notice. I have updated it accordingly.
Member
@TheJJ Did you add clang-tidy already?
Member
@haytham918 Happy new year! I'm still waiting for @TheJJ to add clang-tidy to the CI machine.
Contributor Author
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:34 (project):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
Error: Process completed with exit code 1.
This is what I am seeing from the build output, not sure what exactly is going wrong with the configuration? I don't think I have ever modified the CMake files.
Member
Kevin is now able to run clang-tidy, but produces many errors.
The cause of this seems to be the invocation of clang-tidy, which must be integrated into the buildsystem (cmake), because only there the correct compiler invocations are available :)
Contributor Author
Now clang-tidy seems to be working and generating warnings?
Contributor
I think the compile command database needs to be added like this: https://stackoverflow.com/questions/63944447/how-to-specify-compilation-database-for-clang-tidy#71826250
-p ${CMAKE_BUILD_DIR}, also not -DCMAKE_EXPORT_COMPILE_COMMANDS=ON needs to be set to get the compile_commands.json if not already set.
-p <build-path> is used to read a compile command database. For example, it can be a CMake build directory in which a file named compile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON CMake option to get this output). When no build path is specified, a search for compile_commands.json will be attempted through all parent paths of the first input file . See: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an example of setting up Clang Tooling on a source tree.
Member
we have the compile command export already. but we need to make clang-tidy to use it, i.e. by integrating it in the buildsystem. it can't run without cmake running before it.
the warnings it currently generates are not helpful since they fail at things like unknown includes, but once it's integrated into the real compile environment, real output is generated :)
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to finally conclude the question of whether we include clang-tidy in the CI checks or how it should be integrated in the sanity check process, I added a compromise solution. Basically, there's now a new make command checkmerge which tests the same stuff as before and is now also used by kevin. checkall still tests everything, including clang-tidy, but is not used for CI checks. I hope that makes everybody happy :D