Microchip xc8 Compiler - 0 files analyzed

Overview

I see notes indicating that the xc8 compiler is supported, although it might not be supported on Linux. I can run it manually on Windows if needed, but I see the same error in both environments.

Is the xc8 compiler still supported? I know there are issues with the static vs dynamically linked compiler. It was indicated in those posts that the Windows variant should still work regardless.

Details

  • ALM: Bitbucket
  • CI: Butbucket Cloud
  • Language: C
  • Compiler: xc8-gcc (v2.41)
  • Host Environment: Tested in Linux CI and Windows manually with (seemingly) the same error as described below.

Steps to reproduce

  • Followed windows manual installation steps
  • make clean
  • Execute the compile wrapper as noted below, compilation in this case succeeds
  • Execute the sonar-scanner.bat command with the below error

Wrapped compile command

build-wrapper-win-x86-64.exe --out-dir bw_output make -f nbproject/Makefile-dragonfly.mk

(I know the example suggests bw-output. I swapped this in all relevant places, and it had no change)

Snippet of error

16:57:18.972 INFO  Scanner configuration file: C:\src\sonar-scanner-6.2.1.4610-windows-x64\bin\..\conf\sonar-scanner.properties
16:57:18.975 INFO  Project root configuration file: NONE
16:57:18.987 INFO  SonarScanner CLI 6.2.1.4610
16:57:18.989 INFO  Java 17.0.12 Eclipse Adoptium (64-bit)
16:57:18.990 INFO  Windows 10 10.0 amd64
16:57:19.006 INFO  User cache: XXXXXXXXXXX
16:57:19.408 INFO  JRE provisioning: os[windows], arch[amd64]
16:57:20.825 INFO  Communicating with SonarCloud
16:57:21.221 INFO  Starting SonarScanner Engine...
16:57:21.222 INFO  Java 17.0.11 Eclipse Adoptium (64-bit)
16:57:21.902 INFO  Load global settings
16:57:22.421 INFO  Load global settings (done) | time=520ms
16:57:22.427 INFO  Server id: XXXXXXXXXXX
16:57:22.536 INFO  Loading required plugins
16:57:22.537 INFO  Load plugins index
16:57:22.664 INFO  Load plugins index (done) | time=127ms
16:57:22.665 INFO  Load/download plugins
16:57:22.712 INFO  Load/download plugins (done) | time=47ms
16:57:23.077 INFO  Load project settings for component key: 'XXXXXXXXXXX'
16:57:23.208 INFO  Load project settings for component key: 'XXXXXXXXXXX' (done) | time=131ms
16:57:23.217 INFO  Process project properties
16:57:23.229 INFO  Project key: XXXXXXXXXXX
16:57:23.229 INFO  Base dir: C:\src\XXXXXXXXXXX
16:57:23.230 INFO  Working dir: C:\src\XXXXXXXXXXX
16:57:23.235 INFO  Load project branches
16:57:23.428 INFO  Load project branches (done) | time=193ms
16:57:23.429 INFO  Check ALM binding of project 'XXXXXXXXXXX'
16:57:23.550 INFO  Detected project binding: BOUND
16:57:23.551 INFO  Check ALM binding of project 'XXXXXXXXXXX' (done) | time=121ms
16:57:23.551 INFO  Load project pull requests
16:57:23.691 INFO  Load project pull requests (done) | time=140ms
16:57:23.692 INFO  Load branch configuration
16:57:23.695 INFO  Load branch configuration (done) | time=3ms
16:57:23.698 INFO  Load quality profiles
16:57:23.934 INFO  Load quality profiles (done) | time=236ms
16:57:23.937 INFO  Load active rules
16:57:30.834 INFO  Load active rules (done) | time=6897ms
16:57:31.016 INFO  Organization key: XXXXXXXXXXX
16:57:31.032 INFO  Preprocessing files...
16:57:31.711 INFO  3 languages detected in 49 preprocessed files
16:57:31.712 INFO  1 file ignored because of inclusion/exclusion patterns
16:57:31.712 INFO  622 files ignored because of scm ignore settings
16:57:32.095 INFO  Loading plugins for detected languages
16:57:32.096 INFO  Load/download plugins
16:57:32.099 INFO  Load/download plugins (done) | time=4ms
16:57:32.146 INFO  Load project repositories
16:57:32.286 INFO  Load project repositories (done) | time=140ms
16:57:32.287 INFO  Indexing files...
16:57:32.288 INFO  Project configuration:
16:57:32.289 INFO    Excluded sources: **/build-wrapper-dump.json
16:57:32.297 INFO  48 files indexed
16:57:32.301 INFO  Quality profile for c: Sonar way
16:57:32.302 INFO  Quality profile for xml: Sonar way
16:57:32.302 INFO  ------------- Run sensors on module XXXXXXXXXXX
16:57:32.340 INFO  Load metrics repository
16:57:32.457 INFO  Load metrics repository (done) | time=118ms
16:57:32.461 INFO  Sensor cache enabled
16:57:32.567 INFO  Load sensor cache
16:57:33.481 INFO  Load sensor cache (404) | time=915ms
16:57:33.744 INFO  Sensor XML Sensor [xml]
16:57:33.749 INFO  2 source files to be analyzed
16:57:34.259 INFO  2/2 source files have been analyzed
16:57:34.259 INFO  Sensor XML Sensor [xml] (done) | time=514ms
16:57:34.260 INFO  Sensor JaCoCo XML Report Importer [jacoco]
16:57:34.261 INFO  'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
16:57:34.264 INFO  No report imported, no coverage information will be imported by JaCoCo XML Report Importer
16:57:34.265 INFO  Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
16:57:34.266 INFO  Sensor Java Config Sensor [iac]
16:57:34.327 INFO  0 source files to be analyzed
16:57:34.327 INFO  0/0 source files have been analyzed
16:57:34.328 INFO  Sensor Java Config Sensor [iac] (done) | time=63ms
16:57:34.328 INFO  Sensor IaC Docker Sensor [iac]
16:57:34.529 INFO  0 source files to be analyzed
16:57:34.530 INFO  0/0 source files have been analyzed
16:57:34.531 INFO  Sensor IaC Docker Sensor [iac] (done) | time=202ms
16:57:34.531 INFO  Sensor EnterpriseTextAndSecretsSensor [textenterprise]
16:57:34.532 INFO  Available processors: 16
16:57:34.532 INFO  Using 16 threads for analysis.
16:57:34.991 INFO  The property "sonar.tests" is not set. To improve the analysis accuracy, we categorize a file as a test file if any of the following is true:
  * The filename starts with "test"
  * The filename contains "test." or "tests."
  * Any directory in the file path is named: "doc", "docs", "test" or "tests"
  * Any directory in the file path has a name ending in "test" or "tests"

