Build some crates with nightly compiler and some with stable -- automatically #1955
-
Hi, First off -- thanks all for working on rules_rust. It is really helpful. My question is how to support building some crates with nightly and some with stable rustc without using any bazel command line arguments. I know I can add For an example, say I have a WORKSPACE with two crates, I would like to build (and my users to build) these crates without knowing about specifying any command line args. So the following is the goal:
Question 1: Has anyone does this already? I gather it might involve writing a transition rule that transitions to use the nightly compiler. Any examples of transitions and rules_rust to look at? Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You'd need to write a rule that transitions on
This will allow you to have top level targets that are explicitly built for stable or nightly compilers. |
Beta Was this translation helpful? Give feedback.
You'd need to write a rule that transitions on
@rules_rust//rust/toolchain/channel
. We do transitions for the unit testing of this build setting here but to get into the details of actually writing a rule that transitions I'd see:This will allow you to have top level targets that are explicitly built for stable or nightly compilers.