bazelbuild / bazelbuild/rules_rust
bindgen: Place generated files into an `OUT_DIR`
Open
bindgen
needs-design
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
A common pattern when using bindgen is to include the generated file from a build script's `OUT_DIR` ([example](https://rust-lang.github.io/rust-bindgen/tutorial-4.html)). The `rust_bindgen` rule already returns the [`BuildInfo`](https://github.com/bazelbuild/rules_rust/blob/5e426fa427f6ce197da281233525cc486dfdf07c/extensions/bindgen/private/bindgen.bzl#L178-L187) provider so adding a `use_out_dir` attr to the `rust_bindgen` rule that would create a directory and place the generated artifacts into it, seems like it could make the migration from a Cargo build script to a Bazel rule easier.
Contributor guide
Assessment
This issue has not been assessed yet.