You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If clang is not found in PATH anywhere at all, the analyze and check commands fail to go because they try to always read a Clang version.
CodeChecker version
(Note that even running something as simple and completely orthogonal as a package version check wants to access Clang!!!)
╰─ ~/CodeChecker/build/CodeChecker/bin/CodeChecker version
CodeChecker analyzer version:
[WARNING 2021-01-13 17:56] - 'clang' binary can not be found in your PATH!
---------------------------------------------------------------
Kind | Version
---------------------------------------------------------------
Base package version | 6.16.0
Package build date | 2021-01-13T17:50
Git commit ID (hash) | 9d23b7ba6d4c149a6fabf21579f08fc60ef4df1d
Git tag information | 6.16
---------------------------------------------------------------
CodeChecker web version:
------------------------------------------------------------------------
Kind | Version
------------------------------------------------------------------------
Base package version | 6.16.0
Package build date | 2021-01-13T17:50
Git commit ID (hash) | 9d23b7ba6d4c149a6fabf21579f08fc60ef4df1d
Git tag information | 6.16
Server supported API (Thrift) | 6.37
Client API (Thrift) | 6.37
------------------------------------------------------------------------
To Reproduce
Steps to reproduce the behaviour:
Download and build CodeChecker.
Install clang-tidy from the package manager, or have a binary release of Clang-Tidy, or compile it locally. Either way, do not have clang in the PATH, only clang-tidy.
Try to run an check --analyzers clang-tidy ... or analyze --analyzers clang-tidy.
Observe error:
╰─ which clang
clang not found
╰─ which clang-tidy
~/LLVM/Build/bin/clang-tidy
╰─ ~/CodeChecker/build/CodeChecker/bin/CodeChecker check -l compile_commands.json --analyzers clang-tidy
'clang' binary can not be found in your PATH!
'clang' binary can not be found in your PATH!
[WARNING 2021-01-13 17:56] - 'clang' binary can not be found in your PATH!
[ERROR 2021-01-13 17:56] - Running check failed.
Traceback (most recent call last):
File "~/CodeChecker/build/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/check.py", line 819, in main
analysis_exit_status = analyze_module.main(analyze_args)
File "~/CodeChecker/build/CodeChecker/lib/python3/codechecker_analyzer/cmd/analyze.py", line 937, in main
analyzer_env)
File "~/CodeChecker/build/CodeChecker/lib/python3/codechecker_analyzer/analyzers/clangsa/version.py", line 73, in get
errors="ignore")
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 423, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1278, in _execute_child
executable = os.fsencode(executable)
File "/usr/lib/python3.6/os.py", line 800, in fsencode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
File "~/CodeChecker/build/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/check.py", line 819, in main
analysis_exit_status = analyze_module.main(analyze_args)
File "~/CodeChecker/build/CodeChecker/lib/python3/codechecker_analyzer/cmd/analyze.py", line 937, in main
analyzer_env)
File "~/CodeChecker/build/CodeChecker/lib/python3/codechecker_analyzer/analyzers/clangsa/version.py", line 73, in get
errors="ignore")
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 423, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1278, in _execute_child
executable = os.fsencode(executable)
File "/usr/lib/python3.6/os.py", line 800, in fsencode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
File "~/CodeChecker/build/CodeChecker/cc_bin/CodeChecker.py", line 141, in main
sys.exit(args.func(args))
File "~/CodeChecker/build/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/check.py", line 850, in main
return analysis_exit_status
UnboundLocalError: local variable 'analysis_exit_status' referenced before assignment
Expected behaviour
CodeChecker acknowledges the fact that Clang does not exist on the system and goes on with only running Clang-Tidy.
Desktop (please complete the following information)
OS: Ubuntu 18.04.5 LTS
Additional context
This issue, together with #2670 makes it really hard to use CodeChecker for actively testing Tidy (and Tidy-only) contributions. I do not wish to have Clang SA built on the system because it's a lot of effort to always rebuild features that are not being used.
does not solve the issue. The 'clang' binary can not be found in your PATH! prints (both the non-WARING and the [WARNING] ones) go away, but the three exception traces (and the fact that no analysis is run) remains the same.
Describe the bug
If
clang
is not found inPATH
anywhere at all, theanalyze
andcheck
commands fail to go because they try to always read a Clang version.CodeChecker version
(Note that even running something as simple and completely orthogonal as a package version check wants to access Clang!!!)
To Reproduce
Steps to reproduce the behaviour:
clang-tidy
from the package manager, or have a binary release of Clang-Tidy, or compile it locally. Either way, do not haveclang
in thePATH
, onlyclang-tidy
.check --analyzers clang-tidy ...
oranalyze --analyzers clang-tidy
.Expected behaviour
CodeChecker acknowledges the fact that Clang does not exist on the system and goes on with only running Clang-Tidy.
Desktop (please complete the following information)
Additional context
This issue, together with #2670 makes it really hard to use CodeChecker for actively testing Tidy (and Tidy-only) contributions. I do not wish to have Clang SA built on the system because it's a lot of effort to always rebuild features that are not being used.
The culprit in the source code is here:
codechecker/analyzer/codechecker_analyzer/cmd/analyze.py
Lines 933 to 937 in 9d23b7b
The text was updated successfully, but these errors were encountered: