rules_cc icon indicating copy to clipboard operation
rules_cc copied to clipboard

Document recommendation for "marker" features in rules based toolchain

Open keith opened this issue 11 months ago • 0 comments

Bazel has quite a few "marker" type features where their presence in the toolchain is used as a signal that it supports some configuration. Here are a few examples:

https://github.com/bazelbuild/apple_support/blob/af8d93a33586c80bf2d245922ce31fcd109fe645/crosstool/cc_toolchain_config.bzl#L2666-L2678

In this case with the rules based toolchain I've found I can generally do:

cc_feature(
    name = "archive_param_file",
    feature_name = "archive_param_file",
)

and then shoving those in enabled_features or known_features. This works fine but I wonder if it's worth trying to reduce the overhead of this for these types of features? Especially since the potential names are technically special, and we likely don't want to encourage folks to copy paste them everywhere. Maybe we should add all of these definitions to this repo, and then allow users to pull them in still?

keith avatar Jan 29 '25 17:01 keith