MacPorts: GSoC 2015 - Dependency Calculation using libsolv SAT Solver

Jackson Isaac ijackson at
Fri Aug 14 01:41:11 PDT 2015


As you all know, GSoC 2015 final evaluation and code submission is
almost near I would like to share my experience working with the
MacPorts community and share details about my work.

My project is to upgrade dependency calculation using SAT Solver. We
initially started by testing which solver works better CUDF or libsolv
and then depending on the results we chose libsolv as SAT Solver to be
used to integrate with MacPorts.

Branch link:

Just clone the branch and run the normal ./configure and make, make
install commands. We have made installing libsolv branch easier and
efficient by converting libsolv build to autoconf build and added it
as a subproject. (No more manual set up of libsolv :))

For making things easier, I have tried to write a shell script:

Here's a brief summary of our project.

Work Done:
-> Create libsolv pool by reading PortIndex (added conflicts field)
and registry.
-> Implemented search using libsolv (mportsearch in macports.tcl)
-> Create unit tests for testing libsolv module.
-> Upgraded dependency calculation and installation using libsolv.
(mportinstall in macports.tcl)
-> Conflict resolution with better results while using libsolv.
-> Converted libsolv build from cmake to autoconf and added it to
vendor/ so that libsolv can be built and installed as a subproject
while installing MacPorts.

To be Done:
-> Add variant support with libsolv. (Contacted upstream developer for
their inputs)
-> Differentiate between build and run time dependency.
-> Add support for bin:, lib: or path: style dependencies. At the
moment we are not yet architecture-aware (we just assume an
architecture for each package).
-> Add support for uninstalling stuff using libsolv.

To test the libsolv engine, you can use -l option.
port search -l <portname>
port install -l <portname>
port install -l <portname> <conflictingportname>

More information about the macports-dev mailing list