# Build-wrapper relative/absolute path problem

**URL:** <https://community.sonarsource.com/t/build-wrapper-relative-absolute-path-problem/50244>\
**Category:** SonarQube Server / Community Build\
**Tags:** build-wrapper, sonarqube, cfamily\
**Created:** [September 23, 2021, 10:25am UTC](https://community.sonarsource.com/t/build-wrapper-relative-absolute-path-problem/50244 "2021-09-23T10:25:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ovidijus](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@Ovidijus](https://community.sonarsource.com/u/Ovidijus)\
**Post date:** [September 23, 2021, 10:25am UTC](https://community.sonarsource.com/t/build-wrapper-relative-absolute-path-problem/50244/1 "2021-09-23T10:25:34Z")

</div>

Hello,

In this ticket [build-wrapper problem](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-but-0-c-c-objective-c-files-were-analyzed-objc-application/30921) it was mentioned that “The build-wrapper.json contains the absolute directories of the files that are built by the command passed to the build-wrapper”

- Problem: we can’t use build-wrapper.json absolute paths, we need to have relative paths to the files we have built.

- What we want to do: SonarQube scan is being run during GitLab CI build stage, here we generate build-wrapper.json artifact. After build stage we will perform unit tests stage. Finally, we want to receive the build-wrapper.json artifact from build stage and perform SonarQube analysis stage.

- Why is this a problem: each GitLab CI stage will runs by different GitLab runner, they exist in several different machines. Each of them have different paths in the server, therefore the analysis stage won’t be performed because it can’t find the paths.

- My question: how could we generate file list, so it could be analyzed by different runner in a different location?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [September 23, 2021, 6:12pm UTC](https://community.sonarsource.com/t/build-wrapper-relative-absolute-path-problem/50244/2 "2021-09-23T18:12:49Z")

</div>

Hi,

Welcome to the community!

> [@Ovidijus](#):
>
> how could we generate file list, so it could be analyzed by different runner in a different location

You just can’t. However, there is another option:

> **[Compilation database: An alternative way to configure your C or C++ analysis](https://www.sonarsource.com/blog/alternative-way-to-configure-c-and-cpp-analysis/)**
>
> Analyzing your C or C++ code requires, in addition to the source code, the configuration that is used to build the code. Historically we have provided a tool to automate the extraction of this information, called the build wrapper. Recently we...

&nbsp;  
HTH,  
Ann

---

<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:** [October 5, 2021, 11:22am UTC](https://community.sonarsource.com/t/build-wrapper-relative-absolute-path-problem/50244/3 "2021-10-05T11:22:28Z")

</div>

Closed on October 5, 2021, 11:22am UTC

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