Extra directories added to include path for CTU ast generation #3309
-
HI, I'm trying to get a reasonably large (~3000 source file) project working with codechecker in CTU mode. I've built the compile-commands.json using CMake's built-in support; and things are broadly working, however it appears some additional include paths are being added to the command-line which cause my build to fail (as it ends up picking up the wrong header files. Example of a failing command-line:
Note the prefixing of {
"directory": "/home/daver/repos/couchbase/server/build-codechecker",
"command": "/usr/bin/clang++-12 -DCB_DEVELOPMENT_ASSERTS -DCOUCHBASE_ENTERPRISE_EDITION=1 -DDESTINATION_ROOT=\\\"/home/daver/repos/couchbase/server/install-codechecker\\\" -DEP_USE_MAGMA=1 -DEP_USE_ROCKSDB=1 -DGLOG_NO_ABBREVIATED_SEVERITIES -DGOOGLE_GLOG_DLL_DECL=\"\" -DHAVE_BREAKPAD -DHAVE_JEMALLOC -DHAVE_JEMALLOC_SDALLOCX -DHAVE_LIBNUMA=1 -DLIBCOUCHSTORE_NO_VISIBILITY -DMEMCACHED_VERSION=\\\"1d90572086c2695e129f659901bc8656396b1073\\\" -DOBJECT_ROOT=\\\"/home/daver/repos/couchbase/server/build-codechecker/kv_engine\\\" -DPRODUCT_VERSION=\\\"0.0.0-0000\\\" -DSOURCE_ROOT=\\\"/home/daver/repos/couchbase/server/kv_engine\\\" -DSPDLOG_LEVEL_NAMES=\"{\\\"TRACE\\\", \\\"DEBUG\\\", \\\"INFO\\\", \\\"WARNING\\\", \\\"ERROR\\\", \\\"CRITICAL\\\", \\\"OFF\\\"}\" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS -D__EXTENSIONS__=1 -D__STDC_FORMAT_MACROS -Dgsl_CONFIG_CONTRACT_VIOLATION_THROWS -Itlm/deps/prometheus-cpp.exploded/include -Ikv_engine/engines/ep -Icouchstore/include -I../couchstore/include -I../kv_engine/include -I../kv_engine/tracing -I../kv_engine/utilities -I../kv_engine -I../platform/external -Itlm/deps/flatbuffers.exploded/include -Itlm/deps/snappy.exploded/include -Ikv_engine/engines/ep/src -I../kv_engine/engines/ep/src -I../kv_engine/engines/ep -I../install-codechecker/include -Ikv_engine/include -Iplatform/include -I../magma/include -I../kv_engine/engines/ep/tools/couchfile_upgrade -isystem ../third_party/HdrHistogram_c/src -isystem ../phosphor/include -isystem ../platform/include -isystem tlm/deps/boost.exploded/include -isystem tlm/deps/json.exploded/include -isystem ../third_party/gsl-lite/include -isystem ../third_party/spdlog/include -isystem ../third_party/googletest/googletest/include -isystem ../third_party/googletest/googlemock/include -isystem ../subjson -isystem tlm/deps/libevent.exploded/include -isystem tlm/deps/openssl.exploded/include -isystem tlm/deps/jemalloc.exploded/include -isystem tlm/deps/rocksdb.exploded/include -isystem tlm/deps/folly.exploded/include -isystem tlm/deps/double-conversion.exploded/include -isystem tlm/deps/glog.exploded/include -fvisibility=hidden -pthread -fcolor-diagnostics -Qunused-arguments -Wall -Wextra -Wno-unused-parameter -pedantic -fno-strict-aliasing -Werror=switch -Werror=redundant-decls -Werror=missing-braces -ftemplate-depth=900 -fsized-deallocation -Wno-unused-lambda-capture -Wno-gnu-zero-variadic-macro-arguments -O3 -DNDEBUG -g -fPIC -ftls-model=initial-exec -std=c++17 -o kv_engine/engines/ep/CMakeFiles/ep_objs.dir/src/dcp/producer.cc.o -c /home/daver/repos/couchbase/server/kv_engine/engines/ep/src/dcp/producer.cc",
"file": "/home/daver/repos/couchbase/server/kv_engine/engines/ep/src/dcp/producer.cc"
}```
This results in `boost/shared_ptr.hpp` being incorrectly picked up from `/usr/include`, when it should be found in the local header directory `/home/daver/repos/couchbase/server/build-codechecker/tlm/deps/boost.exploded/include`.
Could someone point me to where in CodeChecker these extra include paths are being added? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@daverigby Without ctu do you get any similar errors during analysis? |
Beta Was this translation helpful? Give feedback.
@daverigby Without ctu do you get any similar errors during analysis?