diff --git a/src/cargo/core/compiler/build_config.rs b/src/cargo/core/compiler/build_config.rs index 54b2fd9b12c..31cd3e3da53 100644 --- a/src/cargo/core/compiler/build_config.rs +++ b/src/cargo/core/compiler/build_config.rs @@ -1,7 +1,7 @@ use crate::core::compiler::CompileKind; use crate::util::interning::InternedString; use crate::util::{CargoResult, Config, RustfixDiagnosticServer}; -use anyhow::bail; +use anyhow::{bail, Context as _}; use cargo_util::ProcessBuilder; use serde::ser; use std::cell::RefCell; @@ -73,7 +73,9 @@ impl BuildConfig { } let jobs = match jobs.or(cfg.jobs) { Some(j) => j, - None => available_parallelism()?.get() as u32, + None => available_parallelism() + .context("failed to determine the amount of parallelism available")? + .get() as u32, }; if jobs == 0 { anyhow::bail!("jobs may not be 0");