Skip to content

Commit

Permalink
Switch host CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Apr 27, 2024
1 parent ae6b7eb commit 71aa574
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/analysis/cc_jni_library/tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,20 @@ def _get_host_constraint_value(constraint_setting):
def _get_host_legacy_cpu():
cpu = _get_host_constraint_value("cpu")
os = _get_host_constraint_value("os")
# Indirectly test for Bazel 7 via:
# https://github.com/bazelbuild/bazel/commit/31fd464af77f084049386af02dbcc5189c745892
is_bazel_7_or_higher = attr.string() == attr.string()
if os == "osx" and cpu == "aarch64":
return "darwin_arm64"
if cpu != "x86_64":
fail("This test requires the host CPU to be x86_64 or darwin_arm64, got: %s" % cpu)
if os == "linux":
return "k8"
elif os == "osx":
return "darwin_x86_64"
if is_bazel_7_or_higher:
return "darwin_x86_64"
else:
return "darwin"
elif os == "windows":
return "x64_windows"
else:
Expand Down

0 comments on commit 71aa574

Please sign in to comment.