Based on what I’ve learned in Adding SonarQube to a C++ build on Jenkins I tried setting up SonarQube for a different repo. The build wrapper (which I’m downloading from the SonarCloud server) works fine and generates a build-wrapper-dump.json file. sonar-scanner finds the source files and seems to be parsing them, I see debug output like:
09:58:28 20:58:27.876 DEBUG: 'src/depth-service/DepthService.cpp' generated metadata with charset 'UTF-8'
but then it crashes:
09:58:28 20:58:28.021 INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
09:58:28 20:58:28.021 INFO: SE: 0 out of 0
09:58:28 20:58:28.021 INFO: Subprocess(es) done in 143ms
09:58:28 20:58:28.021 INFO: 0 compilation units analyzed
09:58:28 20:58:28.035 INFO: ------------------------------------------------------------------------
09:58:28 20:58:28.035 INFO: EXECUTION FAILURE
09:58:28 20:58:28.035 INFO: ------------------------------------------------------------------------
09:58:28 20:58:28.035 INFO: Total time: 5:12.032s
09:58:28 20:58:28.110 INFO: Final Memory: 119M/512M
09:58:28 20:58:28.110 INFO: ------------------------------------------------------------------------
09:58:28 20:58:28.110 ERROR: Error during SonarScanner execution
09:58:28 java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
09:58:28 * you are using the latest version of the build-wrapper and the CFamily analyzer
09:58:28 * you are correctly invoking the scanner with correct configuration
09:58:28 * your compiler is supported
09:58:28 * you are wrapping your build correctly
09:58:28 * you are wrapping a full/clean build
09:58:28 * you are providing the path to the correct build-wrapper output directory
09:58:28 * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
09:58:28 at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:451)
09:58:28 at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:175)
09:58:28 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
09:58:28 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
09:58:28 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
09:58:28 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
09:58:28 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
09:58:28 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
09:58:28 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
09:58:28 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
09:58:28 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
09:58:28 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
09:58:28 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
09:58:28 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
09:58:28 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
09:58:28 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
09:58:28 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
09:58:28 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
09:58:28 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
09:58:28 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:58:28 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
09:58:28 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
09:58:28 at java.base/java.lang.reflect.Method.invoke(Unknown Source)
09:58:28 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
09:58:28 at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
09:58:28 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
09:58:28 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
09:58:28 at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
09:58:28 at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
09:58:28 at org.sonarsource.scanner.cli.Main.main(Main.java:62)
I’ve checked all the points mentioned and I think we’re good - this is a CI build on Jenkins so it’s definitely clean and using the same source code. This works for the other repo so I know the compiler’s good. I’m using the latest version of the build wrapper and scanner so it’s not an old bug.
What else can I do?