Skip to content

Commit

Permalink
fix: vendor in is_bazel_7_or_greater so we maintain compat with aspec…
Browse files Browse the repository at this point in the history
…t_bazel_lib >=2.0.0 <2.2.0
  • Loading branch information
gregmagolan committed Jan 26, 2024
1 parent b2bb3a2 commit debcef3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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"]),
Expand Down
2 changes: 1 addition & 1 deletion js/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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"]),
Expand Down
7 changes: 7 additions & 0 deletions js/private/is_bazel_7_or_greater.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"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)
4 changes: 3 additions & 1 deletion npm/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"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"],
Expand Down

0 comments on commit debcef3

Please sign in to comment.