I’m having difficulties analysing a C++ project (not mine) which is using Bazel. The documentation on cfamily seems outdated(?) as the --batch command is deprecated and Bazel complains when I use --spawn_strategy=standalone --genrule_strategy=standalone
14:11:49.316 INFO: 0 compilation units analyzed
14:11:49.345 INFO: ------------------------------------------------------------------------
14:11:49.345 INFO: EXECUTION FAILURE
14:11:49.345 INFO: ------------------------------------------------------------------------
14:11:49.346 INFO: Total time: 22.017s
14:11:49.414 INFO: Final Memory: 22M/120M
14:11:49.415 INFO: ------------------------------------------------------------------------
14:11:49.415 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
* you are using the latest version of the build-wrapper and the SonarCFamily analyzer
* your compiler is supported
* you are wrapping your build correctly
* you are wrapping a full/clean build
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:247)
Are there any other details which is available for analysing a Bazel C++ project? or is there something which I am missing?
they are deprecated and at the same time they work and don’t affect the build. build-wrapper must be able to follow build processes, bazel by default runs on a daemon which is incompatible with build-wrapper. It is required to use those options in order to be able to collect bazel build information.
I’m using bazel 1.2.1 and get the following error when running the command:
/workspace# bazel clean
Starting local Bazel server and connecting to it...
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
/workspace# build-wrapper-linux-x86-64 --out-dir sonar-dir bazel --batch --spawn_strategy=standalone --genrule_strategy=standalone build //...
[FATAL 10:57:52.091 src/main/cpp/blaze.cc:1286] Unknown startup option: '--spawn_strategy=standalone'.
For more info, run 'bazel help startup_options'.