How to setup build wrapper in Linux

build-wrapper-linux-x86-64 --out-dir /home/jenkins/workspace/build_wrapper_output_directory;cd Product;./build.sh --clean

Note: cd product <<directory
note : ./build.sh --clean <<shell script file for build the c++code.

logs file of output build wraper directory .

[root@demu1-eft-jb02t Release_eGreen_2.1.5_Linux_Build]# cd build_wrapper_output_directory/
[root@demu1-eft-jb02t build_wrapper_output_directory]# ls
build-wrapper-dump.json build-wrapper.log
[root@demu1-eft-jb02t build_wrapper_output_directory]# cat 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.38",
"captures":[
]}

-----------------build-wrapper.log------------------------------------------------------

Fri Jan 06 07:29:02 2023: build-wrapper, version 6.38 (linux-x86)
Fri Jan 06 07:29:02 2023: System name: Linux Nodename: demu1-eft-jb02t Release: 3.10.0-1160.76.1.el7.x86_64 Version: #1 SMP Wed Aug 10 16:21:17 UTC 2022 Machine: x86_64
Fri Jan 06 07:29:02 2023: socket path: /tmp/build-wrapper-socket.4cc9e9
Fri Jan 06 07:29:02 2023: dynamic library found: /opt/build-wrapper-linux-x86/libinterceptor-i686.so
Fri Jan 06 07:29:02 2023: dynamic library found: /opt/build-wrapper-linux-x86/libinterceptor-x86_64.so
Fri Jan 06 07:29:02 2023: dynamic library found: /opt/build-wrapper-linux-x86/libinterceptor-haswell.so
Fri Jan 06 07:29:02 2023: cwd: </home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build>
Fri Jan 06 07:29:02 2023: command executed as: <build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory>
Fri Jan 06 07:29:02 2023: out-dir absolute path: </home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build/build_wrapper_output_directory>
Fri Jan 06 07:29:02 2023: command line received: <make clean all>
Fri Jan 06 07:29:02 2023: env 0: <MANPATH=/opt/rh/llvm-toolset-7/root/usr/share/man:/opt/rh/devtoolset-8/root/usr/share/man:>
Fri Jan 06 07:29:02 2023: env 1: <XDG_SESSION_ID=2587>
Fri Jan 06 07:29:02 2023: env 2: <HOSTNAME=demu1-eft-jb02t>
Fri Jan 06 07:29:02 2023: env 3: <TERM=xterm>
Fri Jan 06 07:29:02 2023: env 4: <SHELL=/bin/bash>
Fri Jan 06 07:29:02 2023: env 5: <BASE_PATH=/home/jenkins/workspace>
Fri Jan 06 07:29:02 2023: env 6: <HISTSIZE=1000>
Fri Jan 06 07:29:02 2023: env 7: <SSH_CLIENT=10.13.172.130 59325 22>
Fri Jan 06 07:29:02 2023: env 8: <PERL5LIB=/opt/rh/devtoolset-8/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-8/root/usr/lib/perl5:/opt/rh/devtoolset-8/root//usr/share/perl5/vendor_perl>
Fri Jan 06 07:29:02 2023: env 9: <X_SCLS=llvm-toolset-7 devtoolset-8 >
Fri Jan 06 07:29:02 2023: env 10: <SSH_TTY=/dev/pts/1>
Fri Jan 06 07:29:02 2023: env 11: <PCP_DIR=/opt/rh/devtoolset-8/root>
Fri Jan 06 07:29:02 2023: env 12: <USER=root>
Fri Jan 06 07:29:02 2023: env 13: <LD_LIBRARY_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/home/jenkins/workspace/renaissance-online-external-libs/boost_1_66_0/libx86-gcc-7.3.1:/home/jenkins/workspace/renaissance-online-external-libs/linux/x86:/home/jenkins/workspace/renaissance-online-external-libs/mysqlClient>
Fri Jan 06 07:29:02 2023: env 14: <LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:>
Fri Jan 06 07:29:02 2023: env 15: <TMOUT=900>
Fri Jan 06 07:29:02 2023: env 16: <MAIL=/var/spool/mail/root>
Fri Jan 06 07:29:02 2023: env 17: <PATH=/opt/rh/llvm-toolset-7/root/usr/bin:/opt/rh/llvm-toolset-7/root/usr/sbin:/opt/rh/devtoolset-8/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib/oracle/instantclient_19_3:/root/bin:/opt/build-wrapper-linux-x86:/opt/sonar-scanner-4.7.0.2747-linux/bin>
Fri Jan 06 07:29:02 2023: env 18: <PWD=/home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build>
Fri Jan 06 07:29:02 2023: env 19: <LANG=en_US.UTF-8>
Fri Jan 06 07:29:02 2023: env 20: <HISTCONTROL=ignoredups>
Fri Jan 06 07:29:02 2023: env 21: <SHLVL=1>
Fri Jan 06 07:29:02 2023: env 22: <HOME=/root>
Fri Jan 06 07:29:02 2023: env 23: <PYTHONPATH=/opt/rh/llvm-toolset-7/root/usr/lib/python2.7/site-packages:/opt/rh/devtoolset-8/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-8/root/usr/lib/python2.7/site-packages>
Fri Jan 06 07:29:02 2023: env 24: <LOGNAME=root>
Fri Jan 06 07:29:02 2023: env 25: <CVS_RSH=ssh>
Fri Jan 06 07:29:02 2023: env 26: <SSH_CONNECTION=10.13.172.130 59325 10.25.45.38 22>
Fri Jan 06 07:29:02 2023: env 27: <PKG_CONFIG_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/pkgconfig:/opt/rh/devtoolset-8/root/usr/lib64/pkgconfig>
Fri Jan 06 07:29:02 2023: env 28: <LESSOPEN=||/usr/bin/lesspipe.sh %s>
Fri Jan 06 07:29:02 2023: env 29: <INFOPATH=/opt/rh/devtoolset-8/root/usr/share/info>
Fri Jan 06 07:29:02 2023: env 30: <CMAKE_PREFIX_PATH=/usr/share/Qt5/5.12.7/gcc_64>
Fri Jan 06 07:29:02 2023: env 31: <XDG_RUNTIME_DIR=/run/user/0>
Fri Jan 06 07:29:02 2023: env 32: <DISPLAY=localhost:10.0>
Fri Jan 06 07:29:02 2023: env 33: <OLDPWD=/home/jenkins/workspace>
Fri Jan 06 07:29:02 2023: env 34: <_=/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64>
Fri Jan 06 07:29:02 2023: executing: <make clean all>
Fri Jan 06 07:29:02 2023: initializing json file
Fri Jan 06 07:29:02 2023: process created with pid: 16477
Fri Jan 06 07:29:02 2023: parent pid: 16476
Fri Jan 06 07:29:02 2023: working directory: </home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build>
Fri Jan 06 07:29:02 2023: executable: </opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64>
Fri Jan 06 07:29:02 2023: argv[0]: <build-wrapper-linux-x86-64>
Fri Jan 06 07:29:02 2023: argv[1]: <-c>
Fri Jan 06 07:29:02 2023: argv[2]: <>
Fri Jan 06 07:29:02 2023: argv[3]: <make>
Fri Jan 06 07:29:02 2023: argv[4]: <clean>
Fri Jan 06 07:29:02 2023: argv[5]: <all>
Fri Jan 06 07:29:02 2023: skipping process with pid: 16477
Fri Jan 06 07:29:02 2023: process created with pid: 16478
Fri Jan 06 07:29:02 2023: parent pid: 16477
Fri Jan 06 07:29:02 2023: working directory: </home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build>
Fri Jan 06 07:29:02 2023: executable: </opt/rh/devtoolset-8/root/usr/bin/make>
Fri Jan 06 07:29:02 2023: argv[0]: <make>
Fri Jan 06 07:29:02 2023: argv[1]: <clean>
Fri Jan 06 07:29:02 2023: argv[2]: <all>
Fri Jan 06 07:29:02 2023: skipping process with pid: 16478
Fri Jan 06 07:29:02 2023: finalizing json file
Fri Jan 06 07:29:02 2023: returned with code: 2

