Skip to main content

flowey_lib_hvlite/
cfg_rustup_version.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! A configuration node that configures the Rust toolchain version to use in
5//! OpenVMM pipelines. Having a separate node dedicated for this allows us to
6//! patch this node internally where the rustup toolchain is not available.
7//! This node also allows us to decouple the rustup version used in oss/internal.
8
9use flowey::node::prelude::*;
10
11pub const RUSTUP_TOOLCHAIN: &str = "1.95.0";
12
13new_simple_flow_node!(struct Node);
14
15impl SimpleFlowNode for Node {
16    type Request = Request;
17
18    fn imports(ctx: &mut ImportCtx<'_>) {
19        ctx.import::<flowey_lib_common::install_rust::Node>();
20    }
21
22    fn process_request(_: Self::Request, ctx: &mut NodeCtx<'_>) -> anyhow::Result<()> {
23        ctx.config(flowey_lib_common::install_rust::Config {
24            version: Some(RUSTUP_TOOLCHAIN.into()),
25            ..Default::default()
26        });
27        Ok(())
28    }
29}
30
31flowey_request! {
32    pub enum Request {
33        Init,
34    }
35}