Clone this repo:
  1. e71aba7 Add has_default_test_toolchain_type (#112) by Keith Smiley · 2 weeks ago upstream/main v1.35.0
  2. 4393953 Add `genrule_accepts_toolchain_types` (#110) by Mike Lundy · 3 weeks ago v1.34.0
  3. 5d3fd91 Add `cc_toolchain_has_generate_modmap` (#109) by Fabian Meumertzheim · 5 weeks ago v1.33.0
  4. edb2a69 Add `instrumented_files_info_has_baseline_coverage_files` (#105) by Fabian Meumertzheim · 2 months ago
  5. 1a86fd6 Update version range for `has_launcher_maker_toolchain` (#104) by Fabian Meumertzheim · 3 months ago

Bazel Features

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.

Accessing globals

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.