Skip to content

completion failure handling with incomplete classpaths #827

Closed

Description

@davido

//CC @eamonnmcmanus

This is a follow up for bazelbuild/bazel#4108. The root cause seems to be related to auto-value annotation processor, as Error Prone error is reported in generated file, and if I just use the generated file and add it to the sources set of the failing rule, and take auto-value annotation processor out of the picture (by removing compiler plugin), then all is fine.

Clone this reproducer on Windows, (it took me hours to isolate this reproducer from gerrit code review and gwtorm library) on most recent Bazel@master (1ea72aa77af17b413538f66521193c3d1b7657ad):

$ git clone https://github.com/davido/bazel-annotation-processor-breakage
Klone nach 'bazel-annotation-processor-breakage' ...
remote: Counting objects: 25, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 25 (delta 0), reused 25 (delta 0), pack-reused 0
Entpacke Objekte: 100% (25/25), Fertig.

And try to build this rule:

$ bazel build java/com/google/gerrit/server/diff
.
Loading:
Loading: 0 packages loaded
Analyzing: target //java/com/google/gerrit/server/diff:diff (4 packages loaded)
Analyzing: target //java/com/google/gerrit/server/diff:diff (4 packages loaded)
INFO: Analysed target //java/com/google/gerrit/server/diff:diff (11 packages loaded).
INFO: Found 1 target...
[0 / 11] BazelWorkspaceStatusAction stable-status.txt
[6 / 11] no action
[7 / 11] Building java/com/google/gwtorm/libclient.jar (4 source files); 0s worker ... (3 actions)
ERROR: C:/users/davido/projects/bazel-annotation-processor-breakage/java/com/google/gerrit/server/diff/BUILD:1:1: Building java/com/google/gerrit/server/diff/libdiff.jar (1 source file) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor) failed (Exit 1)
bazel-out\x64_windows-fastbuild\bin\java\com\google\gerrit\server\diff\_javac\diff\libdiff_sourcegenfiles\com\google\gerrit\server\diff\AutoValue_IntraLineDiffArgs.java:51: error: method equals in class NameKey cannot be applied to given types;
      return (this.project.equals(that.project()))
                          ^
  required: Object
  found: NameKey
  reason: argument mismatch; NameKey cannot be converted to Object
Target //java/com/google/gerrit/server/diff:diff failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 37,029s, Critical Path: 2,15s
FAILED: Build did NOT complete successfully

Trying to do the same on Linux:

$ bazel build java/com/google/gerrit/server/diff -s
..........
INFO: Analysed target //java/com/google/gerrit/server/diff:diff (11 packages loaded).
INFO: Found 1 target...
[...]
SUBCOMMAND: # //java/com/google/gerrit/server/diff:diff [action 'Building java/com/google/gerrit/server/diff/libdiff.jar (1 source file) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor)']
(cd /home/davido/.cache/bazel/_bazel_davido/1852ef137680fc84aebc08117217bd37/execroot/bazel_annotation_processor_breakage && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
  external/local_jdk/bin/java -XX:+TieredCompilation '-XX:TieredStopAtLevel=1' -Xbootclasspath/p:external/bazel_tools/third_party/java/jdk/langtools/javac-9-dev-r4023-3.jar -jar external/bazel_tools/tools/jdk/JavaBuilder_deploy.jar @bazel-out/k8-fastbuild/bin/java/com/google/gerrit/server/diff/libdiff.jar-2.params)
Target //java/com/google/gerrit/server/diff:diff up-to-date:
  bazel-bin/java/com/google/gerrit/server/diff/libdiff.jar
INFO: Elapsed time: 4.461s, Critical Path: 0.10s
INFO: Build completed successfully, 11 total actions

works without any issue.

Activity

  1. changed the title [-]Bazel: Error prone is broken on Windows[/-] [+]completion failure handling with incomplete classpaths[/+] on Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions