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

Configurable location of an analyzer #3898

Closed
bruntib opened this issue Apr 28, 2023 · 1 comment · May be fixed by #4041
Closed

Configurable location of an analyzer #3898

bruntib opened this issue Apr 28, 2023 · 1 comment · May be fixed by #4041
Assignees
Labels
analyzer 📈 Related to the analyze commands (analysis driver) config ⚙️ enhancement 🌟

Comments

@bruntib
Copy link
Contributor

bruntib commented Apr 28, 2023

Currently the Clang's location can be configured in config/package_layout.json. In some environments it's not possible to edit this file, because CodeChecker is installed to a read-only filesystem. It is not a good practice anyways to provide an analyzer's location in a config file. Configuration conventionally happens through environment variables, command line flags, etc.

Similar to CC and CXX environment variables of some build systems it should be possible in CodeChecker to configure analyzers' location.

A discussion about this issue can be found here: #3869.

@whisperity whisperity added enhancement 🌟 analyzer 📈 Related to the analyze commands (analysis driver) config ⚙️ labels Oct 19, 2023
@whisperity whisperity added this to the release 6.23.0 milestone Oct 19, 2023
Szelethus added a commit to Szelethus/codechecker that referenced this issue Oct 20, 2023
By default, we look for clang, clang-tidy, gcc, etc. These binaries (and
compilers in general) are notorious for having their version number in
the binary name, making it difficult to run clang++-16 instead of
clang++. Its not impossible, but really inconvenient, hence this patch.

We debated a few approaches to this (including a CodeChecker-wide option
called --analyzer-binary, that could havve been used like this:
  --analyzer-binary clangsa:/usr/bin/clang-16

We decided that since not all analyzers might have an executable binary
(like pylint), we shouldn't commit to this naming. We also decided that
this is a flag that should be implemented by individual analyzer
plugins.

The PR adds the 'executable' config to all currently supported
analyzers.

I also needed to make adjustments to `CodeChecker analyzers`, since the
new config must be visible, even if we couldn't get hold of an analyzer
binary that we support. The list of changes:
* Deprecate both `--all` and `--details`, because they were more
  confusing than useful
* We list all supported (not available) analyzers by default, but print
  a warning message when its not available.
* We used to query the version of each analyzer binary in a uniform way,
  but clang, cppcheck, gcc prints their version using different flags,
  and in different formats. I changed this to call the analyzer plugins'
  get_binary_version method (which I also implemented in this patch).

I don't like enlarging patches too much, but this is how the PR turned
out. Its honestly not my proudest work (you can only do so much in so
little time), but I think the interface is fine, even if the
implementation can use a little improvement.

Closes Ericsson#3898.
@dkrupp
Copy link
Member

dkrupp commented Nov 6, 2023

Fixed by #4057

@dkrupp dkrupp closed this as completed Nov 6, 2023
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) config ⚙️ enhancement 🌟
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants