deb: default to ephemeral context with local builds
Some checks failed
CI / build (push) Failing after 1m28s

This commit is contained in:
2026-01-06 18:15:05 +01:00
parent 1c9f6cccd2
commit f3417c7a16
3 changed files with 154 additions and 156 deletions

View File

@@ -1,4 +1,5 @@
mod cross;
mod ephemeral;
mod local;
mod sbuild;
@@ -42,21 +43,13 @@ pub fn build_binary_package(
let mode = if let Some(m) = mode {
m
} else {
// For cross-compilation, we use local with an ephemeral context
// created by the cross-compilation handler (see below)
if cross {
BuildMode::Local
} else {
// By default, we use sbuild
BuildMode::Sbuild
}
// By default, we use local build
BuildMode::Local
};
// Specific case: native cross-compilation, we don't allow that
// instead this wraps to an automatic unshare chroot
// using an ephemeral context
let _guard = if cross && mode == BuildMode::Local {
Some(cross::EphemeralContextGuard::new(series)?)
// Create an ephemeral unshare context for all Local builds
let _guard = if mode == BuildMode::Local {
Some(ephemeral::EphemeralContextGuard::new(series)?)
} else {
None
};