See cached baseline compilation warnings

Bazel displays all compilation warnings during clean compilation (java).

But - when we restart the assembly of basels, we lose all warnings.

Is there any flag that would display the original warnings for cached purposes?

Repo example: https://github.com/or-shachar/bazel-sample-repo/tree/warning (branch warning)

First start:

✗ bazel build //...
INFO: Found 1 target...
INFO: From Building src/main/java/com/example/libmy_warning_lib.jar (1 source file):
src/main/java/com/example/MyLib.java:12: warning: [static] static variable should be qualified by type name, MyLib, instead of by an expression
      this.x = this.x + 2.1;
          ^
src/main/java/com/example/MyLib.java:12: warning: [static] static variable should be qualified by type name, MyLib, instead of by an expression
      this.x = this.x + 2.1;
                   ^
Target //src/main/java/com/example:my_warning_lib up-to-date:
  bazel-bin/src/main/java/com/example/libmy_warning_lib.jar
INFO: Elapsed time: 3.286s, Critical Path: 1.03s

Next run:

 bazel build //...
INFO: Found 1 target...
Target //src/main/java/com/example:my_warning_lib up-to-date:
  bazel-bin/src/main/java/com/example/libmy_warning_lib.jar
INFO: Elapsed time: 0.244s, Critical Path: 0.01s

As you can see, we lose warnings when caching. If it is not available by some flag, it could be added as a function.

+6
source share

All Articles