C++ Wrapper fails without error message in bitbake


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.

Any idea how to analyze this further?

Kind regards

Hi @MVoss,

you could try redirecting stdout and stderr to a file at the build-wrapper level and see if there is any useful message there.

Hi Massimo,

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(?)

Does it ring a bell to you?


Hi @MVoss,

not really.

Could you describe a bit better what you are trying to do?

You shouldn’t run something like build-wrapper --out-dir out docker ... this wouldn’t work. build-wrapper must be at the same OS level of compiler invocations.

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.


Hi @MVoss,

could you share the stdout, stderr logs plus the build-wrapper.log and build-wrapper-dump.json files?
I am sending you a PM where you can share those privately.


I am considering this thread as closed for now.


A post was split to a new topic: Issue with build-wrapper and bitbake

Any resolution for this topic was suggested, please let us know . As we are also seeing the same issue

Hey @Vinay_Suryanarayana

This is quite an old topic on a very old version of SonarQube. I would suggest creating a new topic and adding more details (version, exact issue faced, etc.)

I will close this topic.