Search code examples
c++bazel

Bazel build verbose compiler commands logging


How can I increase the verbosity of the build process? Bazel seems to print compiler commands only if something goes wrong during the build.

I would like to see which compiler comands the cc_library rule fires, even if everything seems to be fine, to debug linking problems. I already tried various bazel command line parameters but nothing gives me the compiler commands :(


Solution

  • 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.