bazelbuild / bazelbuild/rules_rust
Add enabled_cfgs attribute
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Instead of having `--cfg ` prefix for all the cfg-related flags in `rustc_flags` attr, we could introduce an attribute just for `cfg`s so that
1. The attribute values become less verbose
2. Rule implementation avoids [this error-prone assumption](https://github.com/bazelbuild/rules_rust/blob/210772061d2b693726dba25fa3758ef79b2a707a/rust/private/rust_analyzer.bzl#L68). If we specify `--cfg 'foo'` (two spaces) instead of `--cfg 'foo'` (one space), [flag[6:]](https://github.com/bazelbuild/rules_rust/blob/210772061d2b693726dba25fa3758ef79b2a707a/rust/private/rust_analyzer.bzl#L68) captures the extra space before the flag value.
Contributor guide
Assessment
This issue has not been assessed yet.