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

RFC interaction with external dependency solver: "APT" state



On Tue, Dec 08, 2009 at 12:04:30PM +0100, Stefano Zacchiroli wrote:
> I'm finally ready to propose a basic format and protocol for interaction
> between package managers and (external) dependency solvers. The format
> is called "Debian-CUDF" [4] and can describe solver input and
> output. The protocol, with a bit of fantasy, can be called "Debian-CUDF
> protocol".

So, let's get back to this topic.

[ First a very brief update. The main concerns raised in the thread were
  absolutely legitimate, in particular the need of having an unique
  package identifier more expressive than <package, version>, to also
  take into account multi-arch and locally rebuilt packages. We will
  soon update CUDF to take that into account and I'll post about that
  separately. ]

I've realized that the proposed way of passing solutions to the external
solver might be more complicated than what is needed. What I asked "you"
on the package manager side was essentially to spit out a Debian-CUDF
document [1] which will then be translated to proper CUDF as it is
consumed by an external solver. The idea of Debian-CUDF was to have a
format close enough to CUDF, but easy for you to generate.

  [1] http://www.mancoosi.org/cudf/debian/

It turns out that I---or better, we on the Mancoosi project side---can
do in autonomy the full conversion to CUDF of the current state, as long
as the solvers can provide us a few pointers to where the information
is. That would simplify the package manager task quite a bit, and avoid
duplication of the code that generate the markup needed to talk with the
external solver.

A draft of the interface can then be something like this:

- the external solver accepts a list of arguments which are in general
  file names, prefixed via a scheme (e.g. "apt:", "dpkg:", ...)

- supported schemes are:

  - "apt:/file/path/on/filesystem" pointing to APT package lists
    (usually a file under /var/lib/apt/lists/)

  - "dpkg:/file/path/on/filesystem" pointing to DPKG status file
    (usually /var/lib/dpkg/status)

  - "extra:/file/path/on/filesystem" pointing to a file of extendend
    information. That file will contain RFC-822 stanzas a-la Packages
    file. Each stanza has a set of fields uniquely identifying packages
    (currently name/version, in the future also the id to discriminate
    multiarch and local packages) and other extra fields with additional
    information, which might be useful for optimizations. It would be
    good to support an extra optional preamble stanza that can be used
    to declare the types of the extra information fields.

The above arguments can in principle be passed on the cmdline, do you
see any risk of running short of argv that justify passing them via
stdin?

The advantage of keeping stdin free would be to use it to pipe the
actual request to the solver, which can be in the beginning something
like this:

  request: some UUID here
  package-manager: apt / aptitude / cupt / ...
  install: ...
  request: ...
  remove: ...

The answer can be in the same format we discussed before (i.e. a
universe dump with "installed: yes" on all and only packages that should
be installed to match the request).

Out of the above information, we already have (Mancoosi side) all the
software components to offer an external solver which matches the above
API (we just need to add some glue, but it should be relatively easy to
do).

Comments?

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime

Attachment: signature.asc
Description: Digital signature


Reply to: