warningsbazel

Bazel: Make bazel warnings to be treated as errors


Is there any way of treating bazel warnings (or DEBUG logs) as errors when running bazel build?
Something similar to -Werror in cpp, but for Bazel itself.
For instance, when I run a build, I get a warning like:

WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/0d5f3f2768c6ca2faca0079a997a97ce22997a0c.zip failed: class java.io.IOException GET returned 403 Forbidden

I want to treat these warnings as errors in the CI server.


Solution

  • using the --warnings_as_errors flag