Add feature to check for `ObjcProvider` linker info availability (#20) Some rulesets inspect linking information from `ObjcProvider` and fallback to `CcInfo` only if a rule doesn’t propagate an `ObjcProvider`. After `7.0.0-pre.20230724.1` (https://github.com/bazelbuild/bazel/commit/426f2254669f62b7d332094a0af6d4dc6200ad51) a `ObjcProvider` will exist, but it won’t have any linking information set. Signed-off-by: Brentley Jones <github@brentleyjones.com>
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.