deb: point the build HOME at a chroot-internal scratch directory
The build context inherits pkh's environment, so the rules ran with HOME set to the invoking user's host path - which does not exist inside the chroot. Tools keying user config on HOME then fail mid-build: gdb's doc build dies in texi2dvi because the TeX live setup cannot use the nonexistent home. Point HOME at /tmp/pkh-home, created through the build context (all drivers: local, unshare chroot, ssh, schroot). sbuild uses a non-writable path, Launchpad's buildd user a real one; a writable scratch directory matches the latter.
This commit is contained in:
@@ -148,6 +148,23 @@ pub async fn build(
|
||||
format!("parallel={} nocheck", num_cores),
|
||||
);
|
||||
|
||||
// The build context inherits pkh's environment: without an override,
|
||||
// HOME is the invoking user's host path, which does not exist inside
|
||||
// the chroot - tools keying user config on it (texi2dvi's TeX live
|
||||
// setup, anything writing dotfiles) then fail mid-build. sbuild points
|
||||
// HOME at a non-writable path, Launchpad's buildd user at a real one;
|
||||
// a writable scratch directory matches the latter.
|
||||
env.insert("HOME".to_string(), "/tmp/pkh-home".to_string());
|
||||
let status = ctx
|
||||
.command("mkdir")
|
||||
.arg("-p")
|
||||
.arg("/tmp/pkh-home")
|
||||
.status()
|
||||
.map_err(|e| format!("cannot create the build HOME: {e}"))?;
|
||||
if !status.success() {
|
||||
return Err("cannot create the build HOME (/tmp/pkh-home)".into());
|
||||
}
|
||||
|
||||
if cross {
|
||||
log::debug!("Setting up environment for local cross build...");
|
||||
cross::setup_environment(&mut env, arch, ctx.clone())?;
|
||||
|
||||
Reference in New Issue
Block a user