Skip to content

Commit

Permalink
java_grpc_library.bzl: Fix parameters of java_common.compile (#7598)
Browse files Browse the repository at this point in the history
Parameter host_javabase is removed.

This is preparation for flipping incompatible_java_common_parameters in
Bazel 5. See bazelbuild/bazel#12373

Bazel versions prior to 4 require host_javabase, so are no longer supported.
  • Loading branch information
comius authored Oct 8, 2021
1 parent 0d25d8f commit bb51bb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion buildscripts/kokoro/bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions java_grpc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

_JavaRpcToolchainInfo = provider(
fields = [
"host_javabase",
"java_toolchain",
"plugin",
"plugin_arg",
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bb51bb6

Please sign in to comment.