Skip to main content

flowey_lib_hvlite/_jobs/
build_openhcl_igvm_from_recipe_nix.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! Composite job node that wires together Nix configuration and the OpenHCL
5//! IGVM build-and-publish step.
6//!
7//! This node exists so that both the local `build-reproducible` pipeline and
8//! future CI jobs can share the same wiring without divergence.
9//!
10//! Note: `cfg_hvlite_reposource` is intentionally excluded, since pipelines
11//! like `checkin_gates` inject it across all jobs via `inject_all_jobs_with`.
12
13use crate::_jobs::build_and_publish_openhcl_igvm_from_recipe::OpenhclIgvmBuildParams;
14use crate::_jobs::build_and_publish_openhcl_igvm_from_recipe::OpenhclIgvmOutputs;
15use crate::common::CommonArch;
16use crate::resolve_openhcl_kernel_package::OpenhclKernelPackageKind;
17use flowey::node::prelude::*;
18
19flowey_request! {
20    pub struct Params {
21        pub arch: CommonArch,
22        pub kernel_kind: OpenhclKernelPackageKind,
23        pub igvm_files: Vec<(OpenhclIgvmBuildParams, OpenhclIgvmOutputs)>,
24    }
25}
26
27new_simple_flow_node!(struct Node);
28
29impl SimpleFlowNode for Node {
30    type Request = Params;
31
32    fn imports(ctx: &mut ImportCtx<'_>) {
33        ctx.import::<crate::_jobs::cfg_nix::Node>();
34        ctx.import::<crate::_jobs::build_and_publish_openhcl_igvm_from_recipe::Node>();
35    }
36
37    fn process_request(request: Self::Request, ctx: &mut NodeCtx<'_>) -> anyhow::Result<()> {
38        let Params {
39            arch,
40            kernel_kind,
41            igvm_files,
42        } = request;
43
44        ctx.req(crate::_jobs::cfg_nix::Params { arch, kernel_kind });
45
46        ctx.req(crate::_jobs::build_and_publish_openhcl_igvm_from_recipe::Params { igvm_files });
47
48        Ok(())
49    }
50}