Sonar analysis fails with cmake ninja build

@vijay_kumar_kuruba, From the .log, I can see that build-wrapper isn’t able to detect the last commands it stops just before:

  • export BUILD_TOP=/users/integ/jenkins/sdc-c6b-1/workspace/Accelerator_Sonar
  • BUILD_TOP=/users/integ/jenkins/sdc-c6b-1/workspace/Accelerator_Sonar
  • cd /users/integ/jenkins/sdc-c6b-1/workspace/Accelerator_Sonar
  • scl enable devtoolset-7 rh-python36 ‘echo “====Starting ninja====” && cd RelBuild-ninja && ninja && if [ $? == 0 ]; then echo “====Starting ninja dist ====”; ninja dist; fi’

how are you calling these commands? Is cmake executing postscript? what kind of script? would you mind sharing all these details?

As a quick workaround, you can just execute build-wrapper in your script on a lower level. instead of wrapping the cmake command, you can wrap the ninja command:
instead of

  • scl enable devtoolset-7 rh-python36 ‘echo “====Starting ninja====” && cd RelBuild-ninja && ninja && if [ $? == 0 ]; then echo “====Starting ninja dist ====”; ninja dist; fi’

  • scl enable devtoolset-7 rh-python36 ‘echo “====Starting ninja====” && cd RelBuild-ninja && build-wrapper-linux-x86-64 --out-dir build-wrapper-output ninja && if [ $? == 0 ]; then echo “====Starting ninja dist ====”; ninja dist; fi’