which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube version: Data Center Edition Version 8.9.6 (build 50800)
Sonar Scanner version: sonar-scanner-cli-4.7.0.2747-windows
what are you trying to achieve
We are trying to perform sonarqube scan for source code with build-wrapper-win-x86
what have you tried so far to achieve this
In project folder, build wrapper can be run successfully:
build-wrapper-win-x86-64.exe --out-dir bw-output make clean
sonar-scanner.bat can be run successfully:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
But When I go to dashbodard of sonarqube, no issues found;
go to the menu “code”, no folder/C source code found except 2 folders in project. it seems it did not scan C source code.
It seems pretty logical that only the EverestMMI.X folder is being analyzed.
INFO: Base dir: C:\microchip\harmony\v2_06\apps\AdvHMI\firmware\EverestMMI.X
To start analyzing anything outside of this folder, you’d need to make sure you start the scan from the directory you want recursively analyzed (starting sonar-scanner from the firmware folder, for example).
This is also assuming that everything inside the firmware folder is being build (and wrapped by the build wrapper). You won’t be able to analyze C/C++ code outside of the EverestMMI.X folder unless it’s also being built.
When I ran sonar scan in the firmware folder including source code:
C:\microchip\harmony\v2_06\apps\AdvHMI\firmware
(build wrapper was run under folder C:\microchip\harmony\v2_06\apps\AdvHMI\firmware\EverestMMI.X)
sonar scan fails, please kindly help to look into it:
attached the log of sonar scan and bw-output files. scan.txt (18.9 KB) build-wrapper-dump.json (518 Bytes) build-wrapper.log (1.1 KB)
I tried to run build wrapper in folder C:\microchip\harmony\v2_06\apps\AdvHMI\firmware and failed, it maybe the root cause.
I’ll try to re-run build wrapper in folder C:\microchip\harmony\v2_06\apps\AdvHMI\firmware\EverestMMI.X
Hi Colin,
I re-ran the build wrapper and sonar scan, it fails. Attache complete log for your check.
thank you. scan.txt (347.2 KB) build-wrapper-dump.json (4.0 MB)
It looks like you’ve ran the build wrapper from the EverestMMI.X directory (and specified that the output should go into the bw-output folder in the EverestMMI.X directory), but then you’ve gone back one directory, ran the sonar-scanner, and specified sonar.cfamily.build-wrapper-output=bw-output even though the actual output is back in the EverestMMI.X directory.