Open loomdoom opened 2 weeks ago
Hi @loomdoom,
sorry for the delayed answer.
Looking into your scaner.log:
17:46:16.430 INFO Scanner configuration file: /redactedpath/scripts/sonar-scanner-6.0.0.4432-macosx/conf/sonar-scanner.properties
17:46:16.437 INFO Project root configuration file: /redactedpath/projects/sonar-cxx/integration-tests/testdata/json_db_project/sonar-project.properties
17:46:16.468 INFO SonarScanner CLI 6.0.0.4432
17:46:16.475 INFO Java 17.0.11 Eclipse Adoptium (64-bit)
17:46:16.476 INFO Mac OS X 14.1 x86_64
17:46:17.320 DEBUG Work directory: /redactedpath/projects/sonar-cxx/integration-tests/testdata/json_db_project/.scannerwork
17:46:17.520 DEBUG Community 9.9.6.92038
17:46:17.990 DEBUG Plugins:
17:46:17.990 DEBUG * C++ (Community) 2.1.1.488 (cxx)
17:46:18.706 INFO Project key: json_db_project
17:46:18.706 INFO Base dir: /redactedpath/projects/sonar-cxx/integration-tests/testdata/json_db_project
17:46:18.706 INFO Working dir: /redactedpath/projects/sonar-cxx/integration-tests/testdata/json_db_project/.scannerwork
17:46:18.848 DEBUG Creating module hierarchy
17:46:18.848 DEBUG Init module 'json_db_project'
17:46:18.848 DEBUG Base dir: /redactedpath/projects/sonar-cxx/integration-tests/testdata/json_db_project
17:46:18.848 DEBUG Working dir: /redactedpath/projects/sonar-cxx/integration-tests/testdata/json_db_project/.scannerwork
17:46:18.874 DEBUG Available languages:
17:46:18.875 DEBUG * CXX => "cxx"
17:46:19.923 DEBUG Declared extensions of language CXX were converted to sonar.lang.patterns.cxx : **/*.cxx,**/*.cpp,**/*.cc,**/*.c,**/*.hxx,**/*.hpp,**/*.hh,**/*.h
17:46:19.942 INFO Indexing files...
17:46:19.942 INFO Project configuration:
17:46:19.958 DEBUG 'src/file4.cc' indexed with language 'cxx'
17:46:19.965 DEBUG 'src/file5.cc' indexed with language 'cxx'
17:46:19.969 DEBUG 'src/file1.cc' indexed with language 'cxx'
17:46:19.970 DEBUG 'src/file6.cc' indexed with language 'cxx'
17:46:19.974 DEBUG 'src/file2.cc' indexed with language 'cxx'
17:46:19.981 DEBUG 'src/file3.cc' indexed with language 'cxx'
17:46:19.985 INFO 6 files indexed
17:46:21.433 INFO ------------- Run sensors on project
17:46:21.527 INFO Sensor CXX [cxx]
17:46:21.551 DEBUG Parsing 'JSON Compilation Database' format
17:46:21.791 INFO Analyze only files contained in 'JSON Compilation Database': 0 files
17:46:21.791 ERROR No files are analyzed, check the settings of 'sonar.projectBaseDir' and 'sonar.cxx.jsonCompilationDatabase'.
17:46:21.794 INFO Sensor CXX [cxx] (done) | time=267ms
There is no match for Analyze only files contained in 'JSON Compilation Database': 0 files
. That means the files/paths in the compilation database does not match. The corresponding code is here:
https://github.com/SonarOpenCommunity/sonar-cxx/blob/398033454fca8749927a9f6bc14a22e77de4b828/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/CxxSquidSensor.java#L410
As in all reports the hints here are valid: https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Troubleshooting-Reports#file-path-issues
Regards,
Describe the bug Trying to run analysis using compile_commands.json. Tested with testdata from: https://github.com/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/json_db_project/
To Reproduce Steps to reproduce the behavior:
and:
Expected behavior expect to analyze files specified in compile_commands.json
Desktop :
sonar-project.properties - just modified to run with docker
scaner.log