🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by David Kalnischkies Wed, 07 Oct 2026 20:30
Bug#1150273: autopkgtest: unshare does not reuse sbuild tarballs if XDG_CACHE_HOME is set
#89
Author: David Kalnischkies
Date: Wed, 07 Oct 2026 20:30
94 lines
5600 bytes
--ndw7ypqvtt5ly5x6
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: autopkgtest: unshare does not reuse sbuild tarballs if
 XDG_CACHE_HOME is set
MIME-Version: 1.0

Package: autopkgtest
Version: 6.0
Severity: normal
File: /usr/bin/autopkgtest-virt-unshare
Tags: patch


Hi,

As per subject, if in your environment the variable XDG_CACHE_HOME is
set (and you don't pick a tarball explicitly with -t),
autopkgtest-virt-unshare will not pick up files from the directory
"${XDG_CACHE_HOME}/sbuild" but instead tries to attempt picking tarballs
=66rom "/sbuild" ~ which probably fails, causing the automatic tarball
creation to step in (~ which probably works, but is a waste in this case).

This is due to the way the path is joined as joinpath() is documented
| Calling this method is equivalent to combining the path with each of
| the given pathsegments in turn

which implicitly refers to PurePath() documentation containing this:
| If a segment is an absolute path, all previous segments are ignored
| (like os.path.join())

So, the issue should be easy to resolve (tested locally):
```diff
--- a/virt/autopkgtest-virt-unshare
+++ b/virt/autopkgtest-virt-unshare
@@ -115,7 +115,7 @@ def parse_args():
         xdg_cache_home =3D pathlib.Path("~/.cache/sbuild").expanduser()
         if "XDG_CACHE_HOME" in os.environ:
             xdg_cache_home =3D pathlib.Path(os.environ["XDG_CACHE_HOME"]).=
joinpath(
-                "/sbuild"
+                "sbuild"
             )

         chroots =3D xdg_cache_home.glob(f"{args.release}-{args.arch}.t*")
```

If joinpath() didn't change behaviour, which seems likely, I presume
this was broken since unshare got implemented, just that it isn't used
much and for many folks the automatic tarball creation probably works
fine; the time/data waste compared to just reusing the cached sbuild
chroot is neglectable for them.

Maybe there should be a (debug) message indicating where autopkgtest
tries to look for tarballs. I did not add one through to not blow up
the diff & as -d and -dd did not activate the existing debug messages
in that code area for me.


If you wonder why this variable is set: guix ships a /etc/profile.d
snippet setting it (and a few more). diffoscope recommends guix.
apt helpfully installed guix for me recently as a new recommends,
subsequently sending me down various rabbit holes investigating
why everything broke for me for 'no reason' in strange ways=E2=80=A6
including my own apt testing. APT is so heartless (sometimes).


Best regards

David Kalnischkies

--ndw7ypqvtt5ly5x6
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE5sn+Q4uCja/tn0GrMRvlz3HQeIMFAmrGqrQACgkQMRvlz3HQ
eIMA8w//bJzZJMf46RFWZessyFlmRaS526/2VHMgBmPcFYgFhnebdZe1lRT+UGh+
Nm6Bys/pPVeXLK17wmEhklX2SSh/vq7XSM6z31whb8+zRe5/g/+NKPFoTMXD/EBM
sMwkGra4Se//bmrN9rpCvkS+qZOM/jpKakk9khtxb3il3oT80oW6KkaWu2LOMY8x
EjlLCH4Jp/behrxifnw+F0MjF/wVYKoDJtXrnvZ3U8Ikbsh36iiG94M0PbxUFpUM
NRU3A47hcH78ObQ9cpDl78ybhUgLCnTVzmnOOvOvhVztZe+Ax+Wa5x1OvUCmDgZR
YQU2NodzDYhjTQap6GQx6/vPZitL9IHM3WKadQUKJdgldxKW99xQqXJbhBSKr+Yg
adb5obFH+axlbMFYAcPVZaOSrXEjLxXl05NI8fyz89AhQ+X3vZhoLMkfyDVq7NF7
y1Z9E3WODPNy3EmYp6ew6QDIghQSyzLuodin9bOKIPZa3/UrVnEyqFsDaFYM5QoG
6BR75P/GN9w1XiH5WHdAxWXnQu/6HQii//M8q5X0YvGUKS/vL4Az1sVthZ0mkWuX
Cbkk9K26RfoZTWaMKobXE8M+wE4grZKnIUX3ucJHOSB8sk9x6qE1cW+bTpENb3RF
UuEdTANqRBHM+IGsf8JXLVVjaDoSGfdeaNM9afQQKdINr7WZvMY=
=yLjt
-----END PGP SIGNATURE-----

--ndw7ypqvtt5ly5x6--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads