codechecker icon indicating copy to clipboard operation
codechecker copied to clipboard

CodeChecker analyze skip does not work if the file location is relative in the compilation db

Open dkrupp opened this issue 1 year ago • 0 comments

When the --file parameter is referred with an absolute path, but the compilation database contains the file as a relative path to the directory member e.g. tests/FLP37-C-A.c in this example the file is not recognized.

Reproduction: Compilation db:

[{
		"directory": "/workspace/sei_cert_test_suite/cpp",
		"command": "/usr/bin/gcc -Itests -c tests/FLP37-C-A.c -o obj/FLP37-C-A.o",
		"file": "tests/FLP37-C-A.c"
}]
CodeChecker analyze --output /local/workspace/sei_cert_test_suite/.codechecker/reports /local/workspace/sei_cert_test_suite/cpp/compile_commands.json --file /local/workspace/sei_cert_test_suite/cpp/tests/FLP37-C-A.c --analyzers clang-tidy clangsa -e cert
[INFO 2024-04-17 14:31] - No analysis is required.
There were no compilation commands in the provided compilation database or all of them were skipped.
>>> Process 'CodeChecker analyze' exited with code 0

dkrupp avatar Apr 17 '24 13:04 dkrupp