Clone this repo:
  1. f609c31 chore(deps): update dependency bazel to v9.0.1 (#134) by renovate[bot] · 29 hours ago upstream/main
  2. afd1c52 Add feature for starlark cc_toolchain (#133) by David Zbarsky · 3 days ago v1.43.0
  3. f706fb8 Update symlink_action_has_target_type to include Bazel 8.6.0 (#129) by Mihail Vratchanski · 3 days ago
  4. 0b1ba9d Fix "removed in" version for CcSharedLibraryHintInfo (#132) by Fabian Meumertzheim · 7 days ago v1.42.1
  5. 7565ad6 Add feature for `mnemonic` on `ctx.actions.write` (#130) by Rahul Butani · 2 weeks ago v1.42.0

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.