which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) SonarScanner 4.7.0.2747
GCC Version: 5.4.0
build-wrapper-linux-x86-64 version 6.41.1
how is SonarQube deployed: zip, Docker, Helm
Full package is deployed In local repo for testing
what are you trying to achieve
Trying to Scan C++ Project using “make”
build-wrapper-linux-x86-64 --out-dir bw-output make install
Getting the following error:
17:21:19.121 WARN:
"sonar.cfamily.cache.enabled" and "sonar.cfamily.cache.path" properties are deprecated.
Visit the documentation page for more information about analysis cache configuration
https://docs.sonarqube.org/9.9/analyzing-source-code/languages/c-family/
17:21:19.121 INFO: Cache is explicitly disabled: sonar.cfamily.cache.enabled=false
17:21:19.133 INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
17:21:19.133 INFO: SE: 0 out of 0
17:21:19.133 INFO: Z3 refutation rate: 0 out of 0
17:21:19.133 INFO: Subprocess(es) done in 12ms
17:21:19.134 INFO: 0 compilation units analyzed
17:21:19.165 INFO: ------------------------------------------------------------------------
17:21:19.165 INFO: EXECUTION FAILURE
17:21:19.165 INFO: ------------------------------------------------------------------------
17:21:19.166 INFO: Total time: 17.418s
17:21:19.256 INFO: Final Memory: 40M/320M
17:21:19.256 INFO: ------------------------------------------------------------------------
17:21:19.256 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
* you are using the latest version of the build-wrapper and the CFamily analyzer
Content of JSON file:
cat bw-output/build-wrapper-dump.json
# (C) SonarSource SA, 2014-2022, info@sonarsource.com
# All SONARSOURCE programs and content are copyright protected.
# SONARSOURCE and SONARQUBE are trademarks of SonarSource SA. All rights are expressly reserved.
#
# This file is designed exclusively for use with the SONARSOURCE C / C++ / Objective-C Plugin.
# It may not be used in connection with any other software.
# Any other use is prohibited by law and may be grounds for immediate termination of your License.
{
"version":"6.41.1",
"captures":[
cat bw-output/build-wrapper-dump.json
# (C) SonarSource SA, 2014-2022, info@sonarsource.com
# All SONARSOURCE programs and content are copyright protected.
# SONARSOURCE and SONARQUBE are trademarks of SonarSource SA. All rights are expressly reserved.
#
# This file is designed exclusively for use with the SONARSOURCE C / C++ / Objective-C Plugin.
# It may not be used in connection with any other software.
# Any other use is prohibited by law and may be grounds for immediate termination of your License.
{
"version":"6.41.1",
"captures":[
]}
I am building this locally not as part of the pipeline. I am having the same problem in Jenkins as well. What details do you need? Can you be more specific please?
From the log you shared I see that the compiler you are using is /apps/var/opt/123456/dev/orch/XENVBASE/gcc_gnu/X/5.4.0/bin/_g++. _g++ isn’t recognized as supported compiler name. Where does this name come from? is it possible to to rename it to g++ so that build-wrapper captures it and the JSON wouldn’t be empty?
Thats interesting. We are not referring to _g++ any where though. _g++ and g++ seems to be different binary but same version
bash-4.4$ md5sum /apps/var/opt/123456/dev/orch/xenv/gcc_gnu/X/5.4.0/bin**/_g++**
2181875e4d4f1098d0288d992c6504a3 /apps/var/opt/123456/dev/orch/xenv/gcc_gnu/X/5.4.0/bin/_g++
bash-4.4$ md5sum /apps/var/opt/123456/dev/orch/xenv/gcc_gnu/X/5.4.0/bin/**g++**
784ed42e745a0b62b7ae7164e3add2d6 /apps/var/opt/123456/dev/orch/xenv/gcc_gnu/X/5.4.0/bin/g++
bash-4.4$ vim PTM/bw-output/build-wrapper.log
bash-4.4$ /apps/var/opt/123456/dev/orch/xenv/gcc_gnu/X/5.4.0/bin/_g++ --version
_g++ (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-4.4$ /apps/var/opt/123456/dev/orch/xenv/gcc_gnu/X/5.4.0/bin/g++ --version
_g++ (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.