download_and_cache_version

Function download_and_cache_version 

Source
pub fn download_and_cache_version(
    version: &str,
    cli_label: &str,
    cpu_cap: Option<CpuCap>,
    mp: Option<&FetchProgress>,
) -> Result<PathBuf>
Expand description

Download a specific kernel version, build it, and store in the cache. Returns the cache entry directory path (NOT the image path).

Checks the cache one more time with the resolved version to cover races and prefix-resolved entries. Delegates to kernel_build_pipeline for configure/build/validate/cache.

cpu_cap forwards the resource-budget cap to the pipeline so the LLC flock + cgroup sandbox phases honour it. None means “reserve 30% of the allowed-CPU set” (see CpuCap::resolve).

mp is the progress group spanning BOTH the download and the build: the parallel resolve’s shared group, or None for a single-shot caller (shell auto-fetch, monitor, auto-download), in which case a local group is created here and passed through to kernel_build_pipeline. The build renders through this same group (as step_bar spinners), so the group stays live across the build with no standalone Spinner to collide with.