feat: expose a flag name for allow_unresolved_symlinks (#15) * feat: expose a flag name for allow_unresolved_symlinks Allows a principled solution for rules like rules_js that need to have starlark logic conditional on the value, without a breaking change in Bazel 7 as the flag has been renamed. Unblocks aspect-build/rules_js#1102 Alternative to #14 * code review comments * fix: be precise about which 7.0 release changes the flag name
Use this to determine the availability of a Bazel feature in your ruleset. It works under the hood by comparing the Bazel version against a known range in which the feature is available. Example usage:
load("@bazel_features//:features.bzl", "bazel_features") if bazel_features.toolchains.has_optional_toolchains: # Do something
The features.bzl file contains the list of features.
References to global Starlark symbols that do not exist cause load time errors, which means that their availability in Bazel cannot be tested via a regular feature. Instead, use bazel_features.globals.<symbol>, which is <symbol> if the symbol is available and None else.
See globals.bzl for the list of symbols that can be checked for in this way.