bazelbuild / bazelbuild/rules_rust
Support per package defaults for edition and cargo_features
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Currently `rust_library`, `rust_test`, `rust_binary`, etc.. support the `edition` and `crate_features` options. There is also currently a way to [set per-toolchain edition defaults](https://github.com/bazelbuild/rules_rust/pull/188).
However, when writing a BUILD file for a cargo package by hand (like is needed for [*ring*](https://github.com/briansmith/ring/pull/822)), there is no way to have all the rust targets use the same `edition` and `feature_set` by default. It would be nice if there were a `rust_package` rule that had `default_edition` and `default_features` paramaters, so that I don't have to keep writing
```python
edition = "2018",
crate_features = ["dev_urandom_fallback", "use_heap"]
```
for the ~20 or so `rust_library`/`rust_test` rules for ring. I would also be happy to sumbit a PR, if someone known where in the codebase to get started for adding a feature like this.
Contributor guide
Assessment
This issue has not been assessed yet.