Buildwrapper gitlab integration

I am setting up a new stage in gitlab in order to perform a static analysis of a c++ project.

My CI has 5 stages:

  • build
  • unit_test
  • integration_test
  • deploy
  • scan

The CI has the value 4 for parallelism.
The stage scan runs on a different path from the build stage (where the build wrapper command is executed) invalidating the paths stored in the build-wrapper-dump.json file.

The scan ends with an error:
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analysed. Please make sure that:

How can I configure the CI so that the stage scan runs on the same build path?



Does this mean the analysis may be running on a different agent than the build ran on? They need to run on the same agent. Or at least, they need to have exactly the same file paths in both places. Ditto for your testing if you’re going to pass coverage reports into the analysis.

Also, why would you deploy before the scan/analysis? Don’t you want to be able to intervene if the quality of the changes isn’t good?


you might be running on different agents and therefore the paths might also be different.
Ok I set the CI to run the build, test execution and static analysis on the same agent.

The list of stages are not in order, obviously it doesn’t make sense to do the static analysis after deployment, also we are thinking of setting a blocking quality gate.

Thank you

1 Like