rules_rust
rules_rust copied to clipboard
Conditional compilation deps
- addresses https://github.com/bazelbuild/rules_rust/issues/1950
- This is a WIP and i want more input before I continue. This takes care of the
cfg_expruse case of theFlagpredicate. AKAcfg(tokio_unstable)orcfg(tokio_dump) - Added a new bzl mod example, to show this base use case is fufilled .
- This takes care of the rustc_flags use case of
--cfg tokio_unstableor--cfg tokio_coredump - @UebelAndre I would like your input on this approach before I take care of any of the other predicate use cases in
cfg_exprSome of my thoughts are, do we need to add metadata to CrateDependency to say we injected this value? Could this be leveraged in the future for optional dependencies so they dont have to be declared explicitly in the library? What were you looking to resolve in ?https://github.com/bazelbuild/rules_rust/issues/1950 - After the questions / vision of this feature is resolved, will add full documentation + unit tests + more conditional cfg types in the bzl mod example.