diff --git a/Documentation/dev-bazel.txt b/Documentation/dev-bazel.txt index 1a4a75d28623..158e528e99ab 100644 --- a/Documentation/dev-bazel.txt +++ b/Documentation/dev-bazel.txt @@ -43,8 +43,8 @@ provide the path to JDK home: $ bazel build \ --define=ABSOLUTE_JAVABASE= \ --host_javabase=@bazel_tools//tools/jdk:absolute_javabase \ - --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \ - --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \ + --host_java_toolchain=//tools:toolchain_vanilla \ + --java_toolchain=//tools:toolchain_vanilla \ :release ``` @@ -56,8 +56,8 @@ bazel test runs the test using the target javabase: --define=ABSOLUTE_JAVABASE= \ --javabase=@bazel_tools//tools/jdk:absolute_javabase \ --host_javabase=@bazel_tools//tools/jdk:absolute_javabase \ - --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \ - --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \ + --host_java_toolchain=//tools:toolchain_vanilla \ + --java_toolchain=//tools:toolchain_vanilla \ //... ``` @@ -69,8 +69,8 @@ $ cat << EOF > ~/.bazelrc > build --define=ABSOLUTE_JAVABASE= > build --javabase=@bazel_tools//tools/jdk:absolute_javabase > build --host_javabase=@bazel_tools//tools/jdk:absolute_javabase -> build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla -> build --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla +> build --host_java_toolchain=//tools:toolchain_vanilla +> build --java_toolchain=//tools:toolchain_vanilla > EOF ``` diff --git a/tools/BUILD b/tools/BUILD index 5531c3ef7809..208a7fcbc0bd 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -15,6 +15,19 @@ py_binary( visibility = ["//visibility:public"], ) +# TODO(davido): Remove this workaround and switch to using toolchain_vanilla +# from this Bazel package again: @bazel_tools//tools/jdk:toolchain_vanilla, +# when this issue is fixed: https://github.com/bazelbuild/bazel/issues/9415. +default_java_toolchain( + name = "toolchain_vanilla", + forcibly_disable_header_compilation = True, + javabuilder = ["@bazel_tools//tools/jdk:vanillajavabuilder"], + jvm_opts = [], + source_version = "", + target_version = "", + visibility = ["//visibility:public"], +) + default_java_toolchain( name = "error_prone_warnings_toolchain", bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],