Dear Community,
My team is working on a C++ project using CMake and remote toolchain with Docker. I saw this was a problem in the past, but it looks resolved? [SLI-559] - Jira
I tried to find some tutorial how to configure, but no luck.
Our tech stack:
- Operating system: Windows 10
- IDE: CLion 2022.2.4
- SonarLint plugin version: 7.3.0.59206
- Programming language you’re coding in: C++
- Is connected mode used: yes
- Connected to SonarQube 9.8-developer
And a thorough description of the problem / question:
We don’t seem to be able to perform analysis, neither any linting works. Log:
Trigger: ACTION
[Action] 1 file(s) submitted
Configuring analysis with org.sonarlint.intellij.clion.CFamilyAnalysisConfigurator
Using connection 'XXX' for project 'iShuttle'
Analysing 'action_handler.cpp'...
Starting analysis with configuration:
[
projectKey: iShuttle
baseDir: C:\Users\XXX.XXX\Documents\sandbox\project
extraProperties: {sonar.cfamily.build-wrapper-content={"version":0,"captures":[{"compiler":"clang","cwd":"C:\\Users\\XXX.XXX\\Documents\\sandbox\\project\\build_gcc_debug\\lib\\modes","executable":"C:\\usr\\local\\bin\\g++","properties":{},"cmd":["C:\\usr\\local\\bin\\g++","C:/Users/XXX.XXX/Documents/sandbox/project/lib/modes/action_handler.cpp","-DSPDLOG_COMPILED_LIB","-DSPDLOG_FMT_EXTERNAL","-I/tmp/project/lib","-I/tmp/project/lib/modes/..","-I/tmp/project/lib/devices/status/..","-I/tmp/project/lib/utilities/..","-I/tmp/project/lib/devices/positioning/..","-I/tmp/project/lib/modes/modes/../..","-I/tmp/project/lib/modes/base_messages/../..","-isystem/home/ishuttle/.conan/data/spdlog/1.10.0/_/_/package/0ad8763f0289ded6e39ff258ec01c35b1aac6aa2/include","-isystem/home/ishuttle/.conan/data/fmt/8.1.1/_/_/package/0d8b943d676dc202f180a2598d04457e173d7b97/include","-isystem/home/ishuttle/.conan/data/nlohmann_json/3.10.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include","-isystem/home/ishuttle/.conan/data/json-schema-validator/2.1.0/_/_/package/5d15cb4e1c0e30811cbae274fbd7768540582e39/include","-isystem/home/ishuttle/.conan/data/paho-mqtt-cpp/1.2.0/_/_/package/d46323b77a7340224238be213657da620d082b78/include","-isystem/home/ishuttle/.conan/data/paho-mqtt-c/1.3.9/_/_/package/3b9495adc0029d7352d25243dd239ab4c096decf/include","-isystem/home/ishuttle/.conan/data/openssl/3.0.3/_/_/package/043c934abae6e21b32744bfd049e4ec71d629d9e/include","-isystem/home/ishuttle/.conan/data/zlib/1.2.12/_/_/package/d13c97721d7bdc192ca6529684f2b79beeae8a7c/include","-g","-Werror","-Wall","-Wextra","-Wshadow","-Wno-missing-field-initializers","-Wnon-virtual-dtor","-Wold-style-cast","-Wcast-align","-Wunused","-Woverloaded-virtual","-Wpedantic","-Wconversion","-Wsign-conversion","-Wno-null-dereference","-Wdouble-promotion","-Wformat=2","-Wmisleading-indentation","-pedantic","-pedantic-errors","-Wswitch-enum","-Wfatal-errors","-Wswitch-default","-std=c++20","-Wshift-overflow","-fstack-protector-all","-fstack-protector-strong","-fomit-frame-pointer","-pthread","-Wno-maybe-uninitialized","-g3","-O0","-fmax-errors=1","-Wformat-overflow=2","-Wshift-overflow=2","-Wformat-truncation=2","-Wduplicated-cond","-Wduplicated-branches","-Wlogical-op","-Wuseless-cast","-Wno-stringop-overflow","-std=c++20"]}]}}
moduleKey: Module: 'project'
inputFiles: [
file:///C:/Users/XXX.XXX/Documents/sandbox/project/lib/modes/action_handler.cpp (UTF-8) [cpp]
]
]
* cpp: 418 active rules
Rule cpp:S6069 is enabled on the server, but not available in SonarLint
Rule cpp:S2612 is enabled on the server, but not available in SonarLint
Rule cpp:S5042 is enabled on the server, but not available in SonarLint
Rule cpp:S4790 is enabled on the server, but not available in SonarLint
Rule cpp:S5527 is enabled on the server, but not available in SonarLint
Rule cpp:S5443 is enabled on the server, but not available in SonarLint
Rule cpp:S5332 is enabled on the server, but not available in SonarLint
Rule cpp:S2068 is enabled on the server, but not available in SonarLint
Rule cpp:S5813 is enabled on the server, but not available in SonarLint
Rule cpp:S5814 is enabled on the server, but not available in SonarLint
Rule cpp:S5815 is enabled on the server, but not available in SonarLint
Rule cpp:S5816 is enabled on the server, but not available in SonarLint
Rule cpp:S5824 is enabled on the server, but not available in SonarLint
Rule cpp:S4830 is enabled on the server, but not available in SonarLint
Rule cpp:S1313 is enabled on the server, but not available in SonarLint
Rule cpp:S5801 is enabled on the server, but not available in SonarLint
Rule cpp:S5802 is enabled on the server, but not available in SonarLint
Rule cpp:S5982 is enabled on the server, but not available in SonarLint
Rule cpp:S2245 is enabled on the server, but not available in SonarLint
Rule cpp:S5849 is enabled on the server, but not available in SonarLint
* c: 208 active rules
Rule c:S5801 is enabled on the server, but not available in SonarLint
Rule c:S5802 is enabled on the server, but not available in SonarLint
Rule c:S1313 is enabled on the server, but not available in SonarLint
Rule c:S4830 is enabled on the server, but not available in SonarLint
Rule c:S2612 is enabled on the server, but not available in SonarLint
Rule c:S5332 is enabled on the server, but not available in SonarLint
Rule c:S2068 is enabled on the server, but not available in SonarLint
Rule c:S5443 is enabled on the server, but not available in SonarLint
Rule c:S2245 is enabled on the server, but not available in SonarLint
Rule c:S5982 is enabled on the server, but not available in SonarLint
Rule c:S5527 is enabled on the server, but not available in SonarLint
Rule c:S6069 is enabled on the server, but not available in SonarLint
Rule c:S4790 is enabled on the server, but not available in SonarLint
Rule c:S5824 is enabled on the server, but not available in SonarLint
Rule c:S5816 is enabled on the server, but not available in SonarLint
Rule c:S5813 is enabled on the server, but not available in SonarLint
Rule c:S5814 is enabled on the server, but not available in SonarLint
Rule c:S5815 is enabled on the server, but not available in SonarLint
Rule c:S5849 is enabled on the server, but not available in SonarLint
Rule c:S5042 is enabled on the server, but not available in SonarLint
Start analysis
Index files
Language of file 'file:///C:/Users/XXX.XXX/Documents/sandbox/project/lib/modes/action_handler.cpp' is set to 'C++'
1 file indexed
Execute Sensor: CFamily
Probing compiler: [C:\usr\local\bin\g++, -x, c++, --std, c++20, -v, -dM, -E, -]
stdout:
stderr:
Invalid probe found, skip analysis of files: [C:/Users/XXX.XXX/Documents/sandbox/project/lib/modes/action_handler.cpp]
The compiler probe 'stdout' is expected to contain at least one '#define' directive:
Subprocess(es) done in 50ms
0 compilation units analyzed
Execute Sensor: Sonar Secrets Detection Sensor
Done in 67ms
Processed 0 issues
Found 0 issues
My assumption is - it cannot find our compilers through Docker toolchain? Is it not supported yet, we didn’t configure something right or we’re doing something wrong? What info did I miss?
Similar issues I’ve found here were related to SonarScanner and misconfiguration on the CLI / Wrapper side, but we just wanna use SonarLint here
For the context - we have a SonarScanner CLI with wrapper running in the CI environment (GitLab) with no issues.
Thanks in advance!
Paula