I don’t clean the build directory every time because then the builds take too long. Now, sometimes the build-wrapper-dump.json contains 0 cpp files, sometimes a few, sometimes many. My last build had more than 200 compiled cpp files and 3 ended up in build-wrapper-dump.json.
How can I debug this and what could be the problem?
Also, my assumption is that build-wrapper is not reading any Sonar config files, like sonar-project.properties, and is therefore independent of Sonar. In other words, the problem can be isolated to build-wrapper - correct?
If you think the full build is taking too long for you, there are a few options, none of which is as easy as doing the full build… Which one is best depends of your build system:
You can do a full build but then use a tool like ccache that will reuse previous build results to make this full build as fast as if it was incremental
If you can generate a compilation database without building your code, you can use this compilation database instead of the build wrapper as an input to the analysis
If you know that your build configuration is identical between two builds (same input files, build in the same folders, with the same options…), you can reuse the build-wrapper between builds. But you’re on your own to detect when that ceases to be true and you have to run a full build.
thank you! We were already using sccache, so I went with the compilation database (which I like much more than the build_wrapper approach) and so far it works without problems