bazelbuild / bazelbuild/bazel-toolchains
rbe_configs_gen: no native support for Java 11 runtime
- Dominant language
- Go
- Stars
- 202
- Forks
- 100
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to migrate from bazel-toolchain 5.0.0 to 5.1.0, where support for `rbe_autoconfig` was discontinued.
In bazel-toolchain 5.0.0 I used this code to build against JDK 11:
```python
http_archive(
name = "bazel_toolchains",
sha256 = 1adf7a8e9901287c644dcf9ca08dd8d67a69df94bedbd57a841490a84dc1e9ed",
strip_prefix = "bazel-toolchains-5.0.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/v5.0.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/v5.0.0.tar.gz",
],
)
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
# Creates a default toolchain config for RBE.
rbe_autoconfig(
name = "rbe_jdk11",
java_home = "/usr/lib/jvm/11.29.3-ca-jdk11.0.2/reduced",
use_checked_in_confs = "Force",
)
```
After migration to generated RBE configuration, that I produced with this command:
```
$ ./rbe_configs_gen \
--bazel_version=4.1.0 \
--toolchain_container=l.gcr.io/google/rbe-ubuntu18-04:latest \
--output_src_root=/home/davido/projects/gerrit \
--output_config_path=tools/rbe \
--exec_os=linux \
--target_os=linux
```
native support for JDK 11 is gone.
I have to manually mess around with generated tools/rbe/java/BUILD file and add this section:
```python
java_runtime(
name = "jdk11",
srcs = [],
java_home = "/usr/lib/jvm/11.29.3-ca-jdk11.0.2/reduced",
)
```
It would be great if this would be supported and I wouldn't need to manipulate generated Starlark files.
May be add these options: `--java_runtime_additional_name=jdk11 --java_runtime_additional_home=/usr/lib/jvm/11.29.3-ca-jdk11.0.2/reduced`.
See also this [discussion](https://github.com/bazelbuild/continuous-integration/issues/1160).
Contributor guide
Research direction
Start at the rbe_configs_gen entry point and compare its generated tools/rbe/java/BUILD with the former rbe_autoconfig behavior and the requested Java 11 parameters. Check the linked discussion for context. Done means generated configurations can include the requested Java runtime without manually editing the generated Starlark file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100