Skip to content

Commit 4f706ae

Browse files
committed
Wrap an error context for determining the amount of parallelism
1 parent 1988bc8 commit 4f706ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cargo/core/compiler/build_config.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::core::compiler::CompileKind;
22
use crate::util::interning::InternedString;
33
use crate::util::{CargoResult, Config, RustfixDiagnosticServer};
4-
use anyhow::bail;
4+
use anyhow::{bail, Context as _};
55
use cargo_util::ProcessBuilder;
66
use serde::ser;
77
use std::cell::RefCell;
@@ -73,7 +73,9 @@ impl BuildConfig {
7373
}
7474
let jobs = match jobs.or(cfg.jobs) {
7575
Some(j) => j,
76-
None => available_parallelism()?.get() as u32,
76+
None => available_parallelism()
77+
.context("failed to determine the amount of parallelism available")?
78+
.get() as u32,
7779
};
7880
if jobs == 0 {
7981
anyhow::bail!("jobs may not be 0");

0 commit comments

Comments
 (0)