bazelbuild / bazelbuild/rules_cc

Document recommendation for "marker" features in rules based toolchain

Open
#333 0 comments 1 reaction 1 assignee Claimed by @armandomontanez View on GitHub
category: toolchains untriaged
Dominant language
Starlark
Stars
247
Forks
196
PR merge metrics
No merged PRs in 30d

Description

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:

```bzl
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.