deb: add -j/--jobs to control parallel build jobs

By default the number of parallel jobs is detected with nproc inside
the build context. Add a -j/--jobs option so an explicit count can be
honored instead, threading it through build_binary_package and
local::build into DEB_BUILD_OPTIONS=parallel=N.
This commit is contained in:
2026-09-10 15:27:50 +02:00
parent 348abf61b9
commit 182a06ffbe
3 changed files with 35 additions and 15 deletions
+5
View File
@@ -33,6 +33,7 @@ pub async fn build_binary_package(
inject_packages: Option<&[&str]>,
ctx: Option<Arc<Context>>,
ui: Option<Arc<DebUi>>,
jobs: Option<usize>,
) -> Result<Vec<PathBuf>, Box<dyn Error>> {
let result = build_binary_package_impl(
arch,
@@ -45,6 +46,7 @@ pub async fn build_binary_package(
inject_packages,
ctx,
&ui,
jobs,
)
.await;
@@ -68,6 +70,7 @@ async fn build_binary_package_impl(
inject_packages: Option<&[&str]>,
ctx: Option<Arc<Context>>,
ui: &Option<Arc<DebUi>>,
jobs: Option<usize>,
) -> Result<Vec<PathBuf>, Box<dyn Error>> {
let cwd = cwd.unwrap_or_else(|| Path::new("."));
@@ -160,6 +163,7 @@ async fn build_binary_package_impl(
inject_packages,
build_ctx.clone(),
ui.clone(),
jobs,
)
.await?
}
@@ -414,6 +418,7 @@ mod tests {
None,
Some(ctx),
None,
None,
)
.await
.expect("Cannot build binary package (deb)");