-
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
bazel 4.1.0 can't find javabase on Apple M1 macmini #13573
Comments
Bazel uses remote JDKs for the host_javabase and has a preconfigured set in /src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl The set is missing M1 architecture, so the --host_javabase workaround is the simplest. |
This should be fixed on head |
@keith Do you know if the required commits have been cherry-picked into the 4.2.0 RC? |
not sure, it has been too hard to follow |
I still see the same error. Is it fixed? If not, why this issue is closed? |
Om 4.2.1 I get this error on my M1 mac still:
|
bazel cannot find a proper JAVA base installed on arm64 macs. I had java11 installed via homebrew, so I had to add the following command line flag:
Or put these lines in
See https://stackoverflow.com/questions/59040291/configuring-bazel-to-build-test-using-a-specific-jvm-version as well for reference. |
Day 2 using I was facing the same issue with bazel After that I figured that Then while searching more I noticed this PR : bazelbuild/platforms#22 I went ahead and added this to my
and now Note : was able to validate this workaround against this issue as well (although it now fails with a compilation error) |
Running the bazel build on Mac M1 yields the following error: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using `--host_javabase.` Follow hints in [1] and fix this by loading bazel platforms 0.0.5 which contains a fix [2] making aarch64 an alias of arm64. [1] bazelbuild/bazel#13573 [2] bazelbuild/platforms#22 Release-Notes: Fix bazel build on Mac M1 (aarch64) Change-Id: I5a4ebcd50012a53e5ff92a12e4fa8ba766aed0a7
Description of the problem / feature request:
bazel gives an error and asks for the
--host_javabase
when building my project on an Apple M1 macmini.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
Apple M1 macmini
What's the output of
bazel info release
?Have you found anything relevant by searching the web?
#10377 is similar but for Power9
Any other information, logs, or outputs that you want to share?
Adding the
--host_javabase
flag worksThe text was updated successfully, but these errors were encountered: