Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is compilation database JSON file searched when a source file is given as analysis input when running CodeChecker analyze? #4194

Open
w3ntao opened this issue Mar 19, 2024 · 1 comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) question ❔

Comments

@w3ntao
Copy link

w3ntao commented Mar 19, 2024

It is said in the document Analyzer User Guide#analyze that:

In case a source file or a project directory is given as analysis input, the process still relies on the compilation database JSON file, because CodeChecker tries to find it implicitly.

But how exactly is compilation database JSON file found (implicitly)?

@bruntib
Copy link
Contributor

bruntib commented Mar 20, 2024

CodeChecker is traversing parent directories of a source file up to the root directory. If any of those contains a file named compile_commands.json, then that will be used for the analysis of the given source file. Therefore, the documentation suggests placing the compile_commands.json in the analyzed project's directory.

@whisperity whisperity added question ❔ analyzer 📈 Related to the analyze commands (analysis driver) labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) question ❔
Projects
None yet
Development

No branches or pull requests

3 participants