deb: allow use parallel building
All checks were successful
CI / build (push) Successful in 10m29s

This commit is contained in:
2026-01-26 10:31:58 +01:00
parent dfd197415f
commit 13c44daf9a

View File

@@ -24,6 +24,26 @@ pub fn build(
let ctx = context::current();
// Parallel building: find local number of cores, and use that
let num_cores = ctx
.command("nproc")
.output()
.map(|output| {
if output.status.success() {
String::from_utf8_lossy(&output.stdout)
.trim()
.parse::<usize>()
.unwrap_or(1)
} else {
1 // Default to 1 if nproc fails
}
})
.unwrap_or(1); // Default to 1 if we can't execute the command
env.insert(
"DEB_BUILD_OPTIONS".to_string(),
format!("parallel={}", num_cores),
);
if cross {
log::debug!("Setting up environment for local cross build...");
cross::setup_environment(&mut env, arch)?;