Ericsson / CodecheckerVSCodePlugin

VSCode plugin that shows bugs detected by the Clang Static Analyzer and Clang Tidy analyzers using CodeChecker as a backend.
Apache License 2.0
24 stars 7 forks source link

Can't Recognize codechecker installed by snap #103

Closed f1yby closed 2 years ago

f1yby commented 2 years ago

codechecker installed by snap is named 'codechecker', but 'CodeChecker' install by pip3. Although config in Executable Path is set to ‘codechecker'

Console Output In vscode

>>> Starting process 'CodeChecker analyzer-version'
> codechecker analyzer-version --output json
>>> Process 'CodeChecker analyzer-version' exited with code 120
>>> CodeChecker error while checking version

In shell

❯ codechecker analyzer-version --output json
{"base_package_version": "6.19.0", "package_build_date": "2022-03-11T12:05", "git_commit": null, "git_tag": null}
❯ echo "$?"
0
csordasmarton commented 2 years ago

@LWSG I was able to reproduce this problem with the following code and CodeChecker installed via snap:

const child_process = require('child_process');

child_process
  .spawn('codechecker', ['analyzer-version', '--output', 'json'])
  .on("exit", (code) => {
    console.log("Exit code:", code);
  });

Output:

$ node test.js 
Exit code: 120

@Discookie Do you have any idea what is the problem here? I saw that in #104 you are using snap package to run test cases. How is it possible that it works for you?

Discookie commented 2 years ago

From a quick search I could only find code 120 as a reference to https://bugs.python.org/issue29130 related to calling flush() in Python - looks to be a CodeChecker issue? Not sure, will need to test further

csordasmarton commented 2 years ago

@Discookie I think this is related to snap package instead of python interpreter. I tried the follwing scenarios:

I think the problem will be related to this: https://forum.snapcraft.io/t/node-snap-issues-with-exec-of-npm-node-yarn/23635

@LWSG Did you installed your vscode editor by using snap package manager? What is the output of this command: snap list code

f1yby commented 2 years ago

Yes, my vscode is installed by snap

//snap list code
Name  Version   Rev  Tracking       Publisher  Notes
code  c722ca6c  91   latest/stable  vscode*    classic
f1yby commented 2 years ago

The problem is similar to the issue, but 'codechecker' instead of 'npm', should I close the Issue?

vodorok commented 2 years ago

Then the issue is with npm, therefore closing this one. Please reopen if needed.