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

bazel build //:remote_client fails on Ubuntu with OpenJDK 21 #34

Open
nickbreen opened this issue Sep 11, 2023 · 1 comment
Open

bazel build //:remote_client fails on Ubuntu with OpenJDK 21 #34

nickbreen opened this issue Sep 11, 2023 · 1 comment

Comments

@nickbreen
Copy link

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.

@werkt
Copy link
Member

werkt commented Dec 13, 2023

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.

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