Search code examples
javaguavabazel

Failing to compile Guava (v24.0) using Bazel (v0.10)


I recently forked guava (v24.0, came out today) with the intention of contributing a parallel build system using Bazel for compliation and testing. I have it mostly working, but I'm having issues compiling the collect package:

Here's the error I'm seeing: https://gist.github.com/perezd/4b39107381a9a032982fee3543c2f382

And I've pushed my WIP branch here if you'd like to repro: https://github.com/perezd/guava/tree/bazel

command to repro (from project root): bazel build guava/src/com/google/common/collect

Any ideas? Not sure why these sorts of failures would arise? Could this be a JDK9 thing?

EDIT: I'm running javac 1.8.0_151 (OpenJDK via openjdk-8-jdk package in ubuntu). Also, goes without saying maven compilation is working just fine.

EDIT: Here's the output of the generated params file that is getting passed to BazelJavaBuiler: https://gist.github.com/perezd/a730ff76f640f28fbf336174f48c8e8b


Solution

  • It looks like you're depending on the entire Checker Framework, rather than just the checker-compat-qual, the annotations-only artifact that Guava uses. The Checker Framework bundles an old copy of Guava, including only copies of Function and Predicate that don't extend the JDK's Function and Predicate.