From 20cb9d26d8a56ecce2101ca5f3ceb82f71c47cb5 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 2 Apr 2024 20:21:43 -0400 Subject: [PATCH] refactor: remove vendored is_bazel_7_or_greater from bazel-lib; use upstream instead (#1578) --- js/BUILD.bazel | 2 +- js/private/BUILD.bazel | 2 +- js/private/is_bazel_7_or_greater.bzl | 7 ------- npm/private/BUILD.bazel | 4 +--- 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 js/private/is_bazel_7_or_greater.bzl diff --git a/js/BUILD.bazel b/js/BUILD.bazel index 930d91ca6..2bd38d15d 100644 --- a/js/BUILD.bazel +++ b/js/BUILD.bazel @@ -1,8 +1,8 @@ "Public API" +load("@aspect_bazel_lib//lib:utils.bzl", "is_bazel_7_or_greater") load("@bazel_features//:features.bzl", "bazel_features") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//js/private:is_bazel_7_or_greater.bzl", "is_bazel_7_or_greater") exports_files( glob(["*.bzl"]), diff --git a/js/private/BUILD.bazel b/js/private/BUILD.bazel index 5b8bddc84..284499570 100644 --- a/js/private/BUILD.bazel +++ b/js/private/BUILD.bazel @@ -1,10 +1,10 @@ "Internal implementation details" load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") +load("@aspect_bazel_lib//lib:utils.bzl", "is_bazel_7_or_greater") load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("//js:defs.bzl", "js_binary") -load("//js/private:is_bazel_7_or_greater.bzl", "is_bazel_7_or_greater") exports_files( glob(["*.bzl"]), diff --git a/js/private/is_bazel_7_or_greater.bzl b/js/private/is_bazel_7_or_greater.bzl deleted file mode 100644 index 0a9b740fd..000000000 --- a/js/private/is_bazel_7_or_greater.bzl +++ /dev/null @@ -1,7 +0,0 @@ -"is_bazel_7_or_greater" - -def is_bazel_7_or_greater(): - # Vendored in from https://github.com/aspect-build/bazel-lib/blob/adad7889c925c4f22a2f84568268f0a62e7c2fb0/lib/private/utils.bzl#L208 - # so that rules_js remains compatible with aspect_bazel_lib >= 2.0.0 and < 2.2.0. - # TODO(2.0): remove this and switch to the upstream function and bump minimum aspect_bazel_lib version to 2.2.0 - return "apple_binary" not in dir(native) and "cc_host_toolchain_alias" not in dir(native) diff --git a/npm/private/BUILD.bazel b/npm/private/BUILD.bazel index ba4e774a4..f1b64d9e4 100644 --- a/npm/private/BUILD.bazel +++ b/npm/private/BUILD.bazel @@ -1,12 +1,10 @@ "Internal implementation details" load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains") +load("@aspect_bazel_lib//lib:utils.bzl", "is_bazel_7_or_greater") load("@aspect_rules_js//js:defs.bzl", "js_library") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -# buildifier: disable=bzl-visibility -load("//js/private:is_bazel_7_or_greater.bzl", "is_bazel_7_or_greater") - js_library( name = "npm_publish_mjs", srcs = ["npm_publish.mjs"],