From b2bdd9e635ff4df06aa677f74555acc1847d2d5d Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 27 Nov 2024 11:23:09 +0100 Subject: [PATCH] Fixes for Bazel 6 (#123) --- MODULE.bazel | 2 +- tests/analysis/cc_jni_library/tests.bzl | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index c7a8c6d..1bde2cc 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,7 +6,7 @@ module( bazel_dep(name = "bazel_skylib", version = "1.6.1") bazel_dep(name = "platforms", version = "0.0.5") -bazel_dep(name = "rules_cc", version = "0.0.12") +bazel_dep(name = "rules_cc", version = "0.0.17") bazel_dep(name = "rules_license", version = "0.0.7") download_jdk_deps = use_extension( diff --git a/tests/analysis/cc_jni_library/tests.bzl b/tests/analysis/cc_jni_library/tests.bzl index 63f14ed..fdc93d6 100644 --- a/tests/analysis/cc_jni_library/tests.bzl +++ b/tests/analysis/cc_jni_library/tests.bzl @@ -89,22 +89,16 @@ 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": - if is_bazel_7_or_higher: - return "darwin_x86_64" - else: - return "darwin" elif os == "windows": return "x64_windows" + elif os == "osx": + return "darwin_x86_64" else: fail("This test requires the host OS to be linux, macos or windows, got: %s" % os)