emzeat / linter-cache Goto Github PK
View Code? Open in Web Editor NEWWrapper to accelerate linters like clang-tidy via ccache
License: Apache License 2.0
Wrapper to accelerate linters like clang-tidy via ccache
License: Apache License 2.0
$ cmake --version
cmake version 3.25.1
$ ninja --version
1.11.1
$ cd /tmp
$ git clone https://github.com/emzeat/linter-cache
$ cd linter-cache
$ mkdir -p build/release
$ cd build/release
$ cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -S ../.. -B .
Expected
Pre-build step succeeds.
Actual
-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:26 (include):
include could not find requested file:
build/global.cmake
CMake Error at CMakeLists.txt:27 (include):
include could not find requested file:
build/macros.cmake
CMake Error at CMakeLists.txt:28 (include):
include could not find requested file:
build/conan.cmake
CMake Error at CMakeLists.txt:29 (include):
include could not find requested file:
build/linting.cmake
-- Looking for popen
-- Looking for popen - found
-- Looking for _popen
-- Looking for _popen - not found
-- Looking for close
-- Looking for close - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for getpid
-- Looking for getpid - found
-- Looking for unlink
-- Looking for unlink - found
-- Looking for execvp
-- Looking for execvp - found
-- Looking for SYS_pidfd_open
-- Looking for SYS_pidfd_open - found
-- Looking for kevent
-- Looking for kevent - not found
-- Looking for stat
-- Looking for stat - found
-- Looking for getenv
-- Looking for getenv - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for SetEnvironmentVariableA
-- Looking for SetEnvironmentVariableA - not found
-- Looking for GetEnvironmentVariableA
-- Looking for GetEnvironmentVariableA - not found
-- Looking for GetCurrentProcessId
-- Looking for GetCurrentProcessId - not found
-- Looking for GetTempFileNameA
-- Looking for GetTempFileNameA - not found
-- Looking for DeleteFileA
-- Looking for DeleteFileA - not found
-- Looking for GetFileAttributesA
-- Looking for GetFileAttributesA - not found
-- Looking for GetFullPathNameA
-- Looking for GetFullPathNameA - not found
-- Looking for CreateProcessA
-- Looking for CreateProcessA - not found
CMake Error at CMakeLists.txt:110 (mz_target_props):
Unknown CMake command "mz_target_props".
-- Configuring incomplete, errors occurred!
See also "/tmp/linter-cache/build/release/CMakeFiles/CMakeOutput.log".
See also "/tmp/linter-cache/build/release/CMakeFiles/CMakeError.log".
The commandline passed to ccache seems to be interpreted the wrong way as ccache is not handling MSVC specific options the correct way. Might need to stop hardcoding the CCACHE_COMPILERTYPE=clang
and possibly also use clang-cl
on some platforms.
In addition it would be great to provide flexibility for overriding this from the outside.
The tests only seem to cover C++, will this also work for plain C?
Even in quiet mode clang-tidy
will produce a note on warnings:
8988 warnings generated.
Would be great if this could be supressed when running through the cache.
Trying to build the Conan package with g++-9 I get:
.../build/58d5bc4ae2d10f3f07aaff0d425586521cc46062/src/CommandlineArguments.cpp:117:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
117 | for (int i = 1; i < argc; ++i) {
| ~~^~~~~~
.../build/58d5bc4ae2d10f3f07aaff0d425586521cc46062/src/CommandlineArguments.cpp:133:41: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
133 | } else if (arg == "-p" && i + 1 < argc) {
| ~~~~~~^~~~~~
.../build/58d5bc4ae2d10f3f07aaff0d425586521cc46062/src/CommandlineArguments.cpp:144:41: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
144 | } else if (arg == "-o" && i + 1 < argc) {
| ~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
CMake will generate paths with backslashes when using the builtin compiler+clang-tidy launcher via the CXX_CLANG_TIDY. These get somehow truncated when passed through linter-cache
causing builds to fail on Windows.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.