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

targeting java language level 17 or using a java_runtime_level 17 causes build failures on arm64 linux #14937

Closed
chancila opened this issue Mar 2, 2022 · 1 comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Java Issues for Java rules type: feature request

Comments

@chancila
Copy link
Contributor

chancila commented Mar 2, 2022

Description of the problem / feature request:

seems that there's no jdk for linux arm64 for java 17...I didn't find any open or closed issues about this so opening this one

_JDKS = [
    "remotejdk11_macos",
    "remotejdk11_macos_aarch64",
    "remotejdk11_win",
    "remotejdk11_win_arm64",
    "remotejdk11_linux_aarch64",
    "remotejdk11_linux",
    "remotejdk11_linux_ppc64le",
    "remotejdk11_linux_s390x",
    "remotejdk17_macos",
    "remotejdk17_macos_aarch64",
    "remotejdk17_win",
    "remotejdk17_win_arm64",
    "remotejdk17_linux",
]

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

see below for examples...

What operating system are you running Bazel on?

can fail on any system if targeting linux arm64, but will always fail on an arm64 linux host not cross-compiling for jdk 17 or using the java 17 runtime.

What's the output of bazel info release?

5.0

Have you found anything relevant by searching the web?

nothing in the issue tracker

Any other information, logs, or outputs that you want to share?

forcing linux x86_64 works fine:

bzl build --host_platform=//:linux_x86_64 --java_language_version=17 @bazel_tools//tools/jdk:remotejdk_17
INFO: Invocation ID: c77977bd-cdfd-41fe-880c-ae2bdd1eb9e0
INFO: Analyzed target @bazel_tools//tools/jdk:remotejdk_17 (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target @bazel_tools//tools/jdk:remotejdk_17 up-to-date (nothing to build)
INFO: Elapsed time: 0.191s (0.00m), Critical Path: 0.00s (0.00m)
INFO: 1 process: 1 internal.
INFO: Build Event Protocol files produced successfully.
INFO: Build completed successfully, 1 total action

forcing linux arm64 does not:

bzl build --host_platform=//:linux_arm64 --java_language_version=17 @bazel_tools//tools/jdk:remotejdk_17
INFO: Invocation ID: b7b1bedc-6e5e-4776-930f-f40c0f75118e
INFO: Build options --host_platform and --platforms have changed, discarding analysis cache.
ERROR: /Users/chancila/Snapchat/Dev/.cache/_bazel_root/57e2a0029c5db09ba854cfc0b854c40c/external/bazel_tools/tools/jdk/BUILD:492:27: While resolving toolchains for target @bazel_tools//tools/jdk:remotejdk_17: no matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type
ERROR: Analysis of target '@bazel_tools//tools/jdk:remotejdk_17' failed; build aborted:
INFO: Elapsed time: 0.203s (0.00m)
INFO: 0 processes.
INFO: Build Event Protocol files produced successfully.
FAILED: Build did NOT complete successfully (0 packages loaded, 153 targets configured)
@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request and removed untriaged type: bug labels Mar 10, 2022
@nresare
Copy link
Contributor

nresare commented Aug 12, 2022

linux on arm64 is becoming a more mainstream platform with docker on Apple silicon macs as well as Amazon's Graviton offerings. It is unfortunate that specifying java language level 17 with the latest released versions of bazel will fail with a fairly cryptic error message "no matching toolchains found". Java 17 is an LTS release that was released almost a year ago.

nresare added a commit to nresare/bazel that referenced this issue Aug 13, 2022
nresare added a commit to nresare/bazel that referenced this issue Aug 15, 2022
nresare added a commit to nresare/bazel that referenced this issue Sep 6, 2022
nresare added a commit to nresare/bazel that referenced this issue Sep 6, 2022
nresare added a commit to nresare/bazel that referenced this issue Sep 6, 2022
nresare added a commit to nresare/bazel that referenced this issue Sep 6, 2022
aiuto pushed a commit to aiuto/bazel that referenced this issue Oct 12, 2022
Closes bazelbuild#14937

Closes bazelbuild#16103.

PiperOrigin-RevId: 472802039
Change-Id: I4125d542bc52c30c3040939d3ad40b47dd664643
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Java Issues for Java rules type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants