Closed LebedevRI closed 5 years ago
@LebedevRI What is your output of the following command:
CodeChecker analyzers --details
I think your problem will be the same as #2333. Is the clang-extdef-mapping
binary available in your clang install directory?
I think your problem will be the same as #2333. Is the
clang-extdef-mapping
binary available in your clang install directory?
Indeed that is the problem, as i wrote in the original comment:
But after following https://github.com/Ericsson/codechecker#configuring-clang-version and pointing those options at the
/usr/bin/clang-10
, it works. Sinceclang
is in the$PATH
, i.e. it can be executed without specifying the path said adjustment must not be necessary..
So the bug seems that if the clang
is a symlink, it looks for clang-extdef-mapping
only next to the symlink, but it does not try to dereference said symlink and look in that directory.
It will get the installed directory by parsing the output of the clang --version
command:
And it will try to find the clang-extdef-mapping
tool in this directory:
https://github.com/Ericsson/codechecker/blob/17d4645419142982d7789ecdc837eb3f1d0d9eaa/analyzer/codechecker_analyzer/analyzers/clangsa/clang_options.py#L75-L77
Interesting.
It will get the installed directory by parsing the output of the
clang --version
command:
Hm, it is weird that InstalledDir
in clang --version
isn't actually the install dir,
but only the location of the clang that was originally executed:
$ /usr/local/bin/clang --version
clang version 10.0.0-+20191117100609+a516fbac520-1~exp1~20191117211154.2877
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
$ ls -lah /usr/local/bin/clang
lrwxrwxrwx 1 root root 17 Jul 26 15:29 /usr/local/bin/clang -> /usr/bin/clang-10
$ /usr/bin/clang-10 --version
clang version 10.0.0-+20191117100609+a516fbac520-1~exp1~20191117211154.2877
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
@LebedevRI I created a pull request (#2430) that I think will solve your problem. Could you please check it and try it out?
The main idea that we will resolve symlinks of compiler binaries, so we will get --version
option of the right clang binary, so the installed directory will be correct.
Describe the bug
By default, CTU does not work:
But after following https://github.com/Ericsson/codechecker#configuring-clang-version and pointing those options at the
/usr/bin/clang-10
, it works. Sinceclang
is in the$PATH
, i.e. it can be executed without specifying the path said adjustment must not be necessary..CodeChecker version
Desktop (please complete the following information)