[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tips for debugging/testing debian/control Depends/Breaks etc changes?



Hi Otto,

Quoting Otto Kekäläinen (2021-03-24 17:37:46)
> I've noticed I've spent quite a lot of time debugging various situations
> where the debian/control definitions for
> depends/breaks/replaces/conflicts/provides are not optimal.
> 
> The waste of time is two-fold:
> 
> 1) apt is not verbose enough
> 2) the cycle to rebuild/tests is too slow
> 
> As an example of 1, sometimes I see this:
> 
> apt install mariadb-client
>  The following packages have unmet dependencies:
>  mariadb-client : Depends: mariadb-client-10.5 (>= 1:10.5.10) but it
> is not going to be installed
> 
> apt install mariadb-client-10.5
>  Installing.. Done!
> 
> When this happens I have no idea why apt did not resolve the
> dependency by itself automatically, as there was no real conflict in
> installing it.
> 
> Do you have tips on how to debug the root cause of situations like these?
> 
> 
> For the problem 2, I hate to rebuild all of the packages (and
> binaries) just because there was a change in debian/control and go
> through the hassle of updating a test repo etc.
> 
> I wonder if there is some other "lighter" way to just edit the
> debian/control and produce new binary packages with them updated
> without having to actually build new binary packages (and no, editing
> the .deb files manually and repackaging them with 'ar' is not an option that
> would make life easier).

there is a way to throw arbitrary installation problems at the apt solver
without building any *.deb packages and without creating any repos with
Packages and Release files: by using /usr/lib/apt/solvers/apt directly. You do
it by going through the following steps:

1. Create an initial EDSP document that represents the current dependency
   situation. You can do this by running something like this:

       APT_EDSP_DUMP_FILENAME=/tmp/dump.edsp apt-get --simulate install --solver dump ghc

2. Open /tmp/dump.edsp in an editor and edit whatever you need. For example
   with the command above the first stanza will contain:

      Install: ghc:amd64

   And you probably want to change that into whatever you want to ask apt to
   install. Then go through the file and find the stanza for the package that
   you want to change the depends/breaks/replaces/conflicts/provides of and
   change whatever you like.

3. Evaluate the EDSP problem using the apt solver by calling:

      /usr/lib/apt/solvers/apt < /tmp/dump.edsp

   You can improve the output by throwing in options like:

      -oDebug::EDSP::WriteSolution=yes

   Or the options that David Kalnischkies mentioned in his mail.

The advantage is, that you only have to edit one file (the EDSP) and only have
to run one command (/usr/lib/apt/solvers/apt) to check what happens when you
change something. No need to build any actual Debian package or create a
repository with them.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: