Trouble with arm-eabi-none-gcc

scanner

(Alex Pabouctsidis) #1

I’m trying to setup sonarcloud for our project and build environment.

Our code runs on a STM32 microcontroller and is built using the ARM GCC toolchain (https://developer.arm.com/open-source/gnu-toolchain/gnu-rm).

Our project is managed by eclipse CDT with a special add-on for the ARM MCU. Eclipse CDT automatically generates the makes file, and we can build them via the cmd prompt in windows.

I followed the steps and installed the Scanner and Build wrapper for windows, and can build the project using the command:

"build-wrapper-win-x86-64.exe --out-dir bw-output make clean all’

Followed by:

“sonar-scanner.bat -Dsonar.projectKey=FFRM -Dsonar.organization=flyability -Dsonar.sources=. -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=xxxxxxxxxx”

The build runs properly, but the analysis comes up empty on sonarcloud.

I’m guessing that there is an issue with detecting the compiler version, etc. Any help would be much appreciated.

Here are some of the log files, as well as the eclipse generated makefile:


(Fabrice Bellingard) #2

Could you also add the scanner logs inside the “Log Files” folder?


(Alex Pabouctsidis) #3

I cant find any generated scanner logs. Here is the console output for the scanner cmd though:


INFO: Scanner configuration file: C:\Users\alexp\Desktop\sonar-scanner-3.2.0.1227-windows\bin…\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.2.0.1227
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\alexp.sonar\cache
INFO: SonarQube server 7.4.0
INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=175ms
INFO: Server id: BD367519-AWHW8ct9-T_TB3XqouNu
INFO: User cache: C:\Users\alexp.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=48ms
INFO: Load/download plugins (done) | time=124ms
INFO: Loaded core extensions: branch-scanner
INFO: Process project properties
INFO: Load project branches
INFO: Load project branches (done) | time=22ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=20ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=3ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=60ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=39ms
INFO: Load active rules
INFO: Load active rules (done) | time=926ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=28ms
INFO: Project key: FFRM
INFO: Project base dir: C:\Users\alexp\git\frank_firmware\Frank_Avionics\Release_SonarCloud
INFO: Organization key: flyability
INFO: ------------- Scan FFRM
INFO: Base dir: C:\Users\alexp\git\frank_firmware\Frank_Avionics\Release_SonarCloud
INFO: Working dir: C:\Users\alexp\git\frank_firmware\Frank_Avionics\Release_SonarCloud.scannerwork
INFO: Source paths: .
INFO: Source encoding: windows-1252, default locale: en_US
INFO: Load server rules
INFO: Load server rules (done) | time=233ms
WARN: Property ‘sonar.abap.file.suffixes’ is not declared as multi-values/property set but was read using ‘getStringArray’ method. The SonarQube plugin declaring this property should be updated.
INFO: Index files
INFO: 401 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=4ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=16ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=6ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=41ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading UCFGs from: C:\Users\alexp\git\frank_firmware\Frank_Avionics\Release_SonarCloud.scannerwork\ucfg2\java
INFO: UCFGs: 0, excluded: 0, source entrypoints: 0
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading UCFGs from: C:\Users\alexp\git\frank_firmware\Frank_Avionics\Release_SonarCloud\ucfg_cs2
INFO: UCFGs: 0, excluded: 0, source entrypoints: 0
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=1ms
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 223ms, dir size=59 KB
INFO: Analysis reports compressed in 16ms, zip size=17 KB
INFO: Analysis report uploaded in 30ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/dashboard?id=FFRM
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AWbA2S4LpAwoMVoOEmle
INFO: Task total time: 4.268 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.877s
INFO: Final Memory: 35M/446M
INFO: ------------------------------------------------------------------------


(Alex Pabouctsidis) #4

I also did another test with a MinGW project, using Eclipse CDT and have the same issue. Build runs correctly, but the analysis comes up empty.

Hopefully this extra information will help.


(Fabrice Bellingard) #5

In the logs that you provided, I don’t see the execution of the C/C++ analyzer. Are you running the sonar-scanner command at the root of your source code?

Note: if you add -Dsonar.verbose=true, then you will see exactly which files are considered as part of the anlaysis.


(Alex Pabouctsidis) #6

Thanks, that fixed part of the issue.

Running this command from the root folder, partially works.

sonar-scanner.bat -Dsonar.projectKey=FFRM -Dsonar.organization=flyability -Dsonar.sources=. -Dsonar.cfamily.build-wrapper-output=Release_SonarCloud\bw-output -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=9eaae4694b5922871f62f16cb4443e23c0f18d77

The files found in the root folder are parsed and analyzed and shown on sonarcloud.io.

The issue now is that some of the code folders are linked for elsewhere in the filesystem and not found in the root folder. Is there a way to specify these external folders.

Additionally, would it be possible to exclude certain folders, as some contain many 3rd part libraries which we don’t analyzed.


(Fabrice Bellingard) #7

Files outside of the root folder can’t be part of the analysis scope. In your case, what are those files?

For the second question, please take a look at the way to set up inclusions or exclusions on your project.


(Alex Pabouctsidis) #8

We managed to get everything set up properly. Thanks for the help.