Make Bazel tests for Crubit feature infra independent of production features
We update the definitions of feature sets like "supported" and "experimental"
for release engineering reasons. The expansion of these feature sets is
hardcoded in a Bazel test. As a result, when we update the feature sets to
release a feature or clean up a feature flag, we have to update a Bazel test.
This change makes Bazel tests use special test-only feature set names that are
stable, thus eliminating the churn in the Bazel test.
PiperOrigin-RevId: 650151945
Change-Id: I2620a2dde83fd341f06f03f20f2ea3818fe0852b
diff --git a/bazel/llvm.bzl b/bazel/llvm.bzl
index 68f95fc..962a650 100644
--- a/bazel/llvm.bzl
+++ b/bazel/llvm.bzl
@@ -53,7 +53,7 @@
executable = False,
)
-LLVM_COMMIT_SHA = "6461b921fd06b1c812f1172685b8b7edc0608af7"
+LLVM_COMMIT_SHA = "7102eae4c0640492e1fcea3da7f22f4e75a4f062"
def llvm_loader_repository_dependencies():
# This *declares* the dependency, but it won't actually be *downloaded* unless it's used.
diff --git a/features/BUILD b/features/BUILD
index 4262085..56cc6e9 100644
--- a/features/BUILD
+++ b/features/BUILD
@@ -32,3 +32,17 @@
],
visibility = _EXPERIMENTAL_CLIENTS,
)
+
+# A feature set with a stable expansion, only for use in Bazel unit tests.
+crubit_feature_hint(
+ name = "internal_testonly_supported",
+ crubit_features = ["supported"],
+ visibility = ["//:__subpackages__"],
+)
+
+# A feature set with a stable expansion, only for use in Bazel unit tests.
+crubit_feature_hint(
+ name = "internal_testonly_experimental",
+ crubit_features = ["experimental"],
+ visibility = ["//:__subpackages__"],
+)
diff --git a/rs_bindings_from_cc/test/bazel_unit_tests/target_args/target_args_test.bzl b/rs_bindings_from_cc/test/bazel_unit_tests/target_args/target_args_test.bzl
index c6417b4..70e96f2 100644
--- a/rs_bindings_from_cc/test/bazel_unit_tests/target_args/target_args_test.bzl
+++ b/rs_bindings_from_cc/test/bazel_unit_tests/target_args/target_args_test.bzl
@@ -331,7 +331,7 @@
)
asserts.equals(
env,
- ["experimental", "extern_c", "supported"],
+ ["experimental", "supported"],
target_args[1]["f"],
)
@@ -341,8 +341,8 @@
def _test_target_features_nonempty():
native.cc_library(name = "mylib_nonempty_features", hdrs = ["lib.h"], aspect_hints = [
- "//features:supported",
- "//features:experimental", # merged in as well
+ "//features:internal_testonly_supported",
+ "//features:internal_testonly_experimental", # merged in as well
])
attach_aspect(name = "mylib_nonempty_features_with_aspect", dep = ":mylib_nonempty_features")