Control: retitle -1 autopkgtest-build-qemu: fails with non-default TMPDIR
On Thu, 05 Mar 2026 at 10:22:10 -0500, Roberto C. Sánchez wrote:
with the newer versions of these
packages (and perhaps the dependencies), I was able to see that the
exit status 100 was being caused by this:
mktemp: failed to create file via template ‘/tmp/user/0/tmp.XXXXXXXXXX’: No
such file or directory
I use pam_tmpdir on my systems, and this was apparently causing the
problem.
Ah, that makes sense. It looks like the problem here is with environment
variables from your (root) shell being inherited by the processes that
run inside the system-under-construction: *some* environment variables
from the host make sense to propagate like this, but the TMPDIR from the
host system isn't applicable in the system-under-construction (it exists
on the host system, but does not exist in the
system-under-construction), causing this failure.
Another way to express this would be to say that the problem is with
vmdb2 chroot'ing into the system-under-construction, as opposed to
behaving like a container manager and isolating the
system-under-construction from the host more thoroughly (starting with
`env -i`, and then adding back in only an allowlist of environment
variables).
In autopkgtest-build-docker (aka a-b-podman), which does isolate the
container from the host more thoroughly, there's a list of environment
variables that are explicitly copied from host to container
(SETUP_TESTBED_ARGS). Probably autopkgtest-build-qemu and/or vmdb2
should ideally do something similar.
Unsetting TMPDIR and maybe TMP would likely be a workaround for this
specific issue, although it would presumably still be possible to break
a-b-qemu with different environment variables that similarly refer to a
path that only exists on your host system and therefore don't make much
sense to copy across the chroot/container boundary.
sudo sh -c 'TMP=/tmp TMPDIR=/tmp autopkgtest-build-qemu bookworm
./autopkgtest-bookworm.img'
Is
sudo env -u TMPDIR autopkgtest-build-qemu bookworm
./autopkgtest-bookworm.img
sufficient? (I think it probably is)
smcv