commit | e71aba7b3924500ca7ba4198d46b0d66a4906a56 | [log] [tgz] |
---|---|---|
author | Keith Smiley <keithbsmiley@gmail.com> | Fri Aug 22 22:23:29 2025 -0700 |
committer | GitHub <noreply@github.com> | Sat Aug 23 07:23:29 2025 +0200 |
tree | 5bd213e11839fb38512183c03d5e16d53de15388 | |
parent | 43939531b5ca4afd9acdfc31d7609b1c9563b5e5 [diff] |
Add has_default_test_toolchain_type (#112) This is required if you want to override the `toolchains` attr of a test rule, and want to make sure you're targeting the correct platform for tests.
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.