16:57:35.331 INFO  Using git CLI to retrieve untracked files
16:57:35.533 INFO  Analyzing language associated files and files included via "sonar.text.inclusions" that are tracked by git
16:57:35.617 INFO  44 source files to be analyzed
16:57:36.119 INFO  44/44 source files have been analyzed
16:57:36.120 INFO  Sensor EnterpriseTextAndSecretsSensor [textenterprise] (done) | time=1590ms
16:57:36.120 INFO  Sensor CFamily [cpp]
16:57:36.172 INFO  CFamily plugin version: 6.61.0.77816 (51d0d4e42d4b40f57c947d955719020f0e963568)
16:57:36.173 INFO  CFamily analysis configuration mode: Compile-Commands
16:57:36.177 INFO  Using compile commands: C:\src\XXXXXXXXXXX\bw_output\compile_commands.json
16:57:36.178 INFO  Available processors: 16
16:57:36.182 INFO  Using 16 threads for analysis.
16:57:38.545 INFO  Found empty cache on server
16:57:39.060 INFO  Compilation database was generated by build-wrapper 6.61

<THIS IS REPEATED FOR ALL THE SOURCE>
16:22:59.058 WARN  Provided compiler is not compatible.
Invalid probe found, skip analysis of files: [C:/src/XXX.o.d, C:/src/XXX.o.d, C:/src/XXX.o, C:/src/XXX.c]
The compiler probe 'stdout' is expected to contain at least one'#define' directive:
<THIS IS REPEATED FOR ALL THE SOURCE>

16:22:59.061 INFO  Detected compilers: avr-gcc=59
16:22:59.062 INFO  Number of compilation units in the provided Compilation Database: 59
16:22:59.062 INFO  Number of skipped unsupported compilation units: 59
16:22:59.063 INFO  Number of skipped non-indexed compilation units: 0
16:22:59.063 INFO  Number of skipped duplicate compilation units: 0
16:22:59.064 INFO  Number of remaining compilation units to be analyzed: 0
16:22:59.064 INFO  Detected standards:
16:22:59.071 INFO  0/42 files marked as unchanged
16:22:59.072 INFO  Analysis cache: 0/0 hits, 126 bytes
16:22:59.234 ERROR Error during SonarScanner Engine execution
java.lang.IllegalStateException: The Compilation Database JSON file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
  * you are correctly invoking the scanner with correct configuration
  * your compiler is supported
  * you are providing the path to the correct Compilation Database JSON
  * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps

Any help is greatly appreciated!

-Pete

Hi @pmcgaugh ,

I sent you a private message to follow up on your issue.

Hi @pmcgaugh ,

I created a ticket for your issue: Jira

Great! I appreciate your support. I look forward to testing the fix once it is ready.

2 Likes