You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot make alternative java_toolchain work (to activate all error prone warnings) #5997
On most recent Bazel version (d019651) I'm, trying to implement alternative java_toolchain and activate all error prone warnings, as described in this comment: [1]:
$ bazel build --java_toolchain //tools:error_prone_warnings_toolchain java/com/google/gerrit/extensions:extension-api-javadoc
DEBUG: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/bazel_skylib/lib/versions.bzl:98:7:
Current Bazel is not a release version, cannot check for compatibility.
DEBUG: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/bazel_skylib/lib/versions.bzl:99:7: Make sure that you are running at least Bazel 0.14.0.
ERROR: /home/davido/projects/gerrit2/java/com/google/gerrit/extensions/BUILD:49:1: every rule of type java_doc implicitly depends upon the target '@local_jdk//:jdk-default', but this target could not be found because of: no such target '@local_jdk//:jdk-default': target 'jdk-default' not declared in package '' (did you mean 'jre-default'?) defined by /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/local_jdk/BUILD.bazel
ERROR: Analysis of target '//java/com/google/gerrit/extensions:extension-api-javadoc' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.085s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
javadoc.bzl is here: [2] and the reproducer is here: [3].
Activity
cushon commentedon Aug 27, 2018
Don't depend on
@local_jdkdirectly; use@bazel_tools//tools/jdk:current_java_runtimeto get the configured JDK instead (see #5594).e.g.:
davido commentedon Aug 27, 2018
Thank you! It works like a charm:
Bazel: Don't depend directly on @local_jdk in java_doc rule
Bazel: Don't depend directly on @local_jdk in java_doc rule
Fix a bug that allows to compile Tink for Java with Bazel 0.17.2 (lat…
Fix a bug that allows to compile Tink for Java with Bazel 0.17.2 (lat…
Fix a bug that allows to compile Tink for Java with Bazel 0.17.2 (lat…