I have a problem with the SonarQube 7.7 Developer Editon C++ build wrapper version 6.3 (build-wrapper-linux-x86-64) when running in a Ubuntu 16.04 LTS Docker container a bitbake build.
I see strange instabilities on the wrapper build run after typically around 6 minutes buildtime.
It happens never at the same location/line in the build twice.
The Jenkins pipeline fails the build step without any error message from the build itself.
Also the wrapper logfile does not hold any error messages, it just stops somewhere in the build with these final 2 lines:
Tue Jun 18 04:20:33 2019: finalizing json file
Tue Jun 18 04:20:33 2019: returned with code: 1
I have suspected the parallel processing in bitbake to somehow mess up the wrapper interception and thus tried also with disabled parallel threads for bitbake and make compile steps, but it has not changed anything regarding this problem.
to do what you suggested I now executed the wrapper inside a running container (instead via a docker run command) and indeed see now an error message, at a reproducible build location:
‘’‘build-wrapper: getcwd: No such file or directory’’’
It seems that the wrapper tries to execute getcwd() on a folder that does no longer exist(?)
OK, I try to describe it better…
Originally I have called the wrapper like this:
‘’‘docker run MYIMAGE /home/bbuilder/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonarcube_output bitbake host2x’’’
When I do this, then I get these strange effects with no reproducibility as described initially.
Then I tried the logging as you have suggested.
But I cannot simply redirect stderr/stdout to files in the call above, because we want to capture the wrapper log, not the docker log.
Thus I run bash in the container interactive session now:
‘’‘docker run -ti MYIMAGE /bin/bash’’’
…and then call the wrapper this way from the bash commandline:
‘’’/home/bbuilder/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonarcube_output bitbake host2x (optionallly redirect logs to files)’’’
Now I see reproducible errors with getcwd() - independent from the logging redirection.