PHP TO THE RESCUE • PHP Composer: php package manager • https://github.com/composer/composer • Uses SAT solver for dependencies • Open source, well written code, small: • 15k LOC, only 2.5K LOC for dependency handling Monday, 28 October 13
FROM SAT TO DEPENDENCIES • Installing package “A”: (A) • Removing “A”: (~A) • “A” dependencies: (~A | Dep-v1 | Dep-v2 | ...) • Example: A depends on B >= 1.2.2, B-1.3.0 and B-1.4.0 are available becomes (~A | B-1.3.0 | B-1.4.0) Monday, 28 October 13
SOLVER ALGORITHM • minisat, etc... BSD implementations available: • Simple solvers may be implemented in a few 10s of lines • Davis–Putnam–Logemann–Loveland (DPLL) algorithm is a complete, backtracking-based search algorithm Monday, 28 October 13
MAIN CONCEPTS • PackageInfo: package metadata • Repository: bag of packages • Pool: bag of repositories (retrieve packages following a requirement) • Solver: actual solver Monday, 28 October 13
FUTURE PLAN • Add support for removal and updates • Finish support for yaml-based scenario description • Proof of concept for integration with pip Monday, 28 October 13