Created attachment 1539269 [details] Example log file showing test failure Description of problem: Package builds OK but the *-network part of the testsuite fails. PASS: test-basic.sh PASS: test-execstack.sh PASS: test-build-bash.sh PASS: test-binaries-exist.sh PASS: test-harder.sh FAIL: test-build-bash-network.sh FAIL: test-binaries-exist-network.sh FAIL: test-harder-network.sh Version-Release number of selected component (if applicable): supermin-5.1.20 How reproducible: 100% Steps to Reproduce: 1. build supermin on Arch Linux using the recommended chroot (makechrootpkg) 2. run `make check' 3. Actual results: Failed tests as per above Expected results: All tests should pass Additional info: This blocks the build of libguestfs because the appliance fails to build. The test seems to get stuck in some kind of loop as per the attached log file for example. Any help debugging this would be appreciated.
For the record, I ended up being able to build libguestfs by passing: --with-supermin-extra-options="--use-installed" to the libguestfs configure script.
tar: /var/tmp/supermin469d72.tmpdir/d1jcezvx/*.pkg.tar.xz: Cannot open: No such file or directory The failure seems to happen in this function: https://github.com/libguestfs/supermin/blob/bca633bfd14aeeb8ae1331d468db75d1ef31f9ff/src/ph_pacman.ml#L164 but I don't know how Arch packaging works or has changed for why this is now broken, however patches welcome. Using --use-installed is not recommended.
Created attachment 1555733 [details] supermin-pacman.patch
The pacman package handler wants to "Unpack the downloaded packages" but the packages are just not there in the tmpdir where the code expects them to be. pacman uses a download cache as part of its normal operation, so just getting rid of the unpack clause is enough to make it all work. I've attached a simple patch which allows the testsuite to pass. Not sure if this is the correct approach.
That's not going to work because supermin will then ignore all configuration files. You'll likely find that the generated tarball base.tar.gz from this command now has no files, whereas it should contain both directories and configuration files: $ supermin --prepare -o /tmp/supermin.d bash $ ls -l /tmp/supermin.d
You're right. I was barking up the wrong tree.. But I've figured out what's going on now. A default /etc/pacman.conf does not include a CacheDir directive, in which case pacman assumes a default of /var/cache/pacman/pkg. The supermin code adds `--cachedir=$(pwd)' to the pacman commandline which satisfactorily overrides the default and forces packages to be downloaded i.e. supermin works. Things go pear shaped when there is more than 1 CacheDir directive in /etc/pacman.conf, which is often the case for more advanced users who are also running a custom personal package repo. In this scenario pacman *adds* `--cachedir=$(pwd)' to the *existing* cache dirs and refuses to download the packages because they are already in a CacheDir i.e. supermin breaks. I can work around the issue with something like: grep -v CacheDir /etc/pacman.conf > /tmp/pacman.conf supermin --prepare --packager-config=/tmp/pacman.conf ... Though, it does seem rather unnecessary for supermin to go and download packages when perfectly up-to-date copies are sitting in a local cache dir. It would be nice if supermin could somehow pull them from the cache. I'm sure the code could be made smarter but this is starting to get above my pay grade.
Revisiting this one after latest libguestfs release. I've attached a patch which makes the supermin testsuite pass. This allows me to finally get libguestfs working in the optimal recommended fashion on Arch. pacman-conf is part of pacman itself and has been around since mid 2018. Due to the rolling release nature of Arch, it's pretty well guaranteed to be present on every Arch system. I raised this issue with the pacman devs and there weren't any complaints. https://bugs.archlinux.org/task/66182
Created attachment 1679966 [details] Fix pacman CacheDir handling
I pushed it, thanks: https://github.com/libguestfs/supermin/commit/c05b77000f6a13ac2932121bd625574eea6d5a80
I'm attaching another 2 patches for related fixes. Thanks.
Created attachment 1691477 [details] pacman-Fix-package-file-extensions
Created attachment 1691478 [details] pacman-Fix-loop-when-downloading-packages
Thanks, I've pushed both patches upstream. Can we close this bug now or are there further issues?