Bug: 345301870

Clone this repo:
  1. 6b445cb Upgrade bazel_features to v1.45.0 am: ba082f99f7 by HONG Yifan · 3 months ago main-kernel
  2. ba082f9 Upgrade bazel_features to v1.45.0 by HONG Yifan · 3 months ago mirror-goog-main-external
  3. 8e514d2 Add repo_rules_relativize_symlinks (#139) by David Zbarsky · 4 months ago upstream/v1.45.0
  4. 9f66dfd Add feature for cc.compile_is_starlark (#136) by Philip Zembrod · 4 months ago upstream/v1.44.0
  5. c5b8e31 chore(deps): update dependency protobuf to v33.6 (#135) by renovate[bot] · 4 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.