Bug#1061388: sbuild doesn't support autotpkgest-virt-incus: Error: mkdir /sbuild-nonexistent: permission denied

2024-02-25 Thread Johannes Schauer Marin Rodrigues
Hi Stefano & Christian,

On Tue, 23 Jan 2024 14:30:07 + stefa...@debian.org wrote:
> Hi Debian (2024.01.23_13:41:47_+)
> > This seems to be because "incus exec" is trying to write ~/.config/incus,
> > but HOME has been set to /sbuild-nonexistent outside it.
> 
> Filed an incus upstream bug about handling this situation more gracefully:
> https://github.com/lxc/incus/issues/422

in that issue you asked exactly the question I was about to ask you. :)

Though it seems incus should now be able to deal gracefully with the situation
and there is nothing else that sbuild needs to do to handle this, correct?

Note, that the autopkgtest/podman backend has a similar issue, see #1033352 for
details. To fix this, Christian submitted this MR against sbuild:

https://salsa.debian.org/debian/sbuild/-/merge_requests/55

Reading how incus worked around this problem, maybe podman can do the same?

Thanks!

cheers, josch

signature.asc
Description: signature


Bug#1061388: sbuild doesn't support autotpkgest-virt-incus: Error: mkdir /sbuild-nonexistent: permission denied

2024-01-23 Thread stefanor
Hi Debian (2024.01.23_13:41:47_+)
> D: Running command: incus exec autopkgtest-lxd-ltsezo -- strace -f -A -o 
> /tmp/strace.log env LC_ALL=C.UTF-8 LANG=en_US.UTF-8 HOME=/sbuild-nonexistent 
> DEB_BUILD_OPTIONS=parallel=16 SHELL=/bin/sh sh -c cd / && exec "$@" exec perl 
> -e

Err there was some debugging stuff in there, obviously :)

> This seems to be because "incus exec" is trying to write
> ~/.config/incus, but HOME has been set to /sbuild-nonexistent outside
> it.

Filed an incus upstream bug about handling this situation more
gracefully: https://github.com/lxc/incus/issues/422

Stefano

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272



Bug#1061388: sbuild doesn't support autotpkgest-virt-incus: Error: mkdir /sbuild-nonexistent: permission denied

2024-01-23 Thread Stefano Rivera
Package: sbuild
Version: 0.85.4
Severity: normal

I have been successfully using sbuild with lxd (installed from snap) for
a couple of years now, via the autopkgtest build backend.

Migrating to incus broke sbuild, resulting in:

D: Running command: incus exec autopkgtest-lxd-ltsezo -- strace -f -A -o 
/tmp/strace.log env LC_ALL=C.UTF-8 LANG=en_US.UTF-8 HOME=/sbuild-nonexistent 
DEB_BUILD_OPTIONS=parallel=16 SHELL=/bin/sh sh -c cd / && exec "$@" exec perl -e
...
Error: mkdir /sbuild-nonexistent: permission denied
D: Error run_chroot_session(): Error locking chroot session: skipping 
beautifulsoup4Keeping session: /tmp/autopkgtest.f2BSkb
D: Setting Session=undef
D: Error run_chroot(): Error locking chroot session: skipping beautifulsoup4E: 
Error locking chroot session: skipping beautifulsoup4
D: Setting Pkg Status=failed
D: Setting Pkg Fail Stage=lock-session

This seems to be because "incus exec" is trying to write
~/.config/incus, but HOME has been set to /sbuild-nonexistent outside
it.

https://github.com/lxc/incus/blob/e5690705e842d3961d8a1d18c0ec002c25345af8/cmd/incus/main_aliases.go#L162-L175

I think Sbuild could not set HOME as part of the environment when
calling the autopkgtest backend. It is explicitly set via the env
command in the arguments to the backend, so it souldn't be set outside
it too.

There are also other ways this could be hacked around...
Locally, I'll set INCUS_CONF, to override the HOME.

Stefano

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-5-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages sbuild depends on:
ii  adduser 3.137
ii  libsbuild-perl  0.85.4
ii  perl5.38.2-3

Versions of packages sbuild recommends:
ii  autopkgtest  5.32
ii  debootstrap  1.0.134
ii  schroot  1.6.13-3+b3
ii  uidmap   1:4.13+dfsg1-3+b1

Versions of packages sbuild suggests:
pn  deborphan  
ii  e2fsprogs  1.47.0-2+b1
ii  kmod   31-1
ii  wget   1.21.4-1+b1

-- no debconf information