Better debug of failed of test dependencies
In Ubuntu quite often things got build against packages in the -proposed pocket but might get tested withotu proposed enabled. That leads to an error of autopkgtest-satdep being removed.
Unfortunately in those cases the actual "offending" packages are not listed in the output, so users have to recreate locally instead of going for the solution (enable the right extra packages).
To solve that add to the error path the ouput of a basic apt install call with the test dependencies - that will report the missing dependency in a more readable way.
Example - pre fix:
autopkgtest [08:18:17]: test daemon: preparing testbed
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies...Starting pkgProblemResolver with broken count: 2
Starting 2 pkgProblemResolver with broken count: 2
Investigating (0) strongswan-tnc-base:amd64 < none -> 5.7.1-1ubuntu1~ppa3 @un uN Ib >
Broken strongswan-tnc-base:amd64 Depends on libstrongswan-extra-plugins:amd64 < none | 5.7.1-1ubuntu1~ppa3 @un uH >
Considering libstrongswan-extra-plugins:amd64 2 as a solution to strongswan-tnc-base:amd64 0
Holding Back strongswan-tnc-base:amd64 rather than change libstrongswan-extra-plugins:amd64
Investigating (0) autopkgtest-satdep:amd64 < 0 @iU mK Nb Ib >
Broken autopkgtest-satdep:amd64 Depends on libstrongswan-extra-plugins:amd64 < none | 5.7.1-1ubuntu1~ppa3 @un uH >
Considering libstrongswan-extra-plugins:amd64 2 as a solution to autopkgtest-satdep:amd64 -2
Removing autopkgtest-satdep:amd64 rather than change libstrongswan-extra-plugins:amd64
Investigating (1) libcharon-extra-plugins:amd64 < none -> 5.7.1-1ubuntu1~ppa3 @un uN Ib >
Broken libcharon-extra-plugins:amd64 Depends on strongswan-tnc-base:amd64 < none | 5.7.1-1ubuntu1~ppa3 @un uH >
Considering strongswan-tnc-base:amd64 0 as a solution to libcharon-extra-plugins:amd64 0
Holding Back libcharon-extra-plugins:amd64 rather than change strongswan-tnc-base:amd64
Done
Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages will be REMOVED:
autopkgtest-satdep
I found that the reason was autopkg's trcik with the autopkg-satdep package. If I did what users expect naively I'd see the messages I was missing:
$ sudo apt-get install strongswan libstrongswan-standard-plugins libstrongswan-extra-plugins libcharon-extra-plugins
[...]
Broken libstrongswan-extra-plugins:amd64 Depends on libunbound8:amd64 < none @un H > (>= 1.8.0)
[...]
The following packages have unmet dependencies:
libstrongswan-extra-plugins : Depends: libunbound8 (>= 1.8.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
But with the satdep package the same was not true and the useful info was missing
$ dpkg --unpack /tmp/autopkgtest.GuALy1/autopkgtest-satdep.deb
$ apt-get install --assume-yes --fix-broken -o APT::Status-Fd=3 -o APT::Install-Recommends=False -o Dpkg::Options::=--force-confnew -o Debug::pkgProblemResolver=true
I initially developed that on 5.3.1 (Bionic) and while the code has changed a lot due to fb618338 "Properly handle virtual packages in alternative test dependencies" and 7cc976b0 "Ensure synthesized test dependencies are not satisfied by versioned Provides". So I checked from git, but still the output doe not report unbound as "the guilty one".
The following packages will be REMOVED:
autopkgtest-satdep
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 95547 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...
autopkgtest: WARNING: package strongswan is not installed though it should be
autopkgtest: WARNING: package libstrongswan-standard-plugins is not installed though it should be
autopkgtest: WARNING: package libstrongswan-extra-plugins is not installed though it should be
autopkgtest: WARNING: package libcharon-extra-plugins is not installed though it should be
autopkgtest: WARNING: package strongswan-pki is not installed though it should be
autopkgtest: WARNING: package strongswan-scepclient is not installed though it should be
Example - post fix (the old output stays as-is, this is in addition):
autopkgtest: WARNING: Test dependencies are unsatisfiable - calling apt install on test deps directly for further data about failing dependencies in test log
[...]
Broken libstrongswan-extra-plugins:amd64 Depends on libunbound8:amd64 < none @un H > (>= 1.8.0)
[...]
The following packages have unmet dependencies:
libstrongswan-extra-plugins : Depends: libunbound8 (>= 1.8.0) but it is not installable
E: Unable to correct problems, you have held broken packages.