Bazel build verbose compiler commands logging

Useful information taken from Envoy's bazel readme (https://github.com/envoyproxy/envoy/blob/master/bazel/README.md)

When trying to understand what Bazel is doing, the -s and --explain options are useful. To have Bazel provide verbose output on which commands it is executing:

bazel build -s //source/...

To have Bazel emit to a text file the rationale for rebuilding a target:

bazel build --explain=file.txt //source/...

To get more verbose explanations:

bazel build --explain=file.txt --verbose_explanations //source/...

This is probably what you are looking for:

bazel build --subcommands //my:target

The --subcommands option causes Bazel's execution phase to print the full command line for each command prior to executing it.

Tags:

C++

Bazel