Project Idea:

MacPorts: Improve Dependency Calculation using SAT solver.

MacPorts is an open source package manager which makes the process of fetching, compiling and installing open source packages hassle-free and user friendly on Mac OS X. As the dependency calculation code is quite old and there are many new and efficient dependency calculation techniques since, this project aims at upgrading this dependency calculation process and make it fast and efficient by using CUDF based SAT solving method. This project will provide foundation for features like versioned dependency, precomputation of action plan and conflict resolution.

Personal Details:
Name: Jackson Isaac
IRC Nick: JacksonIsaac
Github profile:
Nationality: Indian
Time Zone: +05:30 UTC
Primary Language: English

Clemens Lang (

Main proposal:
MacPorts is an open source package manager which makes the process of fetching, compiling and installing open source packages hassle-free and user friendly on Mac OS X.

As the dependency calculation code is quite old and there have been new and efficient dependency calculation techniques developed since. This project aims at implementing fast and efficient dependency calculation using libsolv based SAT solving method.

There are 2 possible SAT solvers that can be used:

1) libsolv

2) CUDF based solvers.

Edit: After testing CUDF and libsolv solvers and comparing the results, libsolv will be implemented rather than using CUDF based solvers (as mentioned before).

libsolv based SAT solvers has been implemented in many Open Source package manager projects for dependency calculation namely OpenSUSE Libzypp and Fedora DNF. One reason for this would be better and efficient results with a stable installation as the outcome.

CUDF based solvers has been recently implemented in widely used aptitude package managers for Debian and Ubuntu.

On testing libsolv on OpenSUSE using zypper, it took only a matter of few seconds while trying to install a large package like texlive as well as tested using texlive* (which I thought would take time as there would be a long list of dependencies and conflicts).
After testing out CUDF solvers, particularly apt-cudf with aspcud on Debian as well as Ubuntu. It seems like, CUDF solvers are not that efficient for the time being. It took around 2 minutes on Ubuntu to find solution for phpmyadmin and around 15-20 seconds on Debian for the same package. Maybe this was due to the reason that Debian had packages pre-installed while installation. The time taken on Ubuntu was too high and is not practical every time we want to install a package.

libsolv uses BSD-licence which is compatible with MacPorts licensing. So for now, libsolv is a better option as it is implemented and deployed since quite a long time, much more sophisticated and developed than CUDF solvers available with better and faster results.

apt-cudf on Debian
apt-cudf on Debian
apt-cudf on Ubuntu
apt-cudf on Ubuntu
zypper install TexLive
zypper install TexLive
zypper install TexLive*
zypper install TexLive*

Project will be executed in the following Phases:

Phase 1: Implement Portfile parser and convert it into libsolv readable format (rpm, debian , arch linux, or haiku).

Phase 2: Create test cases and test the performance and results. Parse the output of the solver and test for clean installations.

Phase 3: Simple variant support. If time permits, add multiple variants support.


Components to be Implemented:

  • Package universe.
  • PortFile parser.
  • Parser for the output of libsolv.

Package Universe will be updated each time the user runs port selfupdate/sync so that time during installation is saved. Initially the package universe can be provided along with the installation .dmg file and then later updated accordingly, to save initial time as the number of ports are large.

As for the variant support, plan is to make changes to the package universe depending on the variants.

Eg. foo +bar

In universe package, status of bar will become to be installed, if status was not to be installed or suggested package.

Similarly, for “foo -bar” the status would become ‘not to be installed’, if status was to be installed.

Depending on the output of libsolv, if there are dependency issue, find the variant that causes the SAT to fail and recommend the user to run with the required packages to be installed.

Tentative Timeline:

Until April 27 Utilize this time to go through the MacPorts source code and brush up TCL tutorials. Research about libsolv SAT solver to be used and start planning the design of the modules.
April 27 – May 25:Community Bonding Period As I have already being using MacPorts from past year and also have build and installed the latest version from source, I will utilize this time to discuss with my mentor – Clemens Lang, about the weekly schedule plan to be followed and list down the priorities. I will also look into other implementations where libsolv is used and find out a best course of plan. Implement package universe, required by libsolv during this period.
May 25 – May 26: Discuss about the PortFile parser design with Mentor – Clemens Lang  and improvise on the design if required. Discuss on which format to follow (rpm, debian , arch linux, or haiku) to be passed to libsolv.
May 26 – June 6: Begin with implementation of portfile parsing module to interpret PortFiles and convert into libsolv readable format.
June 6 – June 10: Discussion and code review of the ‘portfile parser’ module with Mentor – Clemens Lang. Test the module for desired results and fix bugs. Clean and Optimize the code, wherever possible.
June 10 – June 14: Discuss about the design of libsolv output Parser with Mentor – Clemens Lang.
June 14 – June 26: Implement parser for output of libsolv Solver, to be passed to the installer and test the module. Create test cases for libsolv Solver. Compare the performance and reliability of the results.
June 26 – July 3: Mid Term Evaluation. Code review and testing. Discussion with project mentor Clemens Lang for any improvements to be made to the module. Thorough testing for bugs in the modules implemented and fixing them. Getting the code ready to be submitted for Mid Term Evaluation.
 July 3 – July 9: Strategy and design discussion with Mentor – Clemens Lang about providing variant support for libsolv.
July 9 – July 20: Work on finding efficient way to add variants support. Improve the Portfile parser to support variants. Create simple test cases and test for results. Bug fixing.
July 20 – July 27:
Code Review and Testing of implemented modules. After rigorous testing and achieving desired results, merge the code into MacPorts trunk. Provide support for users and Port maintainers and fix bugs. Also start working on Documentation about the modules so that other developers could understand and work on improving the code in future.
July 27 – Aug 10: Begin Final testing of the implemented modules. Bug fixing. Create test cases and track the performance of the module, it’s reliability and efficient output.
Aug 10 – Aug 24: Pencils Down Date. Final code review and thorough testing for bugs and fix them. Discussion with the mentor about the modules implemented and Code clean-up and getting the modules ready for the Submitting the code to Google. Complete the pending documentations and get the code ready to be integrated with the main repository.


Plans After GSoC:

I will continue working on the MacPorts project and maintaining the modules. Provide support and fix bugs. I would also like to discuss about further improvements that could be made and implement them. Plan possible plan for adding variants support. Get inputs from other users, developers and designers and make MacPorts project better.

Benefits of the project on MacPorts and its community:
This project will improve the dependency calculation of MacPorts which will make the installation of open source packages reliable and stable without any conflicts and breaking the installation. It will also create a base for further improvements to the installation process like adding support for versioned dependencies, solving variant conflicts, etc.

Why me :
I am a Third year Bachelor of Technology, Computer Science and Engineering student from Amrita Vishwa Vidyapeetham (Amritapuri campus), Kerala, India.
I have been using GNU/Linux since 3 years and have been contributing to open source projects since past 2 years, namely GNOME-Music, Mozilla Firefox, Mozillians and MediaWiki-vagrant. I am a part of Linux User Group at the campus, foss @ amrita and have been a FOSS supporter ever since.

Open Source Contributions:

  • GNOME-Music:


2) Github Pull requests

    • Bug #706800Patch: Removed the style “suggested-action” in Cancel Button according to the updated Design mock-ups.
    • Github Issue #114Patch: Call the function directly instead of calling it from within another function which was called too often due to this.
    • Github Issue #105Patch: Cache vadjusment in ViewContainer to save execution time.
    • Github Issue #144  –
      • Clone 1 Patch: Define ‘model’ as a private function in class AlbumWidget and create it again when needed instead of redefining it.
      • Clone 2 Patch: Cache vadjusment in AllArtistsAlbums similar to Github Issue #114.
  • Mozilla
    • Bug #891581Patch: Fix the focus on the input box of Web console when the cursor was blurred and focused on other tab. I have also written an automated mochi-test for testing the patch.
  • Mozillians
  • Mediawiki-vagrant
    • Bug #T87516Patch: Add php-net-smtp and php-auth-sasl packages in vagrant.


Knowledge and Skills Developed through Open Source Contribution:

  • Reading and understanding large source files and codebase.
  • Understanding a problem, how to approach the problem efficiently.
  • Reading error logs, and fixing the errors.
  • Software testing
  • Communication skills (IRC, mailing list, etc)
  • Version control Systems (git, mercurial, subversion)
  • Python 3.x
  • GTK+
  • JavaScript, php
  • Profiling python code.
  • JHBuild

Commitments during Coding Period:
No other commitments from May 21 till last week of July. I can devote 8 – 10 hours everyday on the project. Beginning from the last week of July I would be able to work during the evening time till night for around 5-6 hours on account of academic arrangements in the day time. I will continue my contribution towards MacPorts after the GSoC term and keep maintaining my modules and keep fixing bugs and add more features to it and improve the codebase.

Why MacPorts:
MacPorts is a widely used package manager for Mac OS X. As many users use it regularly for installing open source packages on their system, I would like to use my knowledge and skills to contribute towards this project and make using open source software on Mac systems better, efficient and without any unstable installation.


Filename Modules to be implemented Description
port_parser.tcl Port Parser Extract Portfile data using dlist datastructure and create CUDF
macports.tcl Dependendency Calculations (Update) Upgrade dependency calculation module to use CUDF results.
cudf_parser.tcl Parser for CUDF Solver output. Parse the output of CUDF solver and continue with Installation process.

One thought on “GSoC 2015

Leave a Reply

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

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s