rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Conditional compilation deps

Open ericmcbride opened this issue 1 year ago • 0 comments

  • 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_expr use case of the Flag predicate. AKA cfg(tokio_unstable) or cfg(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_unstable or --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_expr Some 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.

ericmcbride avatar Apr 08 '24 14:04 ericmcbride