Ways to build transitive dependencies with varying flags? #1318
Unanswered
gburgessiv
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(I'm semi-new to writing bazel code beyond
cc_binary(...)
; apologies in advance if I confuse terms)Hey,
I'm trying to figure out how to build the same
rust_library
with varying rust flags, depending on the needs of the users of the library. Concretely, I'd like to start by offering my users two options when building arust_binary
:rust_binary
.rust_binary
.I can make either of these happen for a single
bazel build
viaextra_rustc_flags
, and after chatting with folks on the Bazel Slack, it sounds like transitions are likely to be the hammer I want here. I was able to get this to... work with an extra level of indirection and some macro magic.I was wondering if this is what's roughly expected as the solution to my problem? Am I maybe overcomplicating things/missing a simpler way to go about this? :)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions