tools_remote
tools_remote copied to clipboard
bazel build //:remote_client fails on Ubuntu with OpenJDK 21
Due to /usr/bin/java
outputting a non base-10 version number.
$ java -version
openjdk version "21-ea" 2023-09-19
OpenJDK Runtime Environment (build 21-ea+14-Ubuntu-0ubuntu1)
OpenJDK 64-Bit Server VM (build 21-ea+14-Ubuntu-0ubuntu1, mixed mode, sharing)
ERROR: An error occurred during the fetch of repository 'maven':
Traceback (most recent call last):
File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 810, column 38, in _coursier_fetch_impl
dep_tree = make_coursier_dep_tree(
File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 714, column 30, in make_coursier_dep_tree
if parse_java_version(exec_result.stdout + exec_result.stderr) > 8:
File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/private/java_utilities.bzl", line 21, column 19, in parse_java_version
return int(java_version)
Error in int: invalid base-10 literal: "21-ea"
ERROR: /home/nick/src/tools_remote/WORKSPACE:77:14: fetching coursier_fetch rule //external:maven: Traceback (most recent call last):
File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 810, column 38, in _coursier_fetch_impl
dep_tree = make_coursier_dep_tree(
File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 714, column 30, in make_coursier_dep_tree
if parse_java_version(exec_result.stdout + exec_result.stderr) > 8:
File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/private/java_utilities.bzl", line 21, column 19, in parse_java_version
return int(java_version)
Error in int: invalid base-10 literal: "21-ea"
ERROR: Error computing the main repository mapping: no such package '@maven//': invalid base-10 literal: "21-ea"
Not sure if this is Ubuntu's java package outputting a daft version string or that the rules need to handle non-numeric version strings.
Quite certain this is a problem due to the 21-ea version listed there (being interpreted by rules_jvm_external, so it's their bug to fix).
Building with --java_runtime_version=remotejdk_18
and --tool_java_runtime_version=remotejdk_18
should improve the situation for you. There are no meaningful features of Java 21 that tools_remote would benefit significantly from.