java_grpc_library.bzl: Fix parameters of java_common.compile (#7598)

Parameter host_javabase is removed.

This is preparation for flipping incompatible_java_common_parameters in
Bazel 5. See https://github.com/bazelbuild/bazel/issues/12373

Bazel versions prior to 4 require host_javabase, so are no longer supported.
This commit is contained in:
Ivo List 2021-10-08 22:48:22 +02:00 committed by GitHub
parent 0d25d8f7d6
commit bb51bb6dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 8 deletions

View File

@ -3,7 +3,7 @@
set -exu -o pipefail
cat /VERSION
use_bazel.sh 1.0.1
use_bazel.sh 4.0.0
bazel version
cd github/grpc-java

View File

@ -2,7 +2,6 @@
_JavaRpcToolchainInfo = provider(
fields = [
"host_javabase",
"java_toolchain",
"plugin",
"plugin_arg",
@ -14,7 +13,6 @@ _JavaRpcToolchainInfo = provider(
def _java_rpc_toolchain_impl(ctx):
return [
_JavaRpcToolchainInfo(
host_javabase = ctx.attr._host_javabase,
java_toolchain = ctx.attr._java_toolchain,
plugin = ctx.executable.plugin,
plugin_arg = ctx.attr.plugin_arg,
@ -44,10 +42,6 @@ java_rpc_toolchain = rule(
"_java_toolchain": attr.label(
default = Label("@bazel_tools//tools/jdk:current_java_toolchain"),
),
"_host_javabase": attr.label(
cfg = "host",
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
),
},
provides = [
_JavaRpcToolchainInfo,
@ -106,7 +100,6 @@ def _java_rpc_library_impl(ctx):
java_info = java_common.compile(
ctx,
java_toolchain = toolchain.java_toolchain[java_common.JavaToolchainInfo],
host_javabase = toolchain.host_javabase[java_common.JavaRuntimeInfo],
source_jars = [srcjar],
output = ctx.outputs.jar,
output_source_jar = ctx.outputs.srcjar,