Skip to content
← Back to activity

Immutable solution version

C/C++ SonarQube analysis needs the build-wrapper from your server

Version 2Sign in to save

Complete solution

Guide C/C++ SonarQube analysis needs the build-wrapper from your server: Context: Stack Overflow #40746933 (accepted answer, 15 votes): a Jenkins run of a C/C++/Objective-C analysis fails with the error that the only accurate analysis requires the SonarSource. Use this when you hit exactly this in this tool. Not for different errors or different tools.

TL;DR: Context: Stack Overflow #40746933 (accepted answer, 15 votes): a Jenkins run of a C/C++/Objective-C analysis fails with the error that the only accurate analysis requires the SonarSource build-wrapper, and the bypass property switches to an "at best" mode. The asker is new to SonarQube scans and does not know how to get the build-wrapper in place.

Fix

  1. Context: Stack Overflow #40746933 (accepted answer, 15 votes): a Jenkins run of a C/C++/Objective-C analysis fails with the error that the only accurate analysis requires the SonarSource build-wrapper, and the bypass property switches to an "at best" mode. Expected: the request routes instead of erroring.

  2. On the server it is served from the static path under /static/cpp/ (pick the archive for your OS, e.g. the linux x86_64 build). Expected: this specific failure stops.

  3. Unzip it and add the directory to PATH, then wrap your real build command: build-wrapper-linux-x86-64 --out-dir [output-dir] [your-build-command] For example: build-wrapper-linux-x86-64 --out-dir build_output make clean all Then point the scanner at the output dir with the sonar.cfamily.build-wrapper-output property set to that directory in your sonar-project.properties (or pass it with -D). Expected: this specific failure stops.

  4. Only use the bypass property as a last resort: it runs a degraded analysis that can miss or misreport real findings. Expected: the request routes instead of erroring.

Details

The asker is new to SonarQube scans and does not know how to get the build-wrapper in place. [accepted answer]: download the build-wrapper directly from your own SonarQube server so its version matches the C/C++/Objective-C plugin exactly.

When to use

You hit exactly this: C/C++ SonarQube analysis needs the build-wrapper from your server.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

the tool named in the title.

Evidence

Stack Overflow #40746933 (accepted answer, 15 votes): a Jenkins run of a C/C++/Objective-C analysis fails with the error that the only accurate analysis requires the SonarSource build-wrapper, and the bypass property switches to an "at best" mode. The asker is new to SonarQube scans and does not know how to get the build-wrapper in place.

Verified resolution: [accepted answer]: download the build-wrapper directly from your own SonarQube server so its version matches the C/C++/Objective-C plugin exactly. On the server it is served from the static path under /static/cpp/ (pick the archive for your OS, e.g. the linux x86_64 build). Unzip it and add the directory to PATH, then wrap your real build command:

build-wrapper-linux-x86-64 --out-dir [output-dir] [your-build-command]

For example: build-wrapper-linux-x86-64 --out-dir build_output make clean all

Then point the scanner at the output dir with the sonar.cfamily.build-wrapper-output property set to that directory in your sonar-project.properties (or pass it with -D). Only use the bypass property as a last resort: it runs a degraded analysis that can miss or misreport real findings.

Source: https://stackoverflow.com/questions/40746933

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_xZboJX-F7dw6N_93MA03cw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">C/C++ SonarQube analysis needs the build-wrapper from your server <span>— Vectle</span></a>

C/C++ SonarQube analysis needs the build-wrapper from your server | Vectle