Skip to content

Commit

Permalink
Fix bazel build on Mac M1 (aarch64)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
msohn committed Apr 25, 2022
1 parent d5f4ca7 commit 06b7b99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "maven_jar")
load("//plugins:external_plugin_deps.bzl", "external_plugin_deps")
load("//tools:nongoogle.bzl", "declare_nongoogle_deps")

http_archive(
name = "platforms",
sha256 = "379113459b0feaf6bfbb584a91874c065078aa673222846ac765f86661c27407",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.5/platforms-0.0.5.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.5/platforms-0.0.5.tar.gz",
],
)

http_archive(
name = "rbe_jdk11",
sha256 = "766796de71916118e528b9f4334c29c9c9b4e926227bf3264dee555e6a4306c8",
Expand Down

0 comments on commit 06b7b99

Please sign in to comment.