# Build-wrapper empty for c++ on linux

**URL:** <https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210>\
**Category:** SonarQube Server / Community Build\
**Tags:** build-wrapper, sonarqube, cfamily, scanner\
**Created:** [June 28, 2020, 4:26pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210 "2020-06-28T16:26:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![binie](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/binie/32/12919_2.png) [@binie](https://community.sonarsource.com/u/binie)\
**Post date:** [June 28, 2020, 4:26pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/1 "2020-06-28T16:26:40Z")

</div>

Hi,  
I have been struggling with this. I have the following versions

- build-wrapper-linux-x86 - build-wrapper, version 6.9 (linux-x86)
- Ubuntu 18.04
- sonarqube-developer-8.3.1.34397
- SonarScanner 4.3.0.2102
- Java 11.0.3 AdoptOpenJDK (64-bit)

I have run the following to compile, but still leaves build-wrapper-dump.json empty

\*\*build-wrapper-linux-x86-64 --out-dir /opt/builddir sudo ./autogen.sh \*\*

* * *

\*\* 161 mkdir build\*\*  
\*\* 162 cd build\*\*  
\*\* 163 build-wrapper-linux-x86-64 --out-dir /opt/builddir sudo …/configure\*\*  
\*\* 164 build-wrapper-linux-x86-64 --out-dir /opt/builddir sudo make clean all\*\*  
\*\* 165 build-wrapper-linux-x86-64 --out-dir /opt/builddir sudo make check\*\*

Excerpts from build-wrapper.log  
Sun Jun 28 16:59:44 2020: executable: \</opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64\>  
Sun Jun 28 16:59:44 2020: argv[0]:   
Sun Jun 28 16:59:44 2020: argv[1]: \<-c\>  
Sun Jun 28 16:59:44 2020: argv[2]: \<\>  
Sun Jun 28 16:59:44 2020: argv[3]:   
Sun Jun 28 16:59:44 2020: argv[4]:   
Sun Jun 28 16:59:44 2020: argv[5]:   
Sun Jun 28 16:59:44 2020: skipping process with pid: 24904  
Sun Jun 28 17:00:10 2020: finalizing json file  
Sun Jun 28 17:00:10 2020: returned with code: 2

I have checked settings, permissions. My trial license will expire soon and need to ensure I can get this working and desired results are achieved before we purchase.

---

<div class="post-metadata">

**Author:** ![Abbas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/abbas/32/5717_2.png) [@Abbas](https://community.sonarsource.com/u/Abbas)\
**Post date:** [June 29, 2020, 8:00am UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/2 "2020-06-29T08:00:40Z")

</div>

Hello @binie,  
First, you only have to call build-wrapper once with the build command instead of 3 times.  
Second, sudo shouldn’t be passed to build-wrapper.

So following the build commands that you provided it should be something like that:

> sudo ./autogen.sh  
> mkdir build  
> cd build  
> sudo `../configure`  
> sudo build-wrapper-linux-x86-64 --out-dir /opt/builddir make clean all  
> sudo make check

If this still fails please can you upload the full build-wrapper log file directly after executing these commands?

---

<div class="post-metadata">

**Author:** ![binie](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/binie/32/12919_2.png) [@binie](https://community.sonarsource.com/u/binie)\
**Post date:** [June 29, 2020, 12:17pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/3 "2020-06-29T12:17:11Z")

</div>

many thanks @Abbas. The build-wrapper file gets created but is still empty.

I do notice that one of the functional test fails when I do a make check. Will this affect data being written to build-wrapper. I am trying to get the developers to look at this.  
[build-wrapperlog.txt](https://community.sonarsource.com/uploads/short-url/gzXPMLtmg9UNVdhD8pLWrldURJl.txt) (4.6 KB)

in addition, the following command comes back with an unknown command -  
sudo build-wrapper-linux-x86-64 --out-dir /opt/builddir make clean all

I have to run it as  
build-wrapper-linux-x86-64 --out-dir /opt/builddir sudo make clean all

---

<div class="post-metadata">

**Author:** ![Abbas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/abbas/32/5717_2.png) [@Abbas](https://community.sonarsource.com/u/Abbas)\
**Post date:** [June 29, 2020, 6:03pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/6 "2020-06-29T18:03:22Z")

</div>

@binie,  
you cannot pass `sudo` to build-wrapper. Do you really need `sudo` to build your project?  
try `build-wrapper-linux-x86-64 --out-dir /opt/builddir make clean all`

---

<div class="post-metadata">

**Author:** ![binie](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/binie/32/12919_2.png) [@binie](https://community.sonarsource.com/u/binie)\
**Post date:** [June 29, 2020, 7:39pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/7 "2020-06-29T19:39:11Z")

</div>

😊 looks like that has fixed it. Thanks a lot. I have started the scan now; I’ll keep you updated. Many thanks for your help @Abbas

---

<div class="post-metadata">

**Author:** ![binie](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/binie/32/12919_2.png) [@binie](https://community.sonarsource.com/u/binie)\
**Post date:** [June 29, 2020, 8:13pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/8 "2020-06-29T20:13:33Z")

</div>

@Abbas Thanks for all your help; I was able to get this to scan same code on ubuntu 18.04 and 20.04. We’ll move on to the next phase of getting justification 👋🏽 💪🏽

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [July 6, 2020, 8:14pm UTC](https://community.sonarsource.com/t/build-wrapper-empty-for-c-on-linux/27210/9 "2020-07-06T20:14:28Z")

</div>

Closed on July 6, 2020, 8:14pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
