From 06b7b99768bfb6f611f70be741c8cb4f82afdf44 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 25 Apr 2022 15:53:40 +0200 Subject: [PATCH] Fix bazel build on Mac M1 (aarch64) 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] https://github.com/bazelbuild/bazel/issues/13573 [2] https://github.com/bazelbuild/platforms/pull/22 Release-Notes: Fix bazel build on Mac M1 (aarch64) Change-Id: I5a4ebcd50012a53e5ff92a12e4fa8ba766aed0a7 --- WORKSPACE | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index ce7ab95b0321..cdec88894276 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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",