--------------------------------------------sonar scanner logs-----------

INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor JavaScript analysis [javascript] (done) | time=6559ms
INFO: Sensor TypeScript analysis [javascript]
INFO: No input files found for analysis
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor TypeScript analysis [javascript] (done) | time=4ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=3ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=6ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=8ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=4ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=4ms
INFO: Sensor CFamily [cpp]
INFO: CFamily plugin version: 6.40.0.60596
INFO: Using build-wrapper output: /home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build/build_wrapper_output_directory/build-wrapper-dump.json
INFO: Available processors: 4
INFO: Using 4 threads for analysis.
WARN: Ignoring property sonar.cfamily.cache.path=/home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build/sonarcache
INFO: Found empty cache on server
WARN:
File
  /home/jenkins/workspace/Release_eGreen_2.1.5_Linux_Build/build_wrapper_output_directory/build-wrapper-dump.json
was generated using build-wrapper version 6.38,
which does not match the analyzer version 6.40.0.60596.

Please download the matching version from the server
  https://sonarqube.oneeuronet.com/static/cpp/build-wrapper-linux-x86.zip

INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
INFO: SE: 0 out of 0
INFO: Z3 refutation rate: 0 out of 0
INFO: Subprocess(es) done in 21ms
INFO: 0/2132 files marked as unchanged
INFO: Cache: 0/0 hits, 125 bytes
INFO: 0 compilation units analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 4:26.702s
INFO: Final Memory: 80M/270M
INFO: ------------------------------------------------------------------------
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
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build

sonar scaner version <4.7.0.2747
Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Linux 3.10.0-1160.76.1.el7.x86_64 amd64
build-wrapper, version 6.38 (linux-x86)

I have download latest build-wrapper in the below link.
wget https:/sonarqube.xxxx.com//static/cpp/build-wrapper-linux-x86.zip

PLEASE SUGESST ME THE SOULTION .

Hey @sankar927

It would be easier if you could keep everything on one thread – but since this thread has the most details, I suggest you stick to this one and allow the other to close.

Based on your build-wrapper.log file, it looks like your make command is returning with a non-zero exit code.

Are you able to locally run a compilation of your code without the build-wrapper at all, and have it succeed?

yes successes if you required logs then i will put in here.

The more information you share, the more likely somebody can be helpful!

Please share the suggestion of the solution of linux setup .

Could you please post details on this issue, Would like to know how you resolved it on linux.