Open
Description
We have a library, which has feature A.
One crate that depends on it does not need feature A, and so it is not enabled.
A second crate does need the feature on the library, and so it is enabled.
Our current solution in Bazel is:
- Define the bazel
rust_library
target twice, one has the feature enabled and one doesn't, naming the one that doesmy_crate_feature
- On the first crate, we add
//path/to/my_crate
todeps
- On the second crate, we add
//path/to/my_crate:my_crate_feature
todeps
- And also add
{ "//path/to/my_crate:my_crate_feature" : "my_crate" }
toaliases
.
This works, but I have an inkling feeling that we are doing it wrong.
Is this the correct way? How else could we tackle this scenario?
Thanks for any advice,