-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Darwin ARM64 prebuilt binaries for java_tools are not compatible (ijar bad CPU type) #13944
Comments
There is non-prebuilt toolchain that support such use cases. Can you try with
and
More info on https://docs.bazel.build/versions/main/bazel-and-java.html I'm reluctant to start compiling java_tools for one more platfort. @philwo - but if we really want to, we'd need CI for it I guess. There are two things that could be done:
|
I triaged to P2, but any help with fixes I mentioned above is welcome. |
Can remote_java_tools_darwin be compiled fat to obviate the need for extra set of plumbing?
It seems unfortunate that every java project using Bazel would have to make this change to successfully build on arm. |
I think if we publish remote_java_tools_darwin, then it would be great to do so in a way that contains support for both x86_64 and arm64. @comius Is this something the community could help with and contribute a PR that does it? It's easily possible to cross-compile on macOS (we currently build Bazel arm64 binaries on our Intel machines), so maybe it's not much work. Building macOS universal binaries I think is a matter of building them once for each platform and then merging them into a universal binary via |
A PR updating https://github.com/bazelbuild/bazel/blob/master/src/create_java_tools_release.sh , would help. Except that there is probably limited options for testing the CI. cc @hvadehra |
Any updates? I can't build bazel itself on mac M1 by this issue! (It looks CI uses x86_64 mac.)
|
According to [1] Bazel fails to select the correct java-tools binaries for Apple's ARM64 chip and download the generic x86. Apple the workaround suggested at [1] by disabling the download of the pre-compiled java_tools, allowing Bazel to build them locally using the correct architecture. [1] bazelbuild/bazel#13944 Bug: Issue 16306 Release-Notes: Fix Bazel build on Apple M2 ARM64 chip Change-Id: I1b6900045b9835c95ada2a4e54342d1764a5de04
@comius I am using
|
singlejar and hence the `NONPREBUILT_TOOLCHAIN_CONFIGURATION` did not build with `--features=layering_check` due to includes being used from indirect dependencies. Work towards bazelbuild#13944 (comment)
singlejar and hence the `NONPREBUILT_TOOLCHAIN_CONFIGURATION` did not build with `--features=layering_check` due to includes being used from indirect dependencies. Work towards bazelbuild#13944 (comment)
singlejar and hence the `NONPREBUILT_TOOLCHAIN_CONFIGURATION` did not build with `--features=layering_check` due to includes being used from indirect dependencies. Work towards bazelbuild#13944 (comment)
singlejar and hence the `NONPREBUILT_TOOLCHAIN_CONFIGURATION` did not build with `--features=layering_check` due to includes being used from indirect dependencies. Work towards #13944 (comment) Closes #16424. PiperOrigin-RevId: 481844354 Change-Id: I75bf9a272cad010e72326b40457e18c0a0c756df
@hvadehra Now that M1 Macs are available in Bazel CI, would it be possible to get a java_tools release for them? |
Build a fat universal binary for java_tools_prebuilt on darwin Work towards: bazelbuild/java_tools#57 and #13944 Closes #16960. PiperOrigin-RevId: 512683379 Change-Id: Ie9db26c729a301fbb22f17dd15065861f3198f57
*** Reason for rollback *** Conflicts with #17762 Will instead go with the alternative idea discussed in this PR: #17767 *** Original change description *** Add darwin_arm64 java_tools Build a fat universal binary for java_tools_prebuilt on darwin Work towards: bazelbuild/java_tools#57 and #13944 Closes #16960. PiperOrigin-RevId: 516799739 Change-Id: I2ff5f615bd7c23e38a334bf836c31ed964443c31
This is fixed after #17780 . java_tools for darwin are now separately available for x86_64 and arm64 after v12.0 : https://github.com/bazelbuild/java_tools/releases/tag/java_v12.0 |
Build a fat universal binary for java_tools_prebuilt on darwin Work towards: bazelbuild/java_tools#57 and bazelbuild#13944 Closes bazelbuild#16960. PiperOrigin-RevId: 512683379 Change-Id: Ie9db26c729a301fbb22f17dd15065861f3198f57
*** Reason for rollback *** Conflicts with bazelbuild#17762 Will instead go with the alternative idea discussed in this PR: bazelbuild#17767 *** Original change description *** Add darwin_arm64 java_tools Build a fat universal binary for java_tools_prebuilt on darwin Work towards: bazelbuild/java_tools#57 and bazelbuild#13944 Closes bazelbuild#16960. PiperOrigin-RevId: 516799739 Change-Id: I2ff5f615bd7c23e38a334bf836c31ed964443c31
According to [1] Bazel fails to select the correct java-tools binaries for Apple's ARM64 chip and download the generic x86. Apple the workaround suggested at [1] by disabling the download of the pre-compiled java_tools, allowing Bazel to build them locally using the correct architecture. [1] bazelbuild/bazel#13944 Bug: Issue 16306 Release-Notes: Fix Bazel build on Apple M2 ARM64 chip Change-Id: I1b6900045b9835c95ada2a4e54342d1764a5de04 (cherry picked from commit 5d7becc)
Description of the problem / feature request:
Currently, when using Darwin ARM64 with a remote JDK for example, the use of
ijar
in a Java project seems to fail. e.g.I assume this happens because the prebuilt binaries are only built for Windows, Linux and macOS but there is no separation of Darwin ARM64 or x86_64. Currently only x64 binaries are being built & shipped:
bazel/tools/jdk/BUILD.tools
Lines 153 to 157 in e1c404e
How to reproduce
Note: I have been using
--java_runtime_version=remotejdk_11
. Down the line, the Maven runner failed with Java not being found. I have java not setup at all; only the embedded version. I set--action_env=JAVA_HOME=<bazel-output_base>/external/remotejdk11_macos_aarch64
to workaround the Maven issueWhat operating system are you running Bazel on?
macOS Big Sur M1 Arm64
What's the output of
bazel info release
?release 5.0.0-pre.20210826.1
(also confirmed with 4.2.0 stable)
The text was updated successfully, but these errors were encountered: