Hola amigos,

Finally, much awaited dependency calculation post is here. First let me give you a general idea on what dependency calculation mean.

1. Recursively calculating Dependencies:
Dependency calculation means to calculate the dependent packages of a software e.g., A depends on B, C, D to work. So we will need all the 3 packages i.e., B, C and D to be installed before A can be installed. Further B can be dependent on packages I and J, therefore the dependency list is further added with I and J as dependency. So in the end after topologically sorting these packages so that the dependent packages can be properly installed, we get a list of dependency packages like: I, J, B, C, D, A. Noticed how we recursively calculated the dependencies and kept on adding it to front of the dependency list.
But this might not be the case every time and there might be a case where packages C and D conflict each other and cannot be installed along each other. So we would need to see if any other non-conflicting package provides the functionality of the conflicting package. This was just a small example, but now imagine how difficult and time-consuming it would be if the package to be installed has a huge list of dependencies and those dependencies have conflicting packages. The process becomes more and more complex. This is the method that was and still is used in MacPorts.

2. SAT Solving:
Recently, SAT Solving or Boolean Satisfiability Solving method was used for this dependency calculation and conflict resolution. There are different libraries available to do so, but we selected libsolv developed and maintained by openSUSE developers as it had better and promising results as compared to others. And also it is licensed under BSD which is MacPorts license compatible.

Update on 25 April, 2017: Didn’t realize this post was in my draft for more than a year and a half :(. Will summarize the libsolv work completed.

What works:
1. Installation
2. Dependency Calculation.
3. Search with multiple options.

What needs to be done:
1. Uninstallation.
2. Add more variables to Portfile to support wide range of options provided by libsolv search.
3. Handle variants properly.
4. Merge with master on Github.

P.S: If interested to know more or help out with this project drop a mail or send a message on IRC #macports on freenode.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s