Hi, I’m using SonarCloud in via CircleCI workflow. My project is based on C++, here are the info:
- ALM used: GitHub
- CI system used: Circle CI
- Languages of the repository: C++
- Compiler: gcc and mpicc
- Error observed:
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
* you are using the latest version of the build-wrapper and the CFamily analyzer
* you are correctly invoking the scanner with correct configuration
* your compiler is supported
* you are wrapping your build correctly
* you are wrapping a full/clean build
* you are providing the path to the correct build-wrapper output directory
* you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:439)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:45)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:440)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:436)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:394)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Exited with code exit status 1
CircleCI received exit code 1
-
build-wrapper-dump.json
: build-wrapper-dump.json (62.1 KB) -
build-wrapper.log
: build-wrapper.log (120.2 KB) - Current root dir:
drwxrwxr-x 5 pruiz pruiz 4096 ene 14 20:10 ./
drwxrwxrwt 28 root root 57344 ene 14 20:23 ../
-rw-rw-r-- 1 pruiz pruiz 3292 ene 14 18:36 arbol.cpp
-rw-rw-r-- 1 pruiz pruiz 1376 ene 14 18:36 arbol.h
-rw-rw-r-- 1 pruiz pruiz 223968 ene 14 20:10 arbol.o
drwxrwxr-x 2 pruiz pruiz 4096 ene 14 20:10 build_wrapper_output_directory/
drwxrwxr-x 2 pruiz pruiz 4096 ene 14 20:09 .circleci/
-rw-rw-r-- 1 pruiz pruiz 605 ene 14 18:36 .deepsource.toml
drwxrwxr-x 8 pruiz pruiz 4096 ene 14 20:09 .git/
-rw-rw-r-- 1 pruiz pruiz 40 ene 14 18:38 .gitignore
-rw-rw-r-- 1 pruiz pruiz 1067 ene 14 18:36 LICENSE
-rw-rw-r-- 1 pruiz pruiz 3434 ene 14 18:36 main.cpp
-rw-rw-r-- 1 pruiz pruiz 180744 ene 14 20:10 main.o
-rw-rw-r-- 1 pruiz pruiz 309 ene 14 18:36 Makefile
-rwxrwxr-x 1 pruiz pruiz 214496 ene 14 20:10 mpiDisc*
-rw-rw-r-- 1 pruiz pruiz 7250 ene 14 18:36 raid.cpp
-rw-rw-r-- 1 pruiz pruiz 907 ene 14 18:36 raid.h
-rw-rw-r-- 1 pruiz pruiz 217728 ene 14 20:10 raid.o
-rw-rw-r-- 1 pruiz pruiz 82 ene 14 19:07 README.md
-rw-rw-r-- 1 pruiz pruiz 1563 ene 14 18:36 slave.cpp
-rw-rw-r-- 1 pruiz pruiz 539 ene 14 18:36 slave.h
-rw-rw-r-- 1 pruiz pruiz 193016 ene 14 20:10 slave.o
-rw-rw-r-- 1 pruiz pruiz 1432 ene 14 19:52 sonar-project.properties
-rw-rw-r-- 1 pruiz pruiz 22436 ene 14 18:36 terminal.cpp
-rw-rw-r-- 1 pruiz pruiz 2039 ene 14 18:36 terminal.h
-rw-rw-r-- 1 pruiz pruiz 250112 ene 14 20:10 terminal.o
- Current sonar-project.properties:
sonar.projectKey=Pitenager_Distributed_Systems
sonar.organization=pitenager
# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=Distributed_Systems
sonar.projectVersion=1.0
sonar.cfamily.build-wrapper-output=build_wrapper_output_directory
sonar.cfamily.threads=5
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
- Current .circleci/config.yml:
version: 2.1
jobs:
build:
docker:
- image: 'debian:stretch'
steps:
- checkout
- run:
name: Installing SUDO
command: 'apt-get update && apt-get install -y sudo'
- run:
name: Installing GCC
command: 'apt-get update && apt-get install -y gcc g++'
- run:
name: Installing MPI libraries
command: 'sudo apt-get install -y openmpi-bin openmpi-common openssh-client openssh-server libopenmpi2 libopenmpi-dev'
- run:
name: Installing Make
command: 'apt-get update && apt-get install -y make'
- run:
name: Installing other dependencies
command: 'apt-get update && apt-get install -y git curl openssh-server clang build-essential unzip tar gzip python3 python3-defusedxml python3-lxml libssl-dev libffi-dev ca-certificates && apt autoclean && apt autoremove && apt clean && rm -rf /var/lib/apt/lists/*'
- sonarcloud/scan
orbs:
sonarcloud: sonarsource/sonarcloud@1.0.2
workflows:
main:
jobs:
- build:
context: sonarcloud
- Makefile:
CXX=mpiCC
CXXFLAGS=-I.
EXEC=mpiDisc
OBJS=arbol.o main.o raid.o slave.o terminal.o
PROG=mpiDisc
all: $(OBJS)
$(CXX) $(OBJS) -o $(EXEC)
@echo "Compilation complete!"
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
@echo "Linking complete!"
clean:
rm -f *.o $(PROG)
@echo "Cleanup complete!"
How can I solve this issue ? I don’t understand the problem.
Thank you in advance !!