Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for static and dynamic analyzer tools.
https://codechecker.readthedocs.io
Apache License 2.0
2.28k stars 383 forks source link

Doesn't find Clang in Linux when using the Build.sh tool #2987

Open blasco opened 4 years ago

blasco commented 4 years ago

Describe the bug When I try the following command:

/home/blasco/Programs/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh -project=/home/blasco/Documents/Unreal/MyProject/MyProject.uproject -mode=GenerateClangDatabase UE4Game Linux Development

It fails with:

Fixing inconsistent case in filenames.
Setting up Mono
Building -project=/home/blasco/Documents/Unreal/MyProject/MyProject.uproject...
ERROR: Clang must be installed in order to build this target.

But Clang is installed, I was actually able to build the engine. Building the project from the engine also works, but I want to use the Build.sh tool to generate the compile_commands.json. Where is it looking for clang? Why doesn't find it?

clang --version
clang version 10.0.0-4ubuntu1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

clang++ --version
clang version 10.0.0-4ubuntu1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Desktop (please complete the following information)

gyorb commented 4 years ago

Hi,

I'm not sure how this error is related to CodeChecker. Where is the CodeChecker command executed? Can the Build.sh script generate a compile_command.json or you want to try to log the compiler calls with CodeChecker? In CodeChecker there is a log command which can be used to generate a compile_command.json file. Probably something like this could work:

CodeChecker log -o compile_command.json -b "/home/blasco/Programs/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh -project=/home/blasco/Documents/Unreal/MyProject/MyProject.uproject -mode=GenerateClangDatabase UE4Game Linux Development"

but I'm not familiar what the Build.sh script does.

gyorb commented 4 years ago

This issue is connected to #1971.