diff options
author | Claudio Bley <claudio.bley@gmail.com> | 2022-07-05 20:28:06 +0200 |
---|---|---|
committer | Claudio Bley <claudio.bley@gmail.com> | 2022-08-01 06:39:12 +0200 |
commit | 0917e349670cff11beb8748f76b27c4f695b7240 (patch) | |
tree | ab7ea410bf240cc85bd964c75af25d4ee0336d17 /pkgs | |
parent | b38a131850c00c1cf2deafe36b5c1b91e03aac8b (diff) |
bazel_{3,4,5}: Use `arm64` as arch suffix on aarch64
The official bazel wrapper script uses `$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)` as the `os-arch` suffix. On aarch64 Darwin, `uname -m` returns "arm64", on aarch64 Linux it returns "aarch64".
Diffstat (limited to 'pkgs')
3 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix index 2cb085a4c01d4..6544db85a7f31 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix @@ -110,7 +110,9 @@ let # and libraries path. # We prefetch it, patch it, and override it in a global bazelrc. system = if stdenv.hostPlatform.isDarwin then "darwin" else "linux"; - arch = stdenv.hostPlatform.parsed.cpu.name; + + # on aarch64 Darwin, `uname -m` returns "arm64" + arch = with stdenv.hostPlatform; if isDarwin && isAarch64 then "arm64" else parsed.cpu.name; remote_java_tools = stdenv.mkDerivation { name = "remote_java_tools_${system}"; diff --git a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix index aa9794b5869c0..511234a1e5957 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix @@ -135,7 +135,9 @@ let # and libraries path. # We prefetch it, patch it, and override it in a global bazelrc. system = if stdenv.hostPlatform.isDarwin then "darwin" else "linux"; - arch = stdenv.hostPlatform.parsed.cpu.name; + + # on aarch64 Darwin, `uname -m` returns "arm64" + arch = with stdenv.hostPlatform; if isDarwin && isAarch64 then "arm64" else parsed.cpu.name; remote_java_tools = stdenv.mkDerivation { name = "remote_java_tools_${system}"; diff --git a/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix index 9e2685091ddd2..0c06d61283178 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix @@ -126,7 +126,9 @@ let platforms = lib.platforms.linux ++ lib.platforms.darwin; system = if stdenv.hostPlatform.isDarwin then "darwin" else "linux"; - arch = stdenv.hostPlatform.parsed.cpu.name; + + # on aarch64 Darwin, `uname -m` returns "arm64" + arch = with stdenv.hostPlatform; if isDarwin && isAarch64 then "arm64" else parsed.cpu.name; bazelRC = writeTextFile { name = "bazel-rc"; |