Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbe_configs_gen: no native support for Java 11 runtime #961

Open
davido opened this issue May 25, 2021 · 1 comment
Open

rbe_configs_gen: no native support for Java 11 runtime #961

davido opened this issue May 25, 2021 · 1 comment

Comments

@davido
Copy link

davido commented May 25, 2021

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:

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:

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.

@sgammon
Copy link

sgammon commented Dec 22, 2022

hello from 2022, nearly 2023. java 20 is out, so is bazel 6. still hitting this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants