Compare commits
3 Commits
2f5fb3b1e7
...
13c44daf9a
| Author | SHA1 | Date | |
|---|---|---|---|
|
13c44daf9a
|
|||
|
dfd197415f
|
|||
|
73a61042e8
|
@@ -208,7 +208,7 @@ impl UnshareDriver {
|
||||
}
|
||||
|
||||
cmd.arg("--").arg("bash").arg("-c").arg(format!(
|
||||
"mount -t proc proc /proc; mount -t devpts devpts /dev/pts; mount --bind /dev/pts/ptmx /dev/ptmx; {} {}",
|
||||
"mount -t proc proc /proc; mkdir /dev/pts; mount -t devpts devpts /dev/pts; touch /dev/ptmx; mount --bind /dev/pts/ptmx /dev/ptmx; {} {}",
|
||||
program,
|
||||
args.join(" ")
|
||||
));
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
@@ -277,6 +277,11 @@ mod tests {
|
||||
/// The GCC package is complex and hard to build, with specific stages
|
||||
/// and system-bound scripts. Building it requires specific things that
|
||||
/// we want to ensure are not broken.
|
||||
/// NOTE: Ideally, we want to run this in CI, but it takes more than 20h
|
||||
/// to fully build the gcc-15 package on an amd64 builder, which is too
|
||||
/// much time.
|
||||
#[ignore]
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
#[tokio::test]
|
||||
#[test_log::test]
|
||||
#[serial]
|
||||
|
||||
Reference in New Issue
Block